|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.message.SOCMessage soc.message.SOCImARobot
public class SOCImARobot
This message tells the server that the client is a robot.
The server is distributed with the original robot AI, and this permits optimized communications and server simplifications. So, the server requires that robot clients are the same version as the server.
In 1.1.09 and later, 3rd-party robots can connect and be treated as robots. (For example, games where all humans leave, but robots remain, are stopped.) The 3rd-party robots can report any version, just like human player clients.
The IMAROBOT message includes a getRBClass()
parameter to indicate
whether the robot is 3rd-party or is the original built-in AI
.
In 1.1.19 and later, the IMAROBOT message includes a shared secret cookie to authenticate the bot to the server.
Field Summary | |
---|---|
private java.lang.String |
cookie
The security cookie value expected by the server. |
private java.lang.String |
nickname
Nickname of the robot |
private java.lang.String |
rbclass
The robot's brain class, to show 3rd-party robots. |
static java.lang.String |
RBCLASS_BUILTIN
Name of built-in robot brain class. |
private static long |
serialVersionUID
Version 1.1.09: add rbclass. |
Constructor Summary | |
---|---|
SOCImARobot(java.lang.String nn,
java.lang.String cookie,
java.lang.String rbclass)
Create a ImARobot message. |
Method Summary | |
---|---|
java.lang.String |
getCookie()
Get the security cookie to send to the server for this connection. |
java.lang.String |
getNickname()
|
java.lang.String |
getRBClass()
|
static SOCImARobot |
parseDataStr(java.lang.String s)
Parse the command String into a ImARobot message |
java.lang.String |
toCmd()
IMAROBOT sep nickname |
static java.lang.String |
toCmd(java.lang.String nn,
java.lang.String cookie,
java.lang.String rbclass)
IMAROBOT sep nickname sep2 cookie sep2 rbclass |
java.lang.String |
toString()
Simple human-readable representation, used for debug purposes. |
Methods inherited from class soc.message.SOCMessage |
---|
arrayIntoStringBuf, enumIntoStringBuf, getClassNameShort, getMaximumVersion, getMinimumVersion, 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
Version 1.1.19: add cookie.
public static final java.lang.String RBCLASS_BUILTIN
private java.lang.String nickname
private final java.lang.String cookie
private java.lang.String rbclass
RBCLASS_BUILTIN
.
If cookie
!= null, then rbclass
!= null.
Constructor Detail |
---|
public SOCImARobot(java.lang.String nn, java.lang.String cookie, java.lang.String rbclass) throws java.lang.IllegalArgumentException
nn
- nicknamecookie
- security cookie to send to the server for this connection;
required by server v1.1.19 and higher, or null
.
Must pass SOCMessage.isSingleLineAndSafe(String)
unless null
.rbclass
- robot brain class, such as RBCLASS_BUILTIN
.
Other (3rd-party) robots must use a different rbclass in their IMAROBOT messages.
Must not be null
if cookie
is null
.
java.lang.IllegalArgumentException
- if cookie
is non-null, and
cookie fails SOCMessage.isSingleLineAndSafe(String)
or
rbclass
is null.Method Detail |
---|
public java.lang.String getNickname()
public java.lang.String getCookie()
public java.lang.String getRBClass()
public java.lang.String toCmd()
toCmd
in class SOCMessage
public static java.lang.String toCmd(java.lang.String nn, java.lang.String cookie, java.lang.String rbclass)
nn
- the nicknamecookie
- the security cookierbclass
- the robot class
public static SOCImARobot 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 |