|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.message.SOCMessage soc.message.SOCMessageMulti soc.message.SOCMessageTemplateMs soc.message.SOCGamesWithOptions
public class SOCGamesWithOptions
List of all games currently on the server, including
their game options
.
It's constructed and sent for each connecting client
which can understand game options (1.1.07 and newer),
by calling toCmd(Vector, int)
.
Robot clients don't need to know about or handle this message type, because they don't create games.
Introduced in 1.1.07; check client version against
SOCNewGameWithOptions.VERSION_FOR_NEWGAMEWITHOPTIONS
.
SOCGames
,
Serialized FormField Summary | |
---|---|
private static long |
serialVersionUID
|
Fields inherited from class soc.message.SOCMessageTemplateMs |
---|
game, pa |
Constructor Summary | |
---|---|
protected |
SOCGamesWithOptions(java.util.List<java.lang.String> gl)
Constructor for client to parse server's list of games. |
Method Summary | |
---|---|
SOCGameList |
getGameList()
Get the list of games (and option strings). |
int |
getMinimumVersion()
Minimum version where this message type is used. |
static SOCGamesWithOptions |
parseDataStr(java.util.List<java.lang.String> gl)
Parse the command String array into a SOCGamesWithOptions message. |
static java.lang.String |
toCmd(java.util.Vector<?> ga,
int cliVers)
Build the command string from a set of games; used at server side. |
Methods inherited from class soc.message.SOCMessageTemplateMs |
---|
getGame, getParams, toCmd, toCmd, toString |
Methods inherited from class soc.message.SOCMessage |
---|
arrayIntoStringBuf, enumIntoStringBuf, getClassNameShort, getMaximumVersion, getType, isSingleLineAndSafe, isSingleLineAndSafe, toMsg |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface soc.message.SOCMessageForGame |
---|
getType |
Field Detail |
---|
private static final long serialVersionUID
Constructor Detail |
---|
protected SOCGamesWithOptions(java.util.List<java.lang.String> gl)
SOCGameOption
objects; call SOCGameOption.parseOptionsToMap(String)
for that.
There is no server-side constructor, because the server
instead calls toCmd(Vector, int)
.
gl
- Game list; can be empty, but not nullMethod Detail |
---|
public SOCGameList getGameList()
SOCGameOption.packOptionsToString(opts, boolean)
.
Game names may be marked with the prefix SOCGames.MARKER_THIS_GAME_UNJOINABLE
;
this will be removed from their names before adding to the returned game list.
To see if a game cannot be joined, call SOCGameList.isUnjoinableGame(String)
.
SOCGameList.parseGameOptions(String)
public int getMinimumVersion()
getMinimumVersion
in class SOCMessage
public static SOCGamesWithOptions parseDataStr(java.util.List<java.lang.String> gl)
gl
- the game list; must contain an even number of strings
(pairs of game names+options); can be null or empty
public static java.lang.String toCmd(java.util.Vector<?> ga, int cliVers)
ga
- the list of games, as a mixed-content vector of Strings and/or SOCGame
s;
if a client can't join a game, it should be a String prefixed with
SOCGames.MARKER_THIS_GAME_UNJOINABLE
.cliVers
- Client version; assumed >= SOCNewGameWithOptions.VERSION_FOR_NEWGAMEWITHOPTIONS
.
If any game's options need adjustment for an older client, cliVers triggers that.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |