|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.ut2004.teamcomm.mina.client.TCMinaClient
public class TCMinaClient
| Nested Class Summary | |
|---|---|
static class |
TCMinaClient.RequestFuture<T>
|
| Constructor Summary | |
|---|---|
TCMinaClient(UT2004TCClient owner,
InetSocketAddress connectToAddress,
cz.cuni.amis.pogamut.base.communication.worldview.IWorldView teamWorldView,
Logger log)
|
|
| Method Summary | |
|---|---|
void |
connect()
|
protected void |
connected(org.apache.mina.core.future.ConnectFuture event)
|
void |
exceptionCaught(org.apache.mina.core.session.IoSession session,
Throwable exception)
|
TCChannel |
getChannel(int channelId)
Returns details about bots/channels connected to the team. |
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()
|
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. |
boolean |
isChannelExist(int channelId)
|
boolean |
isConnected(Player bot)
|
boolean |
isConnected(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId)
|
boolean |
isConnectedToChannel(Player bot,
int channelId)
|
boolean |
isConnectedToChannel(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId,
int channelId)
|
boolean |
isConnectedToMyTeam(Player bot)
|
boolean |
isConnectedToMyTeam(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId)
|
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,
boolean includeMe)
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TCMinaClient(UT2004TCClient owner,
InetSocketAddress connectToAddress,
cz.cuni.amis.pogamut.base.communication.worldview.IWorldView teamWorldView,
Logger log)
| Method Detail |
|---|
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(Player bot)
public boolean isConnectedToMyTeam(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId)
public boolean isConnectedToMyTeam(Player bot)
public boolean isConnectedToChannel(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId,
int channelId)
public boolean isConnectedToChannel(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 null
public boolean sendToAll(cz.cuni.amis.utils.token.IToken messageType,
Serializable data)
messageType - CANNOT BE NULLdata - may be null
public 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 well
public boolean sendToTeamOthers(cz.cuni.amis.utils.token.IToken messageType,
Serializable data,
boolean includeMe)
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 well
public 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 well
public 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.IoHandlerException
public void messageReceived(org.apache.mina.core.session.IoSession session,
Object message)
throws Exception
messageReceived in interface org.apache.mina.core.service.IoHandlerException
public void messageSent(org.apache.mina.core.session.IoSession session,
Object message)
throws Exception
messageSent in interface org.apache.mina.core.service.IoHandlerException
public void sessionClosed(org.apache.mina.core.session.IoSession session)
throws Exception
sessionClosed in interface org.apache.mina.core.service.IoHandlerException
public void sessionCreated(org.apache.mina.core.session.IoSession session)
throws Exception
sessionCreated in interface org.apache.mina.core.service.IoHandlerException
public 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.IoHandlerException
public void sessionOpened(org.apache.mina.core.session.IoSession session)
throws Exception
sessionOpened in interface org.apache.mina.core.service.IoHandlerExceptionpublic void stop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||