|
||||||||||
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.SOCGameOptionInfo
public class SOCGameOptionInfo
Information on one available SOCGameOption
game option.
Reply from server to a client's GAMEOPTIONGETINFOS
message.
Provides the option's information, including default value and current value at the
server for new games. In v2.0.00+ the option description can be localized for the client.
If the server doesn't know this option, the returned option type is
SOCGameOption.OTYPE_UNKNOWN
.
If the client asks about an option too new for it to use,
by sending the option name or GAMEOPTIONGETINFOS("-"),
the server will respond with SOCGameOption.OTYPE_UNKNOWN
.
Special case: If the client is asking for any new options, by sending
GAMEOPTIONGETINFOS("-"), but there aren't any new options, server responds with
OPTINFO_NO_MORE_OPTS
, a GAMEOPTIONINFO named "-" with type OTYPE_UNKNOWN
.
This message is for clients to 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.
Introduced in 1.1.07; check client version against SOCNewGameWithOptions.VERSION_FOR_NEWGAMEWITHOPTIONS
before sending this message.
In v2.0.00 and newer, SOCScenario
info is also synchronized with similar logic;
see SOCScenarioInfo
.
Robot clients don't need to know about or handle this message type, because they don't create or browse games.
Field Summary | |
---|---|
protected static java.lang.String |
EMPTYSTR
symbol to represent a null or empty string value, because empty pa[] elements can't be parsed |
protected SOCGameOption |
opt
|
static SOCGameOptionInfo |
OPTINFO_NO_MORE_OPTS
If the client is asking for any new options, by sending GAMEOPTIONGETINFOS("-"), server responds with set of GAMEOPTIONINFOs. |
private static long |
serialVersionUID
|
Fields inherited from class soc.message.SOCMessageTemplateMs |
---|
game, pa |
Constructor Summary | |
---|---|
protected |
SOCGameOptionInfo(java.util.List<java.lang.String> pal)
Constructor for client to parse server's reply about a game option. |
|
SOCGameOptionInfo(SOCGameOption op,
int cliVers,
java.lang.String localDesc)
Constructor for server to tell client about a game option. |
Method Summary | |
---|---|
int |
getMinimumVersion()
Minimum version where this message type is used. |
SOCGameOption |
getOptionInfo()
|
java.lang.String |
getOptionNameKey()
|
static SOCGameOptionInfo |
parseDataStr(java.util.List<java.lang.String> pa)
Parse the command String array into a SOCGameOptionInfo message. |
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
public static final SOCGameOptionInfo OPTINFO_NO_MORE_OPTS
protected static final java.lang.String EMPTYSTR
protected SOCGameOption opt
Constructor Detail |
---|
public SOCGameOptionInfo(SOCGameOption op, int cliVers, java.lang.String localDesc)
op
- Option to sendcliVers
- Client's version number; 1107 is version 1.1.07localDesc
- i18n localized option description, or null
to use
SOCGameOption.getDesc()
protected SOCGameOptionInfo(java.util.List<java.lang.String> pal) throws java.lang.IllegalArgumentException, java.lang.NumberFormatException
SOCGameOption.OTYPE_UNKNOWN
.
pal
- The option's parameters:
SOCVersionedItem.key
)
OTYPE_UNKNOWN
java.lang.IllegalArgumentException
- if pal's length < 11, or type is not a valid SOCGameOption.optType
;
if type isn't OTYPE_ENUM
or ENUMBOOL,
pal's length must == 12 (or 11 for OTYPE_UNKNOWN).
java.lang.NumberFormatException
- if pal integer-field contents are incorrectly formatted.Method Detail |
---|
public int getMinimumVersion()
getMinimumVersion
in class SOCMessage
public java.lang.String getOptionNameKey()
public SOCGameOption getOptionInfo()
public static SOCGameOptionInfo parseDataStr(java.util.List<java.lang.String> pa)
SOCVersionedItem.key
)
OTYPE_UNKNOWN
pa
- the String parameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |