Package VASSAL.chat.node
Class NodeClient
java.lang.Object
VASSAL.chat.node.NodeClient
- All Implemented Interfaces:
ServerConnection,ChatServerConnection,LockableChatServerConnection,PlayerEncoder,ChatControlsInitializer
- Direct Known Subclasses:
SocketNodeClient
public abstract class NodeClient extends Object implements LockableChatServerConnection, PlayerEncoder, ChatControlsInitializer
- Author:
- rkinney
-
Field Summary
Fields inherited from interface VASSAL.chat.ChatServerConnection
AVAILABLE_ROOMS, DEFAULT_ROOM_NAME, INCOMING_MSG, PLAYER_INFO, ROOM, STATUS, STATUS_SERVERFields inherited from interface VASSAL.build.module.ServerConnection
CONNECTED -
Constructor Summary
Constructors Constructor Description NodeClient(String moduleName, String playerId, CommandEncoder encoder, MessageBoard msgSvr, WelcomeMessageServer welcomer) -
Method Summary
Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener l)voidaddPropertyChangeListener(String propertyName, PropertyChangeListener l)Register a PropertyChangeListener.protected abstract voidcloseConnection()voiddoInvite(String playerId, String roomName)Process an invitation request from a player to join a roomvoiddoKick(Player kickee)Kick a player from this roomvoidforward(String receipientPath, String msg)Room[]getAvailableRooms()Return an array of all rooms on the serverStringgetDefaultRoomName()Return the name of the default roomMessage[]getMessages()MessageBoardgetMessageServer()NodePlayergetMyInfo()RoomgetRoom()Return the room currently occupied by the playerPlayergetUserInfo()Return a Player instance representing the current playervoidhandleMessageFromServer(String msg)Process a message received from the serverprotected abstract voidinitializeConnection()voidinitializeControls(ChatServerControls controls)Register all event listenersbooleanisDefaultRoom(Room r)Is specified room the default room?booleanisInvitable(Player invitee)Can a player be invited to this room by me?booleanisKickable(Player kickee)Can a player be kicked from this room by me?voidlockRoom(LockableRoom r)Lock/Unlock the given roomStringplayerToString(Player p)voidpostMessage(String msg)protected voidregisterNewConnection()abstract voidsend(String command)voidsendInvite(Player invitee)Send Invitation to another player to join the current roomvoidsendRoomInfo(NodeRoom r)protected voidsendStats()voidsendTo(Player recipient, Command c)Send a Command to a particular playervoidsendToAll(String msg)voidsendToOthers(String msg)voidsendToOthers(Command c)Send a command to other players on the servervoidsetConnected(boolean connect)voidsetDefaultRoomName(String defaultRoomName)voidsetRoom(Room r)Join the given roomvoidsetRoom(Room r, String password)voidsetUserInfo(Player p)Set the Player instance representing this playerPlayerstringToPlayer(String s)voiduninitializeControls(ChatServerControls controls)Remove all previously-registered event listenersprotected voidupdateRooms(Node module)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VASSAL.build.module.ServerConnection
isConnected
-
Field Details
-
ZIP_HEADER
- See Also:
- Constant Field Values
-
propSupport
-
me
-
currentRoom
-
defaultRoomName
-
allRooms
-
msgSvr
-
welcomer
-
serverStatus
-
moduleName
-
playerId
-
checker
-
compressionLimit
protected int compressionLimit -
encoder
-
messageBoardControls
-
roomControls
-
serverStatusControls
-
playerStatusControls
-
soundEncoder
-
privateChatEncoder
-
synchEncoder
-
inviteEncoder
-
nameChangeListener
-
profileChangeListener
-
pendingSynchToRoom
-
-
Constructor Details
-
NodeClient
public NodeClient(String moduleName, String playerId, CommandEncoder encoder, MessageBoard msgSvr, WelcomeMessageServer welcomer)
-
-
Method Details
-
setConnected
public void setConnected(boolean connect)- Specified by:
setConnectedin interfaceServerConnection
-
registerNewConnection
protected void registerNewConnection() -
closeConnection
protected abstract void closeConnection() -
initializeConnection
- Throws:
IOException
-
send
-
setDefaultRoomName
-
getDefaultRoomName
Description copied from interface:LockableChatServerConnectionReturn the name of the default room- Specified by:
getDefaultRoomNamein interfaceLockableChatServerConnection
-
isDefaultRoom
Description copied from interface:LockableChatServerConnectionIs specified room the default room?- Specified by:
isDefaultRoomin interfaceLockableChatServerConnection
-
sendStats
protected void sendStats() -
sendToOthers
Description copied from interface:ServerConnectionSend a command to other players on the server- Specified by:
sendToOthersin interfaceServerConnection
-
sendToAll
-
forward
-
sendToOthers
-
sendTo
Description copied from interface:ChatServerConnectionSend a Command to a particular player- Specified by:
sendToin interfaceChatServerConnection
-
doKick
Description copied from interface:LockableChatServerConnectionKick a player from this room- Specified by:
doKickin interfaceLockableChatServerConnection
-
isKickable
Description copied from interface:LockableChatServerConnectionCan a player be kicked from this room by me?- Specified by:
isKickablein interfaceLockableChatServerConnection
-
isInvitable
Description copied from interface:LockableChatServerConnectionCan a player be invited to this room by me?- Specified by:
isInvitablein interfaceLockableChatServerConnection
-
sendInvite
Send Invitation to another player to join the current room- Specified by:
sendInvitein interfaceLockableChatServerConnection- Parameters:
invitee- Player to invite
-
doInvite
Process an invitation request from a player to join a room- Specified by:
doInvitein interfaceLockableChatServerConnection- Parameters:
player- Inviting player nameroom- Inviting room
-
getRoom
Description copied from interface:ChatServerConnectionReturn the room currently occupied by the player- Specified by:
getRoomin interfaceChatServerConnection
-
getAvailableRooms
Description copied from interface:ChatServerConnectionReturn an array of all rooms on the server- Specified by:
getAvailableRoomsin interfaceChatServerConnection
-
addPropertyChangeListener
Description copied from interface:ServerConnectionRegister a PropertyChangeListener. Changes to connection status triggers a PropertyChangeEvent, and concrete implementations may define other properties- Specified by:
addPropertyChangeListenerin interfaceServerConnection
-
addPropertyChangeListener
-
getUserInfo
Description copied from interface:ChatServerConnectionReturn a Player instance representing the current player- Specified by:
getUserInfoin interfaceChatServerConnection
-
getMyInfo
-
setUserInfo
Description copied from interface:ChatServerConnectionSet the Player instance representing this player- Specified by:
setUserInfoin interfaceChatServerConnection
-
lockRoom
Description copied from interface:LockableChatServerConnectionLock/Unlock the given room- Specified by:
lockRoomin interfaceLockableChatServerConnection
-
sendRoomInfo
-
setRoom
Description copied from interface:ChatServerConnectionJoin the given room- Specified by:
setRoomin interfaceChatServerConnection
-
setRoom
-
handleMessageFromServer
Process a message received from the server- Parameters:
msg- Encoded message
-
updateRooms
-
getMessageServer
-
getMessages
-
postMessage
-
stringToPlayer
- Specified by:
stringToPlayerin interfacePlayerEncoder
-
playerToString
- Specified by:
playerToStringin interfacePlayerEncoder
-
initializeControls
Description copied from interface:ChatControlsInitializerRegister all event listeners- Specified by:
initializeControlsin interfaceChatControlsInitializer
-
uninitializeControls
Description copied from interface:ChatControlsInitializerRemove all previously-registered event listeners- Specified by:
uninitializeControlsin interfaceChatControlsInitializer
-