|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.message.SOCMessage soc.message.SOCVersion
public class SOCVersion
This message sends the server's version and features, or client's version and locale,
to the other side of the connection. VERSION is the first message sent from client to server.
The server also sends its version to the client early, not in response to client's VERSION message.
Version numbers are read via Version
.
Before 2.0.00, the client did not send locale; new servers should probably assume en_US
since older versions had all messages in english. For robots the locale field is ignored at server,
because bots don't parse server text messages; sending a SOCImARobot
message will clear the
robot client's locale to null
at the server.
Before 1.1.19, the server did not send its active optional features; new clients of older servers
should use the SOCServerFeatures(true)
constructor
to set the default features active.
Before 1.1.06, in SOCPlayerClient, this was sent first from server to client, then client responded. Robot clients have always sent first since the introduction in 1.1.00 of client-server versioning (2008-08-07).
Field Summary | |
---|---|
java.lang.String |
localeOrFeats
Dual-purpose field: Client's JVM locale, or null, as in Locale.toString() ;
Or server's active optional features, or null, as in SOCServerFeatures.getEncodedList() . |
private static long |
serialVersionUID
|
private java.lang.String |
versBuild
Version build, or null, as in Version.buildnum() |
private int |
versNum
Version number, as in Version.versionNumber() |
private java.lang.String |
versStr
Version display string, as in Version.version() |
Constructor Summary | |
---|---|
SOCVersion(int verNum,
java.lang.String verStr,
java.lang.String verBuild,
java.lang.String verlocaleOrFeats)
Create a Version message. |
Method Summary | |
---|---|
java.lang.String |
getBuild()
|
int |
getMinimumVersion()
Minimum version where this message type is used. |
int |
getVersionNumber()
|
java.lang.String |
getVersionString()
|
static SOCVersion |
parseDataStr(java.lang.String s)
Parse the command String into a Version message |
java.lang.String |
toCmd()
VERSION SEP vernum SEP2 verstr SEP2 build SEP2 localeOrFeats; build,localeOrFeats may be blank |
static java.lang.String |
toCmd(int verNum,
java.lang.String verStr,
java.lang.String verBuild,
java.lang.String verlocaleOrFeats)
VERSION SEP vernum SEP2 verstr SEP2 build SEP2 localeOrFeats; build,localeOrFeats may be blank |
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
private java.lang.String versStr
Version.version()
private int versNum
Version.versionNumber()
private java.lang.String versBuild
Version.buildnum()
public final java.lang.String localeOrFeats
Locale.toString()
;
Or server's active optional features, or null, as in SOCServerFeatures.getEncodedList()
.
Locale not sent from server or from jsettlers clients older than 2.0.00.
Features not sent from servers older than 1.1.19. (In v1.1.19 this field is called feats
.)
See class javadoc for handling older clients or servers when this field is null.
Constructor Detail |
---|
public SOCVersion(int verNum, java.lang.String verStr, java.lang.String verBuild, java.lang.String verlocaleOrFeats) throws java.lang.IllegalArgumentException
verNum
- The version number, as in Version.versionNumber()
verStr
- The version display string, as in Version.version()
verBuild
- The version build, or null, as in Version.buildnum()
verlocaleOrFeats
- The client's JVM locale, or null, as in Locale.toString()
;
not sent by jsettlers clients older than 2.0.00.
Or the server's active optional features, or null, as in
SOCServerFeatures.getEncodedList()
; not sent by servers older than 1.1.19.
Server can send this to a client older than 1.1.19, it is safely ignored.
java.lang.IllegalArgumentException
- if verBuild
is null and verlocaleOrFeats
!= null;
not supported by message encoding.Method Detail |
---|
public int getVersionNumber()
Version.versionNumber()
public java.lang.String getVersionString()
Version.version()
public java.lang.String getBuild()
Version.buildnum()
, or nullpublic java.lang.String toCmd()
toCmd
in class SOCMessage
public static java.lang.String toCmd(int verNum, java.lang.String verStr, java.lang.String verBuild, java.lang.String verlocaleOrFeats) throws java.lang.IllegalArgumentException
verNum
- the version number, like 1100 for 1.1.00, as in Version.versionNumber()
verStr
- the version as string, like "1.1.00"verBuild
- the version build, or null, from Version.buildnum()
verlocaleOrFeats
- The client's JVM locale, or null, as in Locale.toString()
;
not sent by jsettlers clients older than 2.0.00.
Or the server's active optional features, or null, as in
SOCServerFeatures.getEncodedList()
; not sent by servers older than 1.1.19.
Server can send this to a client older than 1.1.19, it is safely ignored.
java.lang.IllegalArgumentException
- if verBuild
is null and verlocaleOrFeats
!= null;
not supported by message encoding.public static SOCVersion parseDataStr(java.lang.String s)
s
- the String to parse
public java.lang.String toString()
SOCMessage
toString
in class SOCMessage
public int getMinimumVersion()
getMinimumVersion
in class SOCMessage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |