Package VASSAL.chat.node
Class Protocol
java.lang.Object
VASSAL.chat.node.Protocol
Utility method for encoding server-related commands into strings. Messages
sent or interpreted by the server are encoded here. Messages sent from one
client to another are simply forwarded as strings without being decoded.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
decodeForwardCommand(String cmd)
static String[]
decodeJoinCommand(String cmd)
static String[]
decodeKickCommand(String cmd)
static Node
decodeListCommand(String cmd)
static String
decodeLoginCommand(String cmd)
static String[]
decodeNodeInfoCommand(String cmd)
static String[]
decodeRegisterCommand(String cmd)
static boolean
decodeRegisterRequest(String cmd)
static Properties
decodeRoomsInfo(String cmd)
static String[]
decodeStatsCommand(String cmd)
static String
encodeForwardCommand(String recipientPath, String message)
Forward a message to other client nodesstatic String
encodeJoinCommand(String newParentPath)
Sent when a player wishes to join a roomstatic String
encodeJoinCommand(String newParentPath, String password)
Sent when a player is invited to join a locked roomstatic String
encodeKickCommand(String kickeeId)
Sent by the owner of a room to kick another player back to the Main Roomstatic String
encodeListCommand(Node[] nodes)
A dump of the current connections to the server.static String
encodeLoginCommand(String username)
Sent when associating a connection with a given usernamestatic String
Sent when the info for a particular (non-player) node is updatedstatic String
encodeRegisterCommand(String id, String initialPath, String info)
Contains registration information sent when a client initially connects to the serverstatic String
static String
encodeRoomsInfo(Node[] rooms)
Sent when a room's info changes, or to update all rooms' info at oncestatic String
encodeStatsCommand(String info)
Sent when a player updates his personal information
-
Field Details
-
REGISTER
- See Also:
- Constant Field Values
-
REG_REQUEST
- See Also:
- Constant Field Values
-
JOIN
- See Also:
- Constant Field Values
-
FORWARD
- See Also:
- Constant Field Values
-
STATS
- See Also:
- Constant Field Values
-
LIST
- See Also:
- Constant Field Values
-
CONTENTS
- See Also:
- Constant Field Values
-
NODE_INFO
- See Also:
- Constant Field Values
-
ROOM_INFO
- See Also:
- Constant Field Values
-
LOGIN
- See Also:
- Constant Field Values
-
KICK
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Protocol
public Protocol()
-
-
Method Details
-
encodeRegisterCommand
Contains registration information sent when a client initially connects to the server- Parameters:
id
-initialPath
-info
-- Returns:
-
decodeRegisterCommand
- Returns:
- senderId, newParentPath, senderInfo
- See Also:
encodeRegisterCommand(java.lang.String, java.lang.String, java.lang.String)
-
encodeJoinCommand
Sent when a player wishes to join a room- Parameters:
newParentPath
-- Returns:
-
encodeJoinCommand
Sent when a player is invited to join a locked room- Parameters:
newParentPath
-password
-- Returns:
-
decodeJoinCommand
- Returns:
- newParentPath
- See Also:
encodeJoinCommand(java.lang.String)
-
encodeForwardCommand
Forward a message to other client nodes- Parameters:
recipientPath
- a path name specifying the indented recipients of the messagemessage
-- Returns:
-
decodeForwardCommand
- Returns:
- recipientPath, message
- See Also:
encodeForwardCommand(java.lang.String, java.lang.String)
-
encodeStatsCommand
Sent when a player updates his personal information- Parameters:
info
- the encoded properties of thePlayerNode
corresponding to the player- Returns:
- See Also:
Node.setInfo(java.lang.String)
-
decodeStatsCommand
- Returns:
- path, playerProperties
- See Also:
encodeStatsCommand(java.lang.String)
-
encodeNodeInfoCommand
Sent when the info for a particular (non-player) node is updated- Parameters:
n
-- Returns:
-
decodeNodeInfoCommand
- Parameters:
cmd
-- Returns:
- path, info
- See Also:
encodeNodeInfoCommand(VASSAL.chat.node.Node)
-
encodeRoomsInfo
Sent when a room's info changes, or to update all rooms' info at once- Parameters:
rooms
-- Returns:
-
decodeRoomsInfo
-
encodeListCommand
A dump of the current connections to the server. Includes a path name and info for each player node- Parameters:
nodes
-- Returns:
-
decodeListCommand
- Parameters:
cmd
-- Returns:
- See Also:
encodeListCommand(VASSAL.chat.node.Node[])
-
decodeRegisterRequest
-
encodeRegisterRequest
-
encodeLoginCommand
Sent when associating a connection with a given username- Parameters:
username
-- See Also:
ConnectionLimiter
-
decodeLoginCommand
-
encodeKickCommand
Sent by the owner of a room to kick another player back to the Main Room- Parameters:
kickeeId
-- Returns:
- player
-
decodeKickCommand
-