public class TCMinaClient extends Object implements org.apache.mina.core.service.IoHandler
| Modifier and Type | Class and Description |
|---|---|
static class |
TCMinaClient.RequestFuture<T> |
| Constructor and Description |
|---|
TCMinaClient(UT2004TCClient owner,
InetSocketAddress connectToAddress,
cz.cuni.amis.pogamut.base.communication.worldview.IWorldView teamWorldView,
Logger log) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect() |
protected void |
connected(org.apache.mina.core.future.ConnectFuture event) |
void |
event(org.apache.mina.core.session.IoSession arg0,
org.apache.mina.filter.FilterEvent arg1) |
void |
exceptionCaught(org.apache.mina.core.session.IoSession session,
Throwable exception) |
cz.cuni.amis.utils.flag.ImmutableFlag<Boolean> |
getConnected() |
Set<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> |
getConnectedAllBots()
Returns set of all bots connected to the same TC server.
|
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.
|
cz.cuni.amis.utils.flag.ImmutableFlag<Boolean> |
getConnecting() |
String |
getHost() |
TCChannel |
getChannel(int channelId)
Returns details about bots/channels connected to the team.
|
int |
getPort() |
TCTeam |
getTeam()
Returns details about bots/channels connected to the team.
|
cz.cuni.amis.pogamut.base.communication.worldview.IWorldView |
getWorldView()
WorldView used by this
TCMinaClient. |
void |
inputClosed(org.apache.mina.core.session.IoSession arg0) |
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) |
void |
messageReceived(org.apache.mina.core.session.IoSession session,
Object message) |
void |
messageSent(org.apache.mina.core.session.IoSession session,
Object message) |
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.
|
boolean |
sendPrivate(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId targetBotId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
Sends private message to a concrete bot.
|
boolean |
sendToAll(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
Sends message to ALL connected bots (not just to your team) INCLUDING you (you WILL receive the message AS WELL).
|
boolean |
sendToAll(cz.cuni.amis.utils.token.IToken messageType,
Serializable data,
boolean includeMe)
Sends message to ALL connected bots (not just to your team)
|
boolean |
sendToAllOthers(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
Sends message to ALL connected bots (not just to your team) EXCLUDING you (you will NOT receive the message).
|
boolean |
sendToChannel(int channelId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
Sends message to a CONCRETE CHANNEL you are connected to INCLUDING you (you WILL receive the message AS WELL).
|
boolean |
sendToChannel(int channelId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data,
boolean includeMe)
Sends message to a CONCRETE CHANNEL you are connected to.
|
boolean |
sendToChannelOthers(int channelId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
Sends message to a CONCRETE CHANNEL you are connected to EXCLUDING you (you will NOT receive the message).
|
boolean |
sendToTeam(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
Sends message to connected bots of YOUR TEAM (not to all bots connected to the TC server) INCLUDING you (you WILL receive the message AS WELL).
|
boolean |
sendToTeam(cz.cuni.amis.utils.token.IToken messageType,
Serializable data,
boolean includeMe)
Sends message to connected bots of YOUR TEAM (not to all bots connected to the TC server).
|
boolean |
sendToTeamOthers(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
Sends message to connected bots of YOUR TEAM (not to all bots connected to the TC server) EXCLUDING you (you will NOT receive the message).
|
void |
sessionClosed(org.apache.mina.core.session.IoSession session) |
void |
sessionCreated(org.apache.mina.core.session.IoSession session) |
void |
sessionIdle(org.apache.mina.core.session.IoSession session,
org.apache.mina.core.session.IdleStatus status) |
void |
sessionOpened(org.apache.mina.core.session.IoSession session) |
void |
stop() |
public TCMinaClient(UT2004TCClient owner, InetSocketAddress connectToAddress, cz.cuni.amis.pogamut.base.communication.worldview.IWorldView teamWorldView, Logger log)
public String getHost()
public int getPort()
public cz.cuni.amis.pogamut.base.communication.worldview.IWorldView getWorldView()
TCMinaClient. We're auto-propagating incoming messages to this.public cz.cuni.amis.utils.flag.ImmutableFlag<Boolean> getConnected()
public cz.cuni.amis.utils.flag.ImmutableFlag<Boolean> getConnecting()
public void connect()
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 sendToAllOthers(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
messageType - CANNOT BE NULLdata - may be nullpublic boolean sendToAll(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
messageType - CANNOT BE NULLdata - may be nullpublic boolean sendToAll(cz.cuni.amis.utils.token.IToken messageType,
Serializable data,
boolean includeMe)
messageType - CANNOT BE NULLdata - may be nullincludeMe - whether the message should be send to YOU (your client) as wellpublic boolean sendToTeamOthers(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
messageType - CANNOT BE NULLdata - may be null.public boolean sendToTeam(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
messageType - CANNOT BE NULLdata - may be null.public boolean sendToTeam(cz.cuni.amis.utils.token.IToken messageType,
Serializable data,
boolean includeMe)
messageType - CANNOT BE NULLdata - may be null.includeMe - whether the message should be send to YOU (your client) as wellpublic boolean sendToChannelOthers(int channelId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
channelId - messageType - data - public boolean sendToChannel(int channelId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
channelId - messageType - data - public boolean sendToChannel(int channelId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data,
boolean includeMe)
channelId - messageType - data - includeMe - whether the message should be send to YOU (your client) as wellpublic boolean sendPrivate(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId targetBotId,
cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
targetBotId - messageType - data - protected void connected(org.apache.mina.core.future.ConnectFuture event)
public void exceptionCaught(org.apache.mina.core.session.IoSession session,
Throwable exception)
throws Exception
exceptionCaught in interface org.apache.mina.core.service.IoHandlerExceptionpublic void messageReceived(org.apache.mina.core.session.IoSession session,
Object message)
throws Exception
messageReceived in interface org.apache.mina.core.service.IoHandlerExceptionpublic void messageSent(org.apache.mina.core.session.IoSession session,
Object message)
throws Exception
messageSent in interface org.apache.mina.core.service.IoHandlerExceptionpublic void sessionClosed(org.apache.mina.core.session.IoSession session)
throws Exception
sessionClosed in interface org.apache.mina.core.service.IoHandlerExceptionpublic void sessionCreated(org.apache.mina.core.session.IoSession session)
throws Exception
sessionCreated in interface org.apache.mina.core.service.IoHandlerExceptionpublic void sessionIdle(org.apache.mina.core.session.IoSession session,
org.apache.mina.core.session.IdleStatus status)
throws Exception
sessionIdle in interface org.apache.mina.core.service.IoHandlerExceptionpublic void sessionOpened(org.apache.mina.core.session.IoSession session)
throws Exception
sessionOpened in interface org.apache.mina.core.service.IoHandlerExceptionpublic void stop()
public void inputClosed(org.apache.mina.core.session.IoSession arg0)
throws Exception
inputClosed in interface org.apache.mina.core.service.IoHandlerExceptionCopyright © 2019 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.