Package VASSAL.chat.node
Class NodeClient
java.lang.Object
VASSAL.chat.node.NodeClient
- All Implemented Interfaces:
ServerConnection,ChatServerConnection,LockableChatServerConnection,SocketWatcher,PlayerEncoder,ChatControlsInitializer
- Direct Known Subclasses:
OfficialNodeClient,PrivateNodeClient
public class NodeClient
extends Object
implements LockableChatServerConnection, PlayerEncoder, ChatControlsInitializer, SocketWatcher
- Author:
- rkinney
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected NodeRoom[]protected MainRoomCheckerprotected intprotected SimpleRoomprotected Stringprotected CommandEncoderprotected Stringprotected InviteEncoderprotected NodePlayerprotected Stringprotected PropertyChangeListenerprotected NodeRoomprotected Stringprotected SimpleStatusControlsInitializerprotected intprotected PrivateChatEncoderprotected PropertyChangeListenerprotected PropertyChangeSupportprotected RoomInteractionControlsInitializerprotected SoundEncoderprotected SynchEncoderprotected WelcomeMessageServerstatic StringFields 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
ConstructorsConstructorDescriptionNodeClient(String moduleName, String playerId, CommandEncoder encoder, String host, int port, WelcomeMessageServer welcomer) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddPropertyChangeListener(String propertyName, PropertyChangeListener l)Register a PropertyChangeListener.protected voidvoidProcess an invitation request from a player to join a roomvoidKick a player from this roomvoidRoom[]Return an array of all rooms on the serverReturn the name of the default roomgetRoom()Return the room currently occupied by the playerReturn a Player instance representing the current playervoidhandleMessage(String msg)voidProcess a message received from the serverprotected voidvoidinitializeControls(ChatServerControls controls)Register all event listenersbooleanbooleanisDefaultRoom(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 roomplayerToString(Player p)protected voidvoidvoidsendInvite(Player invitee)Send Invitation to another player to join the current roomvoidsendRoomInfo(NodeRoom r)protected voidvoidSend a Command to a particular playervoidvoidsendToOthers(String msg)voidsendToOthers(Command c)Send a command to other players on the servervoidsetConnected(boolean connect)voidsetDefaultRoomName(String defaultRoomName)voidJoin the given roomvoidvoidsetUserInfo(Player p)Set the Player instance representing this playervoidsocketClosed(SocketHandler handler)stringToPlayer(String s)voiduninitializeControls(ChatServerControls controls)Remove all previously-registered event listenersprotected voidupdateRooms(Node module)
-
Field Details
-
ZIP_HEADER
- See Also:
- Constant Field Values
-
propSupport
-
me
-
currentRoom
-
defaultRoomName
-
allRooms
-
moduleName
-
playerId
-
checker
-
compressionLimit
protected int compressionLimit -
encoder
-
roomControls
-
playerStatusControls
-
soundEncoder
-
privateChatEncoder
-
synchEncoder
-
inviteEncoder
-
nameChangeListener
-
profileChangeListener
-
pendingSynchToRoom
-
host
-
port
protected final int port -
welcomer
-
-
Constructor Details
-
NodeClient
public NodeClient(String moduleName, String playerId, CommandEncoder encoder, String host, int port, WelcomeMessageServer welcomer)
-
-
Method Details
-
setConnected
public void setConnected(boolean connect)- Specified by:
setConnectedin interfaceServerConnection
-
registerNewConnection
protected void registerNewConnection() -
initializeConnection
- Throws:
UnknownHostExceptionIOException
-
closeConnection
protected void closeConnection() -
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceServerConnection
-
socketClosed
- Specified by:
socketClosedin interfaceSocketWatcher
-
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:
playerId- Inviting player nameroomName- 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
-
handleMessage
- Specified by:
handleMessagein interfaceSocketWatcher
-
updateRooms
-
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
-