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_SERVER
Fields 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 void
addPropertyChangeListener(PropertyChangeListener l)
void
addPropertyChangeListener(String propertyName, PropertyChangeListener l)
Register a PropertyChangeListener.protected abstract void
closeConnection()
void
doInvite(String playerId, String roomName)
Process an invitation request from a player to join a roomvoid
doKick(Player kickee)
Kick a player from this roomvoid
forward(String receipientPath, String msg)
Room[]
getAvailableRooms()
Return an array of all rooms on the serverString
getDefaultRoomName()
Return the name of the default roomMessage[]
getMessages()
MessageBoard
getMessageServer()
NodePlayer
getMyInfo()
Room
getRoom()
Return the room currently occupied by the playerPlayer
getUserInfo()
Return a Player instance representing the current playervoid
handleMessageFromServer(String msg)
Process a message received from the serverprotected abstract void
initializeConnection()
void
initializeControls(ChatServerControls controls)
Register all event listenersboolean
isDefaultRoom(Room r)
Is specified room the default room?boolean
isInvitable(Player invitee)
Can a player be invited to this room by me?boolean
isKickable(Player kickee)
Can a player be kicked from this room by me?void
lockRoom(LockableRoom r)
Lock/Unlock the given roomString
playerToString(Player p)
void
postMessage(String msg)
protected void
registerNewConnection()
abstract void
send(String command)
void
sendInvite(Player invitee)
Send Invitation to another player to join the current roomvoid
sendRoomInfo(NodeRoom r)
protected void
sendStats()
void
sendTo(Player recipient, Command c)
Send a Command to a particular playervoid
sendToAll(String msg)
void
sendToOthers(String msg)
void
sendToOthers(Command c)
Send a command to other players on the servervoid
setConnected(boolean connect)
void
setDefaultRoomName(String defaultRoomName)
void
setRoom(Room r)
Join the given roomvoid
setRoom(Room r, String password)
void
setUserInfo(Player p)
Set the Player instance representing this playerPlayer
stringToPlayer(String s)
void
uninitializeControls(ChatServerControls controls)
Remove all previously-registered event listenersprotected void
updateRooms(Node module)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
setConnected
in interfaceServerConnection
-
registerNewConnection
protected void registerNewConnection() -
closeConnection
protected abstract void closeConnection() -
initializeConnection
- Throws:
IOException
-
send
-
setDefaultRoomName
-
getDefaultRoomName
Description copied from interface:LockableChatServerConnection
Return the name of the default room- Specified by:
getDefaultRoomName
in interfaceLockableChatServerConnection
-
isDefaultRoom
Description copied from interface:LockableChatServerConnection
Is specified room the default room?- Specified by:
isDefaultRoom
in interfaceLockableChatServerConnection
-
sendStats
protected void sendStats() -
sendToOthers
Description copied from interface:ServerConnection
Send a command to other players on the server- Specified by:
sendToOthers
in interfaceServerConnection
-
sendToAll
-
forward
-
sendToOthers
-
sendTo
Description copied from interface:ChatServerConnection
Send a Command to a particular player- Specified by:
sendTo
in interfaceChatServerConnection
-
doKick
Description copied from interface:LockableChatServerConnection
Kick a player from this room- Specified by:
doKick
in interfaceLockableChatServerConnection
-
isKickable
Description copied from interface:LockableChatServerConnection
Can a player be kicked from this room by me?- Specified by:
isKickable
in interfaceLockableChatServerConnection
-
isInvitable
Description copied from interface:LockableChatServerConnection
Can a player be invited to this room by me?- Specified by:
isInvitable
in interfaceLockableChatServerConnection
-
sendInvite
Send Invitation to another player to join the current room- Specified by:
sendInvite
in interfaceLockableChatServerConnection
- Parameters:
invitee
- Player to invite
-
doInvite
Process an invitation request from a player to join a room- Specified by:
doInvite
in interfaceLockableChatServerConnection
- Parameters:
player
- Inviting player nameroom
- Inviting room
-
getRoom
Description copied from interface:ChatServerConnection
Return the room currently occupied by the player- Specified by:
getRoom
in interfaceChatServerConnection
-
getAvailableRooms
Description copied from interface:ChatServerConnection
Return an array of all rooms on the server- Specified by:
getAvailableRooms
in interfaceChatServerConnection
-
addPropertyChangeListener
Description copied from interface:ServerConnection
Register a PropertyChangeListener. Changes to connection status triggers a PropertyChangeEvent, and concrete implementations may define other properties- Specified by:
addPropertyChangeListener
in interfaceServerConnection
-
addPropertyChangeListener
-
getUserInfo
Description copied from interface:ChatServerConnection
Return a Player instance representing the current player- Specified by:
getUserInfo
in interfaceChatServerConnection
-
getMyInfo
-
setUserInfo
Description copied from interface:ChatServerConnection
Set the Player instance representing this player- Specified by:
setUserInfo
in interfaceChatServerConnection
-
lockRoom
Description copied from interface:LockableChatServerConnection
Lock/Unlock the given room- Specified by:
lockRoom
in interfaceLockableChatServerConnection
-
sendRoomInfo
-
setRoom
Description copied from interface:ChatServerConnection
Join the given room- Specified by:
setRoom
in interfaceChatServerConnection
-
setRoom
-
handleMessageFromServer
Process a message received from the server- Parameters:
msg
- Encoded message
-
updateRooms
-
getMessageServer
-
getMessages
-
postMessage
-
stringToPlayer
- Specified by:
stringToPlayer
in interfacePlayerEncoder
-
playerToString
- Specified by:
playerToString
in interfacePlayerEncoder
-
initializeControls
Description copied from interface:ChatControlsInitializer
Register all event listeners- Specified by:
initializeControls
in interfaceChatControlsInitializer
-
uninitializeControls
Description copied from interface:ChatControlsInitializer
Remove all previously-registered event listeners- Specified by:
uninitializeControls
in interfaceChatControlsInitializer
-