|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsoc.message.SOCMessage
soc.message.SOCGameServerText
public class SOCGameServerText
This message contains a text message or announcement from the server
for a SoC game. Sent by server.
Player chat text is sent as SOCGameTextMsg instead.
Occasionally, game text is sent with additional information
via SOCSVPTextMessage, instead of using this message type.
Some simple actions are sent by the server with SOCSimpleAction
or SOCSimpleRequest instead of text.
This class was introduced in version 2.0.00; earlier versions of the server
and client use SOCGameTextMsg for server announcements and messages.
| Field Summary | |
|---|---|
private java.lang.String |
game
Name of game |
private static long |
serialVersionUID
|
private java.lang.String |
text
Text message |
private static java.lang.String |
unlikely_char1
Our token separator; not the normal SOCMessage.sep2. |
static int |
VERSION_FOR_GAMESERVERTEXT
First version number (2.0.00) that has this message type. |
| Constructor Summary | |
|---|---|
SOCGameServerText(java.lang.String ga,
java.lang.String tm)
Create a GameServerText message. |
|
| Method Summary | |
|---|---|
java.lang.String |
getGame()
Name of game this message is for. |
int |
getMinimumVersion()
Minimum version where this message type is used. |
java.lang.String |
getText()
|
static SOCGameServerText |
parseDataStr(java.lang.String s)
Parse the command String into a GameServerText message |
java.lang.String |
toCmd()
GAMESERVERTEXT sep game char1 text |
static java.lang.String |
toCmd(java.lang.String ga,
java.lang.String tm)
GAMESERVERTEXT sep game char1 text |
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 |
| Methods inherited from interface soc.message.SOCMessageForGame |
|---|
getType |
| Field Detail |
|---|
private static final long serialVersionUID
public static final int VERSION_FOR_GAMESERVERTEXT
SOCGameTextMsg or other appropriate messages instead.
private static final java.lang.String unlikely_char1
SOCMessage.sep2.
Used in parseDataStr(String) to get all of the text,
by choosing an unlikely separator character.
SOCGameTextMsg overrides sep2 instead.
private final java.lang.String game
private final java.lang.String text
| Constructor Detail |
|---|
public SOCGameServerText(java.lang.String ga,
java.lang.String tm)
ga - name of gametm - text message| Method Detail |
|---|
public java.lang.String getGame()
SOCMessageForGamenull if message is in per-game structures or code.
At the server, the message treater dispatches incoming SOCMessageForGames
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 SOCMessageForGameSOCMessage.GAME_NONEpublic 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 tm)
ga - the game nametm - the text message
public static SOCGameServerText parseDataStr(java.lang.String s)
s - the String to parse
public java.lang.String toString()
SOCMessage
toString in class SOCMessagepublic final int getMinimumVersion()
getMinimumVersion in class SOCMessage
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||