|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.message.SOCMessage soc.message.SOCGameTextMsg
public class SOCGameTextMsg
This message contains a text message for a SoC game.
Seen by server
or by
human players on-screen, occasionally parsed by robots
if they're expecting a debug message.
Text announcements from the server are instead sent as
SOCGameServerText
to client versions 2.0.00 and newer.
See that class javadoc for what game information is sent as text
and what's sent as other message types.
Field Summary | |
---|---|
private java.lang.String |
game
Name of game |
private java.lang.String |
nickname
Nickname of sender, or SERVERNAME |
private static java.lang.String |
sep2
our token separator; not the normal SOCMessage.sep2 |
private static long |
serialVersionUID
|
static java.lang.String |
SERVERNAME
"Server" , the reserved nickname used when sending game text messages
from the server itself, not chat messages from players. |
private java.lang.String |
text
Text message |
static int |
VERSION_FOR_DICE_RESULT_INSTEAD
Version number (2000) where the server no longer sends dice roll results as a game text message. |
Constructor Summary | |
---|---|
SOCGameTextMsg(java.lang.String ga,
java.lang.String nn,
java.lang.String tm)
Create a GameTextMsg message. |
Method Summary | |
---|---|
java.lang.String |
getGame()
Name of game this message is for. |
java.lang.String |
getNickname()
Get the player's nickname for a chat message, or the server for game announcement text |
java.lang.String |
getText()
|
static SOCGameTextMsg |
parseDataStr(java.lang.String s)
Parse the command String into a GameTextMsg message |
java.lang.String |
toCmd()
GAMETEXTMSG sep game sep2 nickname sep2 text |
static java.lang.String |
toCmd(java.lang.String ga,
java.lang.String nn,
java.lang.String tm)
GAMETEXTMSG sep game sep2 nickname sep2 text |
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 |
Methods inherited from interface soc.message.SOCMessageForGame |
---|
getType |
Field Detail |
---|
private static final long serialVersionUID
public static final java.lang.String SERVERNAME
"Server"
, the reserved nickname used when sending game text messages
from the server itself, not chat messages from players.
This is used only for pre-2.0.00 clients, because starting with that version,
the server's announcement texts are sent as SOCGameServerText
instead.
Moved here in v2.0.00; previously declared in SOCServer and a string literal at clients.
public static final int VERSION_FOR_DICE_RESULT_INSTEAD
Clients older than v2.0.00 expect the server to announce dice roll results via text messages such as "j rolled a 2 and a 2." The client would then replace that on-screen with "Rolled a 4." to reduce visual clutter.
Starting with v2.0.00, the client prints roll results from
the SOCDiceResult
message instead. So, the server doesn't send
the roll result game text message to v2.0.00 or newer clients.
private static java.lang.String sep2
SOCMessage.sep2
private java.lang.String game
private java.lang.String nickname
SERVERNAME
private java.lang.String text
Constructor Detail |
---|
public SOCGameTextMsg(java.lang.String ga, java.lang.String nn, java.lang.String tm)
ga
- name of gamenn
- nickname of sender; announcements from the server (not from a player) use SERVERNAME
tm
- text messageMethod Detail |
---|
public java.lang.String getGame()
SOCMessageForGame
null
if message is in per-game structures or code.
At the server, the message treater dispatches incoming SOCMessageForGame
s
based on their getGame()
:
null
: Message is ignored
SOCMessage.GAME_NONE
: Message is handled by SOCServer
itself
GameHandler
for that game's type. If no game with that name is found,
the message is ignored.
getGame
in interface SOCMessageForGame
SOCMessage.GAME_NONE
public java.lang.String getNickname()
SERVERNAME
public java.lang.String getText()
public java.lang.String toCmd()
toCmd
in class SOCMessage
public static java.lang.String toCmd(java.lang.String ga, java.lang.String nn, java.lang.String tm)
ga
- the game namenn
- the nicknametm
- the text message
public static SOCGameTextMsg 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 |