public class UT2004TCClient
extends cz.cuni.amis.pogamut.base.agent.module.SensomotoricModule<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>
| Constructor and Description |
|---|
UT2004TCClient(cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot bot,
cz.cuni.amis.pogamut.base.communication.worldview.IWorldView teamWorldView) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
beginMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BeginMessage event) |
protected void |
cleanUp() |
protected void |
endMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.EndMessage event) |
cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId |
getBotId() |
int |
getBotTeam() |
Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> |
getConnectedAllBots()
Returns set of all bots connected to the same TC server.
|
cz.cuni.amis.utils.flag.Flag<Boolean> |
getConnectedFlag() |
Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> |
getConnectedChannelBots(int channelId)
Returns set of bots connected to the channel of 'channelId' of the same TC server.
|
Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> |
getConnectedTeamBots()
Returns set of bots of the same team connected to the same TC server.
|
TCChannel |
getChannel(int channelId)
Returns details about bots/channels connected to the team.
|
List<TCMessage> |
getMessages()
TCMessages that came since the last EndMessage, i.e., since the last update, i.e., since the last logic() iteration. |
long |
getSimTime() |
TCTeam |
getTeam()
Returns details about bots/channels connected to the team.
|
boolean |
isConnected()
Whether your bot is connected to the TC server.
|
boolean |
isConnected(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player bot) |
boolean |
isConnected(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId) |
boolean |
isConnectedToChannel(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player bot,
int channelId) |
boolean |
isConnectedToChannel(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId,
int channelId) |
boolean |
isConnectedToMyTeam(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player bot) |
boolean |
isConnectedToMyTeam(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId) |
boolean |
isChannelExist(int channelId) |
TCMinaClient.RequestFuture<TCInfoTeamChannelCreated> |
requestCreateChannel()
Request to create a new channel, the channel will gets channelId assigned by
TCMinaServer. |
TCMinaClient.RequestFuture<TCInfoTeamChannelDestroyed> |
requestDestroyChannel(int channelId)
Request to destroy an existing channel.
|
TCMinaClient.RequestFuture<TCInfoStatus> |
requestGetStatus()
Request
TCInfoStatus update from TCMinaServer. |
TCMinaClient.RequestFuture<TCInfoTeamChannelBotJoined> |
requestJoinChannel(int channelId)
Request to join an existing channel.
|
TCMinaClient.RequestFuture<TCInfoTeamChannelBotLeft> |
requestLeaveChannel(int channelId)
Request to leave an existing channel.
|
protected void |
selfUpdate(cz.cuni.amis.pogamut.base.communication.worldview.object.event.WorldObjectUpdatedEvent<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self> event) |
boolean |
sendToAll(cz.cuni.amis.utils.token.IToken messageType,
Serializable data) |
boolean |
sendToAll(TCMessageData data) |
boolean |
sendToAllOthers(cz.cuni.amis.utils.token.IToken messageType,
Serializable data) |
boolean |
sendToAllOthers(TCMessageData data) |
boolean |
sendToBot(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId bot,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data) |
boolean |
sendToBot(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId bot,
TCMessageData data) |
boolean |
sendToChannel(int channelId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data) |
boolean |
sendToChannel(int channelId,
TCMessageData data) |
boolean |
sendToChannelOthers(int channelId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data) |
boolean |
sendToChannelOthers(int channelId,
TCMessageData data) |
boolean |
sendToTeam(cz.cuni.amis.utils.token.IToken messageType,
Serializable data) |
boolean |
sendToTeam(TCMessageData data) |
boolean |
sendToTeamOthers(cz.cuni.amis.utils.token.IToken messageType,
Serializable data) |
boolean |
sendToTeamOthers(TCMessageData data) |
void |
setServerId(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId tcServerId)
If ID is set (e.g. when running local TC server via
UT2004TCServer.startTCServer() you can obtain id via UT2004TCServer.getServerId()),
the client will connect ONLY to server with this ID. |
protected void |
tcControlServerAlive(TCControlServerAlive event) |
protected void |
tcMessage(TCMessage event) |
public UT2004TCClient(cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot bot,
cz.cuni.amis.pogamut.base.communication.worldview.IWorldView teamWorldView)
public void setServerId(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId tcServerId)
UT2004TCServer.startTCServer() you can obtain id via UT2004TCServer.getServerId()),
the client will connect ONLY to server with this ID. Otherwise it will try to connect to the first server that will broadcast TCControlServerAlive message.tcServerId - public boolean isConnected()
public cz.cuni.amis.utils.flag.Flag<Boolean> getConnectedFlag()
public boolean isConnected(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId)
public boolean isConnected(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player bot)
public boolean isConnectedToMyTeam(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId)
public boolean isConnectedToMyTeam(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player bot)
public boolean isConnectedToChannel(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId,
int channelId)
public boolean isConnectedToChannel(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player bot,
int channelId)
public boolean isChannelExist(int channelId)
public Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> getConnectedAllBots()
public Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> getConnectedTeamBots()
public Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> getConnectedChannelBots(int channelId)
public TCTeam getTeam()
public TCChannel getChannel(int channelId)
public TCMinaClient.RequestFuture<TCInfoTeamChannelCreated> requestCreateChannel()
TCMinaServer.
When created, you will be automatically added to it as its creator.public TCMinaClient.RequestFuture<TCInfoTeamChannelDestroyed> requestDestroyChannel(int channelId)
channelId - public TCMinaClient.RequestFuture<TCInfoStatus> requestGetStatus()
TCInfoStatus update from TCMinaServer.public TCMinaClient.RequestFuture<TCInfoTeamChannelBotJoined> requestJoinChannel(int channelId)
channelId - public TCMinaClient.RequestFuture<TCInfoTeamChannelBotLeft> requestLeaveChannel(int channelId)
channelId - public boolean sendToAll(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
public boolean sendToAll(TCMessageData data)
public boolean sendToTeam(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
public boolean sendToTeam(TCMessageData data)
public boolean sendToChannel(int channelId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
public boolean sendToChannel(int channelId,
TCMessageData data)
public boolean sendToBot(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId bot,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
public boolean sendToBot(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId bot,
TCMessageData data)
public boolean sendToAllOthers(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
public boolean sendToAllOthers(TCMessageData data)
public boolean sendToTeamOthers(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
public boolean sendToTeamOthers(TCMessageData data)
public boolean sendToChannelOthers(int channelId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
public boolean sendToChannelOthers(int channelId,
TCMessageData data)
public List<TCMessage> getMessages()
TCMessages that came since the last EndMessage, i.e., since the last update, i.e., since the last logic() iteration.
This list is auto-emptied every EndMessage.
public cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getBotId()
public int getBotTeam()
public long getSimTime()
protected void selfUpdate(cz.cuni.amis.pogamut.base.communication.worldview.object.event.WorldObjectUpdatedEvent<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self> event)
protected void beginMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BeginMessage event)
protected void endMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.EndMessage event)
protected void tcControlServerAlive(TCControlServerAlive event)
protected void tcMessage(TCMessage event)
protected void cleanUp()
cleanUp in class cz.cuni.amis.pogamut.base.agent.module.AgentModule<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>Copyright © 2019 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.