Class games.Battle.shared.comm.ShellCommand
All Packages Class Hierarchy This Package Previous Next Index
Class games.Battle.shared.comm.ShellCommand
java.lang.Object
|
+----games.Battle.shared.comm.BattlePacket
|
+----games.Battle.shared.comm.ShellCommand
- public class ShellCommand
- extends BattlePacket
ShellCommand is a collection of tags for messages passed between the client
shell and the server core. This packets preceeds other packets which contain
the real data of the command, and serve as a type tag that indicates what
data will follow.
-
CHATMSG
- CHATMSG preceeds an InfoPacket with the text of the player's choice.
-
DISCONNECT
- DISCONNECT quits the connection with the server.
-
GAMES
- GAMES proceeds a list of GameInfo packets.
-
JOIN
- JOIN joins a game
-
QUIT
- QUIT quits a game
-
SHUTDOWN
- SHUTDOWN tells the server to shut down.
-
UPDATEID
- UPDATEID lets the player change their preferences, info, and password.
-
WHO
- WHO preceeds a list of WhoInfo packets.
-
ShellCommand()
- Construct an empty ShellCommand to be read from an input stream.
-
ShellCommand(byte, int)
- Construct a complete shell command.
-
fromBytes(byte[])
- With the given array of bytes, fill this command object
with data.
-
getCommand()
- Return the command code, which must be one of JOIN, QUIT, etc.
-
getGameId()
- Return the gameId that this command applies to.
-
toBytes()
- Return the byte representation.
JOIN
public static byte JOIN
- JOIN joins a game
QUIT
public static byte QUIT
- QUIT quits a game
WHO
public static byte WHO
- WHO preceeds a list of WhoInfo packets.
GAMES
public static byte GAMES
- GAMES proceeds a list of GameInfo packets.
SHUTDOWN
public static byte SHUTDOWN
- SHUTDOWN tells the server to shut down.
DISCONNECT
public static byte DISCONNECT
- DISCONNECT quits the connection with the server.
UPDATEID
public static byte UPDATEID
- UPDATEID lets the player change their preferences, info, and password.
CHATMSG
public static byte CHATMSG
- CHATMSG preceeds an InfoPacket with the text of the player's choice.
ShellCommand
public ShellCommand()
- Construct an empty ShellCommand to be read from an input stream.
ShellCommand
public ShellCommand(byte command,
int gameid)
- Construct a complete shell command.
getCommand
public byte getCommand()
- Return the command code, which must be one of JOIN, QUIT, etc.
getGameId
public int getGameId()
- Return the gameId that this command applies to. 0 in the case of
a command that isn't associated with a particular game.
toBytes
protected byte[] toBytes()
- Return the byte representation.
- Overrides:
- toBytes in class BattlePacket
fromBytes
protected void fromBytes(byte data[])
- With the given array of bytes, fill this command object
with data.
- Parameters:
- data - the data to fill the command with.
- Overrides:
- fromBytes in class BattlePacket
All Packages Class Hierarchy This Package Previous Next Index