soc.message
Class SOCMessageTemplateJoinGame

java.lang.Object
  extended by soc.message.SOCMessage
      extended by soc.message.SOCMessageTemplateJoinGame
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
SOCJoinGame, SOCNewGameWithOptionsRequest

public abstract class SOCMessageTemplateJoinGame
extends SOCMessage

This message means that someone is joining a game.

Once the client has successfully joined or created a game or channel, the password field can be left blank in later join/create requests. All server versions ignore the password field after a successful request.

v1.1.07: This template class is copied from SOCJoinGame to share functionality with the new SOCNewGameWithOptions. - JDM

v2.0.00: Don't implement SOCMessageForGame, to avoid server looking for a GameHandler for our new game which doesn't exist yet.

Since:
1.1.07
Author:
Robert S Thomas
See Also:
Serialized Form

Field Summary
protected  java.lang.String game
          Name of game
protected  java.lang.String host
          Server host name to which the client is connecting.
protected  java.lang.String nickname
          Nickname of the joining member
protected static java.lang.String NULLPASS
          symbol to represent a null or empty password over the network, to avoid 2 adjacent field-delimiter characters
protected  java.lang.String password
          Optional password, or "" if none
private static long serialVersionUID
           
 
Fields inherited from class soc.message.SOCMessage
ACCEPTOFFER, ADMINPING, ADMINRESET, AUTHREQUEST, BANKTRADE, BCASTTEXTMSG, BOARDLAYOUT, BOARDLAYOUT2, BOARDSPECIALEDGE, BUILDREQUEST, BUYCARDREQUEST, CANCELBUILDREQUEST, CHANGEFACE, CHANNELS, CHOOSEPLAYER, CHOOSEPLAYERREQUEST, CLEAROFFER, CLEARTRADEMSG, CREATEACCOUNT, DEBUGFREEPLACE, DELETECHANNEL, DELETEGAME, DEVCARDACTION, DEVCARDCOUNT, DICERESULT, DICERESULTRESOURCES, DISCARD, DISCARDREQUEST, DISCOVERYPICK, ENDTURN, FIRSTPLAYER, GAME_NONE, GAMEMEMBERS, GAMEOPTIONGETDEFAULTS, GAMEOPTIONGETINFOS, GAMEOPTIONINFO, GAMES, GAMESERVERTEXT, GAMESTATE, GAMESTATS, GAMESWITHOPTIONS, GAMETEXTMSG, IMAROBOT, INVENTORYITEMACTION, JOIN, JOINAUTH, JOINGAME, JOINGAMEAUTH, LARGESTARMY, LASTSETTLEMENT, LEAVE, LEAVEALL, LEAVEGAME, LEGALEDGES, LOCALIZEDSTRINGS, LONGESTROAD, MAKEOFFER, MEMBERS, messageType, MONOPOLYPICK, MOVEPIECE, MOVEPIECEREQUEST, MOVEROBBER, NEWCHANNEL, NEWGAME, NEWGAMEWITHOPTIONS, NEWGAMEWITHOPTIONSREQUEST, NULLMESSAGE, PICKRESOURCES, PICKRESOURCESREQUEST, PIECEVALUE, PLAYDEVCARDREQUEST, PLAYERELEMENT, PLAYERELEMENTS, PLAYERSTATS, POTENTIALSETTLEMENTS, PUTPIECE, REJECTCONNECTION, REJECTOFFER, REMOVEPIECE, RESETBOARDAUTH, RESETBOARDREJECT, RESETBOARDREQUEST, RESETBOARDVOTE, RESETBOARDVOTEREQUEST, RESOURCECOUNT, REVEALFOGHEX, ROBOTDISMISS, ROBOTJOINGAMEREQUEST, ROLLDICE, ROLLDICEPROMPT, ROLLDICEREQUEST, SCENARIOINFO, sep, sep_char, sep2, sep2_char, SERVERPING, SETPLAYEDDEVCARD, SETSEATLOCK, SETSPECIALITEM, SETTURN, SETUPDONE, SIMPLEACTION, SIMPLEREQUEST, SITDOWN, STARTGAME, STATUSMESSAGE, SVPTEXTMSG, TEXTMSG, TIMINGPING, TURN, UPDATEROBOTPARAMS, VERSION
 
Constructor Summary
SOCMessageTemplateJoinGame(java.lang.String nn, java.lang.String pw, java.lang.String hn, java.lang.String ga)
          Create a Join message.
 
Method Summary
 java.lang.String getGame()
           
 java.lang.String getHost()
           
 java.lang.String getNickname()
           
 java.lang.String getPassword()
           
 java.lang.String toString(java.lang.String classname, java.lang.String otherParams)
           
 
Methods inherited from class soc.message.SOCMessage
arrayIntoStringBuf, enumIntoStringBuf, getClassNameShort, getMaximumVersion, getMinimumVersion, getType, isSingleLineAndSafe, isSingleLineAndSafe, toCmd, toMsg, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

NULLPASS

protected static final java.lang.String NULLPASS
symbol to represent a null or empty password over the network, to avoid 2 adjacent field-delimiter characters

See Also:
Constant Field Values

nickname

protected java.lang.String nickname
Nickname of the joining member


password

protected java.lang.String password
Optional password, or "" if none


game

protected java.lang.String game
Name of game


host

protected java.lang.String host
Server host name to which the client is connecting. Since the client is already connected when it sends the message, this is only informational.

Constructor Detail

SOCMessageTemplateJoinGame

public SOCMessageTemplateJoinGame(java.lang.String nn,
                                  java.lang.String pw,
                                  java.lang.String hn,
                                  java.lang.String ga)
Create a Join message.

Parameters:
nn - nickname
pw - optional password, or ""
hn - server host name
ga - name of the game
Method Detail

getNickname

public java.lang.String getNickname()
Returns:
the nickname

getPassword

public java.lang.String getPassword()
Returns:
the optional password, or "" if none

getHost

public java.lang.String getHost()
Returns:
the server host name to which client is connecting

getGame

public java.lang.String getGame()
Returns:
the game name

toString

public java.lang.String toString(java.lang.String classname,
                                 java.lang.String otherParams)
Parameters:
classname - message name calling this class, appears in returned string
otherParams - null, or other parameters to append in the returned string, of the form "p1=x|p2=y"
Returns:
a human readable form of the message