org.jogre.common.comm
Class CommGameConnect

java.lang.Object
  extended byorg.jogre.common.comm.CommGameMessage
      extended byorg.jogre.common.comm.CommGameConnect
All Implemented Interfaces:
ITransmittable

public class CommGameConnect
extends CommGameMessage

Sends a connect message to a JOGRE server. Consists of a gameID, a username and an optional password (if required).

Version:
Alpha 0.2.3
Author:
Bob Marks

Field Summary
protected  String gameID
          Game ID of game client is playing.
protected  String password
          Password if connecting to the JOGRE master server.
 
Fields inherited from class org.jogre.common.comm.CommGameMessage
status, username, usernameTo, XML_ATT_STATUS, XML_ATT_USERNAME, XML_ATT_USERNAME_TO
 
Constructor Summary
CommGameConnect(String username)
          Used by server to inform other clients that someone has logged onto a game.
CommGameConnect(String username, String gameID)
          Constructor which takes a username, gameID but no password.
CommGameConnect(String username, String password, String gameID)
          Constructor for a communications object for connecting to a client game which includes a password.
CommGameConnect(XMLElement message)
          Constructor which creates a CommConnect object from the flatten () method of another CommConnect object.
 
Method Summary
 XMLElement flatten()
          Flatten the connect object into a XML communication object.
 String getGameID()
          Return the game ID.
 String getPassword()
          Return the password.
 
Methods inherited from class org.jogre.common.comm.CommGameMessage
flatten, getStatus, getUsername, getUsernameTo, isUsernameSet, isUsernameToSet, setUsername, setUsernameTo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

gameID

protected String gameID
Game ID of game client is playing.


password

protected String password
Password if connecting to the JOGRE master server.

Constructor Detail

CommGameConnect

public CommGameConnect(String username)
Used by server to inform other clients that someone has logged onto a game.

Parameters:
username - Username of person logging on.

CommGameConnect

public CommGameConnect(String username,
                       String gameID)
Constructor which takes a username, gameID but no password.

Parameters:
username - Username of person logging on.
gameID - Game ID i.e. game-version (e.g. chess-0.2).

CommGameConnect

public CommGameConnect(String username,
                       String password,
                       String gameID)
Constructor for a communications object for connecting to a client game which includes a password.

Parameters:
username - Username of user logging on.
password - Password of user.
gameID - Game ID i.e. game-version (e.g. chess-0.2).

CommGameConnect

public CommGameConnect(XMLElement message)
                throws TransmissionException
Constructor which creates a CommConnect object from the flatten () method of another CommConnect object.

Parameters:
message -
Throws:
TransmissionException
Method Detail

getGameID

public String getGameID()
Return the game ID.

Returns:
Game id

getPassword

public String getPassword()
Return the password.

Returns:
Password

flatten

public XMLElement flatten()
Flatten the connect object into a XML communication object.

Returns:
XML version of the state of an object which can be constructed again.
See Also:
ITransmittable.flatten()