|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.message.SOCMessage soc.message.SOCMessageTemplateJoinGame soc.message.SOCNewGameWithOptionsRequest
public class SOCNewGameWithOptionsRequest
This message means that client wants to create a new game, with options;
needs same username/password options as JOINGAME
.
Server's reply, if it can create the game, is a broadcast SOCNewGameWithOptions
.
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.
Introduced in 1.1.07; check server version against SOCNewGameWithOptions.VERSION_FOR_NEWGAMEWITHOPTIONS
before sending this message. Older servers should be given JOINGAME
instead.
Some game options have the SOCGameOption.FLAG_INTERNAL_GAME_PROPERTY
flag.
The client should not send these as part of a new-game request message,
and the server should ignore them if it does. The server may send out
such options, as part of a game it has created, in a SOCNewGameWithOptions
message.
Robot clients don't need to know about or handle this message type, because they don't create games.
Field Summary | |
---|---|
private java.util.Map<java.lang.String,SOCGameOption> |
opts
may be null |
private java.lang.String |
optsStr
won't be null, even if opts is null, due to SOCGameOption.packOptionsToString(Map, boolean) format. |
private static long |
serialVersionUID
|
Fields inherited from class soc.message.SOCMessageTemplateJoinGame |
---|
game, host, nickname, NULLPASS, password |
Constructor Summary | |
---|---|
SOCNewGameWithOptionsRequest(java.lang.String nn,
java.lang.String pw,
java.lang.String hn,
java.lang.String ga,
java.util.Map<java.lang.String,SOCGameOption> opts)
Create a NewGameWithOptionsRequest message. |
|
SOCNewGameWithOptionsRequest(java.lang.String nn,
java.lang.String pw,
java.lang.String hn,
java.lang.String ga,
java.lang.String optstr)
Create a NewGameWithOptionsRequest message. |
Method Summary | |
---|---|
int |
getMinimumVersion()
Minimum version where this message type is used. |
java.util.Map<java.lang.String,SOCGameOption> |
getOptions()
|
static SOCNewGameWithOptionsRequest |
parseDataStr(java.lang.String s)
Parse the command String into a NewGameWithOptionsRequest message |
java.lang.String |
toCmd()
NEWGAMEWITHOPTIONSREQUEST sep nickname sep2 password sep2 host sep2 game |
static java.lang.String |
toCmd(java.lang.String nn,
java.lang.String pw,
java.lang.String hn,
java.lang.String ga,
java.util.Map<java.lang.String,SOCGameOption> opts)
NEWGAMEWITHOPTIONSREQUEST sep nickname sep2 password sep2 host sep2 game sep2 options |
static java.lang.String |
toCmd(java.lang.String nn,
java.lang.String pw,
java.lang.String hn,
java.lang.String ga,
java.lang.String optstr)
NEWGAMEWITHOPTIONSREQUEST sep nickname sep2 password sep2 host sep2 game sep2 options |
java.lang.String |
toString()
Simple human-readable representation, used for debug purposes. |
Methods inherited from class soc.message.SOCMessageTemplateJoinGame |
---|
getGame, getHost, getNickname, getPassword, 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 |
Field Detail |
---|
private static final long serialVersionUID
private java.lang.String optsStr
SOCGameOption.packOptionsToString(Map, boolean)
format.
private java.util.Map<java.lang.String,SOCGameOption> opts
Constructor Detail |
---|
public SOCNewGameWithOptionsRequest(java.lang.String nn, java.lang.String pw, java.lang.String hn, java.lang.String ga, java.util.Map<java.lang.String,SOCGameOption> opts)
nn
- nicknamepw
- optional password, or "" if nonehn
- server host namega
- name of the gameopts
- the game options, or null;
if null, it probably makes sense to create
a SOCJoinGame
message instead.public SOCNewGameWithOptionsRequest(java.lang.String nn, java.lang.String pw, java.lang.String hn, java.lang.String ga, java.lang.String optstr)
nn
- nicknamepw
- optional password, or "" if nonehn
- server host namega
- name of the gameoptstr
- the game options as a string name-value pairs, as created by
SOCGameOption.packOptionsToString(Map, boolean)
.Method Detail |
---|
public java.util.Map<java.lang.String,SOCGameOption> getOptions()
SOCGameOption
), or null;
does not parse optsStr.public java.lang.String toCmd()
toCmd
in class SOCMessage
public static java.lang.String toCmd(java.lang.String nn, java.lang.String pw, java.lang.String hn, java.lang.String ga, java.lang.String optstr)
nn
- the nicknamepw
- the optional password, or "" if nonehn
- the server host namega
- the game nameoptstr
- the game options as a string name-value pairs, as created by
SOCGameOption.packOptionsToString(Map, boolean)
.
public static java.lang.String toCmd(java.lang.String nn, java.lang.String pw, java.lang.String hn, java.lang.String ga, java.util.Map<java.lang.String,SOCGameOption> opts)
nn
- the nicknamepw
- the optional password, or "" if nonehn
- the server host namega
- the game nameopts
- the game options (SOCGameOption
)
public static SOCNewGameWithOptionsRequest parseDataStr(java.lang.String s)
s
- the String to parse
SOCMessage.isSingleLineAndSafe(String)
.public int getMinimumVersion()
getMinimumVersion
in class SOCMessage
public java.lang.String toString()
SOCMessage
toString
in class SOCMessage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |