|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.message.SOCMessage soc.message.SOCGameOptionGetInfos
public class SOCGameOptionGetInfos
This message from client sends a list of game options to the server.
The server will respond with GAMEOPTIONINFO
message(s),
one per option keyname listed in this message.
If the only 'option' keyname sent is '-', server will send info on all options which are new or changed since the client's version. (this usage assumes client is older than server).
This is so clients can find out about options which were introduced in versions newer than the client's version, but which may be applicable to their version or all versions.
In v2.0.00 and newer, clients can also request localized descriptions of all options
if available, by including OPTKEY_GET_I18N_DESCS
as the last option keyname
in their list sent to the server. Check server version against
SOCStringManager.VERSION_FOR_I18N
.
The keyname list sent by the client would be:
OPTKEY_GET_I18N_DESCS
OPTKEY_GET_I18N_DESCS
SOCNewGameWithOptions.VERSION_FOR_NEWGAMEWITHOPTIONS
before sending this message.
Robot clients don't need to know about or handle this message type, because they don't create games.
Field Summary | |
---|---|
private boolean |
hasTokenGetI18nDescs
True if client is also asking server for localized game option descriptions (v2.0.00 and newer); will send OPTKEY_GET_I18N_DESCS along with optkeys . |
static java.lang.String |
OPTKEY_GET_I18N_DESCS
I18N option-description request token "?I18N" sent from client when its locale isn't en_US . |
private java.util.Vector<java.lang.String> |
optkeys
List of game option keynames (Strings), or null . |
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
SOCGameOptionGetInfos(java.util.Vector<java.lang.String> okeys,
boolean withTokenI18nDescs)
Create a GameOptionGetInfos Message. |
Method Summary | |
---|---|
int |
getMinimumVersion()
Minimum version where this message type is used. |
java.util.Vector<java.lang.String> |
getOptionKeys()
|
boolean |
hasTokenGetI18nDescs()
|
static SOCGameOptionGetInfos |
parseDataStr(java.lang.String s)
Parse the command String into a GameOptionGetInfos message |
java.lang.String |
toCmd()
GAMEOPTIONGETINFOS sep optkeys |
static java.lang.String |
toCmd(java.util.List<?> opts,
boolean withTokenI18nDescs)
GAMEOPTIONGETINFOS sep optkeys |
java.lang.String |
toString()
Simple human-readable representation, used for debug purposes. |
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
public static final java.lang.String OPTKEY_GET_I18N_DESCS
"?I18N"
sent from client when its locale isn't en_US
.
If the list of game option keys from the client includes this item, the server should check the client's locale and send localized descriptions for all game options available at this client's version.
When present, this will be at the end of the list of option keys sent over the network,
but isn't part of the list returned by getOptionKeys()
. The receiving parser
will remove it from the list and set hasTokenGetI18nDescs()
.
If the server does not have game option names in the client's locale, this token is ignored and only the changed options will be sent by version as described above.
Introduced in v2.0.00: Before sending, check the server's version against
SOCStringManager.VERSION_FOR_I18N
.
hasTokenGetI18nDescs()
,
Constant Field Valuesprivate java.util.Vector<java.lang.String> optkeys
null
. Will not include
OPTKEY_GET_I18N_DESCS
, use hasTokenGetI18nDescs()
instead.
private boolean hasTokenGetI18nDescs
OPTKEY_GET_I18N_DESCS
along with optkeys
.
Constructor Detail |
---|
public SOCGameOptionGetInfos(java.util.Vector<java.lang.String> okeys, boolean withTokenI18nDescs)
okeys
- list of game option keynames (Strings), or null
for "-".
Do not include OPTKEY_GET_I18N_DESCS
in this list; set withTokenI18nDescs
true instead.withTokenI18nDescs
- true if client is also asking server for localized game option
descriptions (v2.0.00 and newer); will send OPTKEY_GET_I18N_DESCS
along with
okeys
. Before sending this token, check the server's version against
SOCStringManager.VERSION_FOR_I18N
.Method Detail |
---|
public int getMinimumVersion()
getMinimumVersion
in class SOCMessage
public java.util.Vector<java.lang.String> getOptionKeys()
null
if "-" was sent.
Will not include OPTKEY_GET_I18N_DESCS
; see hasTokenGetI18nDescs()
instead.public boolean hasTokenGetI18nDescs()
OPTKEY_GET_I18N_DESCS
along with getOptionKeys()
.public java.lang.String toCmd()
toCmd
in class SOCMessage
public static java.lang.String toCmd(java.util.List<?> opts, boolean withTokenI18nDescs)
opts
- the list of option keynames, as a list of Strings or SOCGameOptions,
or null to use "-" as 'optkeys'withTokenI18nDescs
- true if client is also asking server for localized game option descriptions
(v2.0.00 and newer); will send OPTKEY_GET_I18N_DESCS
along with opts
.
Before sending this token, check the server's version against
SOCStringManager.VERSION_FOR_I18N
.
public static SOCGameOptionGetInfos parseDataStr(java.lang.String s)
s
- the String to parse
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 |