public class ChatManager extends Object implements ChatListener
| Constructor and Description |
|---|
ChatManager()
Creates an instance of
ChatManager. |
| Modifier and Type | Method and Description |
|---|---|
void |
addChatListener(ChatListener listener)
Adds a listener to the set that will be notified when a message
arrives at this manager.
|
void |
addPlayerIdMapping(BigInteger playerID,
String playerName)
Notifies the listener about a signle mapping from player
identifier to player name.
|
void |
addPlayerIdMappings(Map<BigInteger,String> uidMap)
Notifies the manager about some set of mappings from identifier
to user name.
|
void |
messageArrived(String message)
Notify the manager when a message has arrived.
|
void |
playerJoined(BigInteger uid)
Called when a player joins the chat group.
|
void |
playerLeft(BigInteger uid)
Called when a player leaves the chat group.
|
void |
sendMessage(String message)
Sends a broadcast chat message to all participants on the current
channel.
|
void |
setChannel(com.sun.sgs.client.ClientChannel channel)
Sets the channel that is used for incoming and outgoing communication.
|
public void setChannel(com.sun.sgs.client.ClientChannel channel)
channel - the communications channelpublic void addChatListener(ChatListener listener)
listener - the chat message listenerpublic void sendMessage(String message)
message - the chat message to sendpublic void playerJoined(BigInteger uid)
playerJoined in interface ChatListeneruid - the identifier for the playerpublic void playerLeft(BigInteger uid)
playerLeft in interface ChatListeneruid - the identifier for the playerpublic void messageArrived(String message)
messageArrived in interface ChatListenersender - the id of the sendermessage - the message itselfpublic void addPlayerIdMappings(Map<BigInteger,String> uidMap)
addPlayerIdMappings in interface ChatListenerpublic void addPlayerIdMapping(BigInteger playerID, String playerName)
ChatListeneraddPlayerIdMapping in interface ChatListenerplayerName - a player nameCopyright © 2013. All Rights Reserved.