|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.message.SOCMessage soc.message.SOCSVPTextMessage
public class SOCSVPTextMessage
Message from server to game's clients, with the number of Special Victory
Points (SVP) and reason the player was awarded them.
The server will also send a SOCPlayerElement
with the SVP total.
So, robot players can ignore this textual message.
Also sent for each player's SVPs when client is joining a game in progress,
before client sits down at a seat.
SOCGameServerText
,
Serialized FormField Summary | |
---|---|
java.lang.String |
desc
Description of the player's action that led to the SVP. |
java.lang.String |
game
Name of the game. |
int |
pn
Player number. |
private static long |
serialVersionUID
|
int |
svp
Number of Special Victory Points (SVP) awarded. |
Constructor Summary | |
---|---|
SOCSVPTextMessage(java.lang.String ga,
int pn,
int svp,
java.lang.String desc)
Create a new SVPTEXTMSG message. |
Method Summary | |
---|---|
java.lang.String |
getGame()
Name of game this message is for. |
java.lang.String |
getKey()
Get the message localization key, from StringManager.get(String) ,
to look up and send the text of as part of this message. |
static SOCSVPTextMessage |
parseDataStr(java.lang.String s)
Parse the command string into a SOCSVPTextMessage message. |
java.lang.String |
toCmd()
SVPTEXTMSG sep game sep2 pn sep2 svp sep2 desc |
protected static java.lang.String |
toCmd(int messageType,
java.lang.String ga,
int pn,
int svp,
java.lang.String desc)
SVPTEXTMSG sep game sep2 pn sep2 svp sep2 desc |
java.lang.String |
toCmd(java.lang.String localizedText)
Construct a message ready to be sent, like SOCMessage.toCmd() , with text localized by the server. |
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 final java.lang.String game
public final int pn
public final int svp
public final java.lang.String desc
SOCMessage.isSingleLineAndSafe(String, boolean)
.
Constructor Detail |
---|
public SOCSVPTextMessage(java.lang.String ga, int pn, int svp, java.lang.String desc) throws java.lang.IllegalArgumentException
ga
- the game namepn
- Player numbersvp
- Number of Special Victory Points (SVP) awardeddesc
- Description of the player's action that led to the SVP.
At the server this is an I18N string key which the server must localize before sending,
at the client it's localized text sent from the server. This allows new SVP actions
and descriptions without client changes.
java.lang.IllegalArgumentException
- if desc is null or
fails SOCMessage.isSingleLineAndSafe(desc, true)
Method 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 toCmd()
toCmd
in class SOCMessage
protected static java.lang.String toCmd(int messageType, java.lang.String ga, int pn, int svp, java.lang.String desc)
ga
- the game namepn
- Player numbersvp
- Number of Special Victory Points (SVP) awardeddesc
- Description of the player's action that led to the SVP
public java.lang.String getKey()
StringManager.get(String)
,
to look up and send the text of as part of this message.
This message type's key field is desc
.
getKey
in interface SOCKeyedMessage
null
public java.lang.String toCmd(java.lang.String localizedText)
SOCKeyedMessage
SOCMessage.toCmd()
, with text localized by the server.
toCmd
in interface SOCKeyedMessage
localizedText
- Text field contents localized by the server, from SOCKeyedMessage.getKey()
and the
client's locale, or null
if getKey() == null
SOCMessage.toCmd()
public static SOCSVPTextMessage parseDataStr(java.lang.String s)
s
- the String to parse; format: game sep2 pn sep2 svp sep2 desc
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 |