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.

Variable Index

 o CHATMSG
CHATMSG preceeds an InfoPacket with the text of the player's choice.
 o DISCONNECT
DISCONNECT quits the connection with the server.
 o GAMES
GAMES proceeds a list of GameInfo packets.
 o JOIN
JOIN joins a game
 o QUIT
QUIT quits a game
 o SHUTDOWN
SHUTDOWN tells the server to shut down.
 o UPDATEID
UPDATEID lets the player change their preferences, info, and password.
 o WHO
WHO preceeds a list of WhoInfo packets.

Constructor Index

 o ShellCommand()
Construct an empty ShellCommand to be read from an input stream.
 o ShellCommand(byte, int)
Construct a complete shell command.

Method Index

 o fromBytes(byte[])
With the given array of bytes, fill this command object with data.
 o getCommand()
Return the command code, which must be one of JOIN, QUIT, etc.
 o getGameId()
Return the gameId that this command applies to.
 o toBytes()
Return the byte representation.

Variables

 o JOIN
  public static byte JOIN
JOIN joins a game
 o QUIT
  public static byte QUIT
QUIT quits a game
 o WHO
  public static byte WHO
WHO preceeds a list of WhoInfo packets.
 o GAMES
  public static byte GAMES
GAMES proceeds a list of GameInfo packets.
 o SHUTDOWN
  public static byte SHUTDOWN
SHUTDOWN tells the server to shut down.
 o DISCONNECT
  public static byte DISCONNECT
DISCONNECT quits the connection with the server.
 o UPDATEID
  public static byte UPDATEID
UPDATEID lets the player change their preferences, info, and password.
 o CHATMSG
  public static byte CHATMSG
CHATMSG preceeds an InfoPacket with the text of the player's choice.

Constructors

 o ShellCommand
  public ShellCommand()
Construct an empty ShellCommand to be read from an input stream.
 o ShellCommand
  public ShellCommand(byte command,
                      int gameid)
Construct a complete shell command.

Methods

 o getCommand
  public byte getCommand()
Return the command code, which must be one of JOIN, QUIT, etc.
 o 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.
 o toBytes
  protected byte[] toBytes()
Return the byte representation.
Overrides:
toBytes in class BattlePacket
 o 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