soc.message
Class SOCGames

java.lang.Object
  extended by soc.message.SOCMessage
      extended by soc.message.SOCGames
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class SOCGames
extends SOCMessage

This message lists all the soc games currently on a server, without game options. It's constructed and sent for each connecting client which can't understand game options (older than 1.1.07).

Version 1.1.06 and later: Any game's name within the list may start with the "unjoinable" marker prefix MARKER_THIS_GAME_UNJOINABLE.

Author:
Robert S Thomas
See Also:
SOCGamesWithOptions, Serialized Form

Field Summary
private  java.util.Vector<java.lang.String> games
          List of games (Strings)
static char MARKER_THIS_GAME_UNJOINABLE
          If this is the first character of a game name, the client is too limited to be able to play that game, due to properties of the game (large board, expansion rules, etc.) which may require a newer client.
private static long serialVersionUID
           
static int VERSION_FOR_UNJOINABLE
          Minimum version (1.1.06) of client/server which recognize and send MARKER_THIS_GAME_UNJOINABLE.
 
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
SOCGames(java.util.Vector<java.lang.String> ga)
          Create a Games Message.
 
Method Summary
 java.util.Vector<java.lang.String> getGames()
           
static SOCGames parseDataStr(java.lang.String s)
          Parse the command String into a Games message
 java.lang.String toCmd()
          GAMES sep games
static java.lang.String toCmd(java.util.Vector<?> ga)
          GAMES sep games
 java.lang.String toString()
          Simple human-readable representation, used for debug purposes.
 
Methods inherited from class soc.message.SOCMessage
arrayIntoStringBuf, enumIntoStringBuf, getClassNameShort, getMaximumVersion, getMinimumVersion, getType, isSingleLineAndSafe, isSingleLineAndSafe, toMsg
 
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

MARKER_THIS_GAME_UNJOINABLE

public static final char MARKER_THIS_GAME_UNJOINABLE
If this is the first character of a game name, the client is too limited to be able to play that game, due to properties of the game (large board, expansion rules, etc.) which may require a newer client.

This marker may be used in other message types which may introduce a new game, such as SOCNewGame and SOCNewGameWithOptions. Besides those, this marker is not used in any other message types, such as SOCDeleteGame. The game name appears 'un-marked' in those other types.

Since:
1.1.06
See Also:
Constant Field Values

VERSION_FOR_UNJOINABLE

public static final int VERSION_FOR_UNJOINABLE
Minimum version (1.1.06) of client/server which recognize and send MARKER_THIS_GAME_UNJOINABLE.

Since:
1.1.06
See Also:
Constant Field Values

games

private java.util.Vector<java.lang.String> games
List of games (Strings)

Constructor Detail

SOCGames

public SOCGames(java.util.Vector<java.lang.String> ga)
Create a Games Message.

Parameters:
ga - list of game names (Strings). Mark unjoinable games with the prefix MARKER_THIS_GAME_UNJOINABLE.
Method Detail

getGames

public java.util.Vector<java.lang.String> getGames()
Returns:
the list of games, a vector of Strings

toCmd

public java.lang.String toCmd()
GAMES sep games

Specified by:
toCmd in class SOCMessage
Returns:
the command string

toCmd

public static java.lang.String toCmd(java.util.Vector<?> ga)
GAMES sep games

Parameters:
ga - the list of games, as a mixed-content vector of Strings and/or SOCGames; if a client can't join a game, it should be a String prefixed with MARKER_THIS_GAME_UNJOINABLE.
Returns:
the command string

parseDataStr

public static SOCGames parseDataStr(java.lang.String s)
Parse the command String into a Games message

Parameters:
s - the String to parse
Returns:
a Games message, or null of the data is garbled

toString

public java.lang.String toString()
Description copied from class: SOCMessage
Simple human-readable representation, used for debug purposes.

Specified by:
toString in class SOCMessage
Returns:
a human readable form of the message