|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.message.SOCMessage soc.message.SOCMessageTemplate2s soc.message.SOCNewGameWithOptions
public class SOCNewGameWithOptions
This broadcast message from server announces a new game, with a certain
version and possibly game options
, to all clients.
JOINGAMEAUTH
to the requesting client, so they will join the game they just created.
VERSION_FOR_NEWGAMEWITHOPTIONS
before sending this message.
Game name may include a prefix marker if the client can't join;
see SOCGames.MARKER_THIS_GAME_UNJOINABLE
.
This marker will be retained within the game name returned by
SOCMessageTemplate2s.getGame()
.
Just like NEWGAME
, robot clients don't need to
know about or handle this message type.
Field Summary | |
---|---|
private int |
gameMinVers
|
private static long |
serialVersionUID
|
static int |
VERSION_FOR_NEWGAMEWITHOPTIONS
Minimum version (1.1.07) of client/server which recognize and send NEWGAMEWITHOPTIONS and other messages related to SOCGameOption . |
Fields inherited from class soc.message.SOCMessageTemplate2s |
---|
game, p1, p2 |
Constructor Summary | |
---|---|
SOCNewGameWithOptions(java.lang.String ga,
java.util.Map<java.lang.String,SOCGameOption> opts,
int minVers)
Create a SOCNewGameWithOptions message. |
|
SOCNewGameWithOptions(java.lang.String ga,
java.lang.String optstr,
int minVers)
Create a SOCNewGameWithOptions message. |
Method Summary | |
---|---|
int |
getMinimumVersion()
Minimum version where this message type is used. |
int |
getMinVersion()
|
java.lang.String |
getOptionsString()
|
static SOCNewGameWithOptions |
parseDataStr(java.lang.String s)
Parse the command String into a SOCNewGameWithOptions message. |
static java.lang.String |
toCmd(SOCGame ga,
int cliVers)
NEWGAMEWITHOPTIONS sep game sep2 minVers sep2 optionstring |
static java.lang.String |
toCmd(java.lang.String ga,
java.util.Map<java.lang.String,SOCGameOption> opts,
int gameMinVers,
int cliVers)
NEWGAMEWITHOPTIONS sep game sep2 minVers sep2 optionstring |
static java.lang.String |
toCmd(java.lang.String ga,
java.lang.String optstr,
int minVers)
NEWGAMEWITHOPTIONS sep game sep2 minVers sep2 optionstring |
Methods inherited from class soc.message.SOCMessageTemplate2s |
---|
getGame, getParam1, getParam2, 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
public static final int VERSION_FOR_NEWGAMEWITHOPTIONS
SOCGameOption
.
private int gameMinVers
Constructor Detail |
---|
public SOCNewGameWithOptions(java.lang.String ga, java.lang.String optstr, int minVers)
ga
- the name of the game; may have the
SOCGames.MARKER_THIS_GAME_UNJOINABLE
prefix.
minVers also designates if the game is joinable.optstr
- Requested game options, in the format returned by
SOCGameOption.packOptionsToString(opts, false)
,
or nullminVers
- Minimum client version required for this game, or -1.public SOCNewGameWithOptions(java.lang.String ga, java.util.Map<java.lang.String,SOCGameOption> opts, int minVers)
ga
- the name of the game; may have the
SOCGames.MARKER_THIS_GAME_UNJOINABLE
prefix.
minVers also designates if the game is joinable.opts
- The game's SOCGameOption
s, or nullminVers
- Minimum client version for this game, or -1.
Ignored if sent from client to server. Calculated at
server and sent out to all clients.Method Detail |
---|
public java.lang.String getOptionsString()
SOCGameOption.packOptionsToString(opts, false)
,
or null if no optionspublic int getMinVersion()
public static java.lang.String toCmd(java.lang.String ga, java.lang.String optstr, int minVers)
ga
- the name of the game; the game name may have
the SOCGames.MARKER_THIS_GAME_UNJOINABLE
prefix.optstr
- Requested game options, in the format returned by
SOCGameOption.packOptionsToString(Map, boolean)
,
or nullminVers
- Minimum client version required, or -1
public static java.lang.String toCmd(java.lang.String ga, java.util.Map<java.lang.String,SOCGameOption> opts, int gameMinVers, int cliVers)
ga
- the name of the game; the game name may have
the SOCGames.MARKER_THIS_GAME_UNJOINABLE
prefix.opts
- Requested game options, as a map of SOCGameOption
gameMinVers
- Minimum client version required, or -1cliVers
- Client version, if any game's options need adjustment for an older client.
Use -2 if the client version doesn't matter, or if adjustment should not be done.
public static java.lang.String toCmd(SOCGame ga, int cliVers)
Game's options and minimum required version will be extracted from game.
ga
- the gamecliVers
- Client version; assumed >= VERSION_FOR_NEWGAMEWITHOPTIONS
.
If any game's options need adjustment for an older client, cliVers triggers that.
Use -2 if the client version doesn't matter.
public static SOCNewGameWithOptions parseDataStr(java.lang.String s)
s
- the String to parse: NEWGAMEWITHOPTIONS sep game sep2 opts
public int getMinimumVersion()
getMinimumVersion
in class SOCMessage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |