|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.client.SOCPlayerClient.MessageTreater
private class SOCPlayerClient.MessageTreater
Nested class for processing incoming messages (treating).
Before v2.0.00, most of these fields and methods were part of the main SOCPlayerClient
class.
Field Summary | |
---|---|
private SOCPlayerClient |
client
|
private SOCPlayerClient.GameManager |
gmgr
|
Constructor Summary | |
---|---|
SOCPlayerClient.MessageTreater(SOCPlayerClient client)
|
Method Summary | |
---|---|
protected void |
handleBCASTTEXTMSG(SOCBCastTextMsg mes)
handle a broadcast text message |
protected void |
handleBOARDLAYOUT(SOCBoardLayout mes)
Handle the old "board layout" message (original 4-player board, no options). |
protected void |
handleBOARDLAYOUT2(SOCBoardLayout2 mes)
Handle the "board layout" message, in its usual format. |
private void |
handleBOARDSPECIALEDGE(SOCBoardSpecialEdge mes)
Set or clear a special edge on the board. |
protected void |
handleCANCELBUILDREQUEST(SOCCancelBuildRequest mes)
handle the rare "cancel build request" message; usually not sent from server to client. |
protected void |
handleCHANGEFACE(SOCChangeFace mes)
handle the "change face" message |
protected void |
handleCHANNELS(SOCChannels mes,
boolean isPractice)
handle the "list of channels" message; this message indicates that we're newly connected to the server, and is sent even if the server isn't using SOCServerFeatures.FEAT_CHANNELS : Server connection is complete. |
protected void |
handleCHOOSEPLAYER(SOCChoosePlayer mes)
The server wants this player to choose to rob cloth or rob resources, after moving the pirate ship. |
protected void |
handleCHOOSEPLAYERREQUEST(SOCChoosePlayerRequest mes)
handle the "choose player request" message |
protected void |
handleCLEAROFFER(SOCClearOffer mes)
handle the "clear offer" message |
protected void |
handleCLEARTRADEMSG(SOCClearTradeMsg mes)
handle the "clear trade message" message |
private void |
handleDEBUGFREEPLACE(SOCDebugFreePlace mes)
Handle the server's debug piece placement on/off message. |
protected void |
handleDELETECHANNEL(SOCDeleteChannel mes)
handle the "delete channel" message |
protected void |
handleDELETEGAME(SOCDeleteGame mes,
boolean isPractice)
handle the "delete game" message |
protected void |
handleDEVCARDACTION(boolean isPractice,
SOCDevCardAction mes)
handle the "development card action" message |
protected void |
handleDEVCARDCOUNT(SOCDevCardCount mes)
handle the "number of development cards" message |
protected void |
handleDICERESULT(SOCDiceResult mes)
handle the "dice result" message |
protected void |
handleDICERESULTRESOURCES(SOCDiceResultResources mes)
Handle all players' dice roll result resources. |
protected void |
handleDISCARDREQUEST(SOCDiscardRequest mes)
handle the "discard request" message |
protected void |
handleFIRSTPLAYER(SOCFirstPlayer mes)
handle the "first player" message |
protected void |
handleGAMEMEMBERS(SOCGameMembers mes)
handle the "game members" message, the server's hint that it's almost done sending us the complete game state in response to JOINGAME. |
private void |
handleGAMEOPTIONGETDEFAULTS(SOCGameOptionGetDefaults mes,
boolean isPractice)
process the "game option get defaults" message. |
private void |
handleGAMEOPTIONINFO(SOCGameOptionInfo mes,
boolean isPractice)
process the "game option info" message by calling ServerGametypeInfo.receiveInfo(SOCGameOptionInfo) . |
protected void |
handleGAMES(SOCGames mes,
boolean isPractice)
handle the "list of games" message |
protected void |
handleGAMESERVERTEXT(SOCGameServerText mes)
Handle game server text and announcements. |
protected void |
handleGAMESTATE(SOCGameState mes)
handle the "game state" message |
protected void |
handleGAMESTATS(SOCGameStats mes)
handle the "game stats" message |
private void |
handleGAMESWITHOPTIONS(SOCGamesWithOptions mes,
boolean isPractice)
handle the "list of games with options" message |
protected void |
handleGAMETEXTMSG(SOCGameTextMsg mes)
handle the "game text message" message. |
private void |
handleINVENTORYITEMACTION(SOCInventoryItemAction mes)
Update player inventory. |
protected void |
handleJOIN(SOCJoin mes)
handle the "join channel" message |
protected void |
handleJOINAUTH(SOCJoinAuth mes)
handle the "join channel authorization" message |
protected void |
handleJOINGAME(SOCJoinGame mes)
handle the "join game" message |
protected void |
handleJOINGAMEAUTH(SOCJoinGameAuth mes,
boolean isPractice)
handle the "join game authorization" message: create new SOCGame and
SOCPlayerInterface so user can join the game |
protected void |
handleLARGESTARMY(SOCLargestArmy mes)
handle the "largest army" message |
protected void |
handleLEAVE(SOCLeave mes)
handle the "leave channel" message |
protected void |
handleLEAVEGAME(SOCLeaveGame mes)
handle the "leave game" message |
private void |
handleLOCALIZEDSTRINGS(SOCLocalizedStrings mes,
boolean isPractice)
Localized i18n strings for game items. |
protected void |
handleLONGESTROAD(SOCLongestRoad mes)
handle the "longest road" message |
protected void |
handleMAKEOFFER(SOCMakeOffer mes)
handle the "make offer" message |
protected void |
handleMEMBERS(SOCMembers mes)
handle the "channel members" message |
private void |
handleMOVEPIECE(SOCMovePiece mes)
Handle moving a piece (a ship) around on the board. |
protected void |
handleMOVEROBBER(SOCMoveRobber mes)
handle the "robber moved" or "pirate moved" message. |
protected void |
handleNEWCHANNEL(SOCNewChannel mes)
handle the "new channel" message |
protected void |
handleNEWGAME(SOCNewGame mes,
boolean isPractice)
handle the "new game" message |
private void |
handleNEWGAMEWITHOPTIONS(SOCNewGameWithOptions mes,
boolean isPractice)
process the "new game with options" message |
protected void |
handlePICKRESOURCESREQUEST(SOCPickResourcesRequest mes)
handle the "pick resources request" message |
protected void |
handlePIECEVALUE(SOCPieceValue mes)
Update a village piece's value on the board (cloth remaining) in _SC_CLVI, or a pirate fortress's strength in _SC_PIRI. |
protected void |
handlePLAYERELEMENT(SOCPlayerElement mes)
handle the "player information" message |
private void |
handlePLAYERSTATS(SOCPlayerStats mes)
handle the "player stats" message |
protected void |
handlePOTENTIALSETTLEMENTS(SOCPotentialSettlements mes)
handle the "list of potential settlements" message |
protected void |
handlePUTPIECE(SOCPutPiece mes)
handle the "put piece" message |
protected void |
handleREJECTCONNECTION(SOCRejectConnection mes)
handle the "reject connection" message |
protected void |
handleREJECTOFFER(SOCRejectOffer mes)
handle the "reject offer" message |
private void |
handleREMOVEPIECE(SOCRemovePiece mes)
Handle removing a piece (a ship) from the board in certain scenarios. |
protected void |
handleRESETBOARDAUTH(SOCResetBoardAuth mes)
handle board reset (new game with same players, same game name, new layout). |
protected void |
handleRESETBOARDREJECT(SOCResetBoardReject mes)
voting complete, board reset request rejected |
protected void |
handleRESETBOARDVOTE(SOCResetBoardVote mes)
another player has voted on a board reset request: display the vote. |
protected void |
handleRESETBOARDVOTEREQUEST(SOCResetBoardVoteRequest mes)
a player is requesting a board reset: we must update local game state, and vote unless we are the requester. |
protected void |
handleRESOURCECOUNT(SOCResourceCount mes)
handle "resource count" message |
protected void |
handleREVEALFOGHEX(SOCRevealFogHex mes)
Reveal a hidden hex on the board. |
protected void |
handleROLLDICEPROMPT(SOCRollDicePrompt mes)
handle the "roll dice prompt" message; if we're in a game and we're the dice roller, either set the auto-roll timer, or prompt to roll or choose card. |
private void |
handleSCENARIOINFO(SOCScenarioInfo mes,
boolean isPractice)
Updated scenario info. |
private void |
handleSERVERPING(SOCServerPing mes,
boolean isPractice)
echo the server ping, to ensure we're still connected. |
protected void |
handleSETPLAYEDDEVCARD(SOCSetPlayedDevCard mes)
handle the "set played dev card flag" message |
protected void |
handleSETSEATLOCK(SOCSetSeatLock mes)
handle the "set seat lock" message |
private void |
handleSETSPECIALITEM(java.util.Map<java.lang.String,SOCGame> games,
SOCSetSpecialItem mes)
Handle the "set special item" message. |
protected void |
handleSETTURN(SOCSetTurn mes)
handle the "set turn" message |
private void |
handleSIMPLEACTION(SOCSimpleAction mes)
Handle "simple action" announcements from the server. |
private void |
handleSIMPLEREQUEST(SOCSimpleRequest mes)
Handle server responses from the "simple request" handler. |
protected void |
handleSITDOWN(SOCSitDown mes)
handle the "player sitting down" message |
protected void |
handleSTARTGAME(SOCStartGame mes)
handle the "start game" message |
protected void |
handleSTATUSMESSAGE(SOCStatusMessage mes,
boolean isPractice)
handle the "status" message. |
protected void |
handleSVPTEXTMSG(SOCSVPTextMessage mes)
Text that a player has been awarded Special Victory Point(s). |
protected void |
handleTEXTMSG(SOCTextMsg mes)
handle a text message |
protected void |
handleTURN(SOCTurn mes)
handle the "turn" message |
private void |
handleVERSION(boolean isPractice,
SOCVersion mes)
Handle the "version" message, server's version report. |
void |
treat(SOCMessage mes,
boolean isPractice)
Treat the incoming messages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final SOCPlayerClient client
private final SOCPlayerClient.GameManager gmgr
Constructor Detail |
---|
public SOCPlayerClient.MessageTreater(SOCPlayerClient client)
Method Detail |
---|
public void treat(SOCMessage mes, boolean isPractice)
SOCMessage.toMsg(String)
).
mes
- the messageisPractice
- Server is SOCPlayerClient.ClientNetwork.practiceServer
, not tcp networkprivate void handleVERSION(boolean isPractice, SOCVersion mes)
SOCPlayerClient.getServerVersion(SOCGame)
and display the version on the main panel.
(Local server's version is always Version.versionNumber()
.)
isPractice
- Is the server SOCPlayerClient.ClientNetwork.practiceServer
, not remote? Client can be connected
only to one at a time.mes
- the messageprotected void handleSTATUSMESSAGE(SOCStatusMessage mes, boolean isPractice)
"status"
message.
Used for server events, also used if player tries to join a game
but their nickname is not OK.
Also used (v1.1.19 and newer) as a reply to SOCAuthRequest
sent
before showing NewGameOptionsFrame
, so check whether the
isNGOFWaitingForAuthStatus client.isNGOFWaitingForAuthStatus
flag is set.
mes
- the messageisPractice
- from practice server, not remote server?protected void handleJOINAUTH(SOCJoinAuth mes)
mes
- the messageprotected void handleJOIN(SOCJoin mes)
mes
- the messageprotected void handleMEMBERS(SOCMembers mes)
mes
- the messageprotected void handleNEWCHANNEL(SOCNewChannel mes)
mes
- the messageprotected void handleCHANNELS(SOCChannels mes, boolean isPractice)
SOCServerFeatures.FEAT_CHANNELS
: Server connection is complete.
Unless isPractice
, show #MAIN_PANEL
.
mes
- the messageisPractice
- is the server actually SOCPlayerClient.ClientNetwork.practiceServer
(practice game)?protected void handleBCASTTEXTMSG(SOCBCastTextMsg mes)
mes
- the messageprotected void handleTEXTMSG(SOCTextMsg mes)
mes
- the messageprotected void handleLEAVE(SOCLeave mes)
mes
- the messageprotected void handleDELETECHANNEL(SOCDeleteChannel mes)
mes
- the messageprotected void handleGAMES(SOCGames mes, boolean isPractice)
mes
- the messageprotected void handleJOINGAMEAUTH(SOCJoinGameAuth mes, boolean isPractice)
SOCGame
and
SOCPlayerInterface
so user can join the game
mes
- the messageisPractice
- server is practiceServer (not normal tcp network)protected void handleJOINGAME(SOCJoinGame mes)
mes
- the messageprotected void handleLEAVEGAME(SOCLeaveGame mes)
mes
- the messageprotected void handleNEWGAME(SOCNewGame mes, boolean isPractice)
mes
- the messageprotected void handleDELETEGAME(SOCDeleteGame mes, boolean isPractice)
mes
- the messageprotected void handleGAMEMEMBERS(SOCGameMembers mes)
mes
- the messageprotected void handleGAMESTATS(SOCGameStats mes)
protected void handleGAMETEXTMSG(SOCGameTextMsg mes)
mes
- the messageprotected void handleSITDOWN(SOCSitDown mes)
mes
- the messageprotected void handleBOARDLAYOUT(SOCBoardLayout mes)
handleBOARDLAYOUT2(SOCBoardLayout2)
instead.
mes
- the messageprivate void handleSERVERPING(SOCServerPing mes, boolean isPractice)
protected void handleBOARDLAYOUT2(SOCBoardLayout2 mes)
handleBOARDLAYOUT(SOCBoardLayout)
instead.)
mes
- the messageprotected void handleSTARTGAME(SOCStartGame mes)
mes
- the messageprotected void handleGAMESTATE(SOCGameState mes)
mes
- the messageprotected void handleSETTURN(SOCSetTurn mes)
mes
- the messageprotected void handleFIRSTPLAYER(SOCFirstPlayer mes)
mes
- the messageprotected void handleTURN(SOCTurn mes)
mes
- the messageprotected void handlePLAYERELEMENT(SOCPlayerElement mes)
mes
- the messageprotected void handleRESOURCECOUNT(SOCResourceCount mes)
mes
- the messageprotected void handleDICERESULT(SOCDiceResult mes)
mes
- the messageprotected void handlePUTPIECE(SOCPutPiece mes)
mes
- the messageprotected void handleCANCELBUILDREQUEST(SOCCancelBuildRequest mes)
- When sent from client to server, CANCELBUILDREQUEST means the player has changed their mind about spending resources to build a piece. Only allowed during normal game play (PLACING_ROAD, PLACING_SETTLEMENT, or PLACING_CITY).
When sent from server to client:
- During game startup (START1B or START2B):
Sent from server, CANCELBUILDREQUEST means the current player
wants to undo the placement of their initial settlement.
- During piece placement (PLACING_ROAD, PLACING_CITY, PLACING_SETTLEMENT, PLACING_FREE_ROAD1 or PLACING_FREE_ROAD2):
Sent from server, CANCELBUILDREQUEST means the player has sent an illegal PUTPIECE (bad building location). Humans can probably decide a better place to put their road, but robots must cancel the build request and decide on a new plan.
Our client can ignore this case, because the server also sends a text message that the human player is capable of reading and acting on.
mes
- the messageprotected void handleMOVEROBBER(SOCMoveRobber mes)
mes
- the messageprotected void handleDISCARDREQUEST(SOCDiscardRequest mes)
mes
- the messageprotected void handlePICKRESOURCESREQUEST(SOCPickResourcesRequest mes)
mes
- the messageprotected void handleCHOOSEPLAYERREQUEST(SOCChoosePlayerRequest mes)
mes
- the messageprotected void handleCHOOSEPLAYER(SOCChoosePlayer mes)
protected void handleMAKEOFFER(SOCMakeOffer mes)
mes
- the messageprotected void handleCLEAROFFER(SOCClearOffer mes)
mes
- the messageprotected void handleREJECTOFFER(SOCRejectOffer mes)
mes
- the messageprotected void handleCLEARTRADEMSG(SOCClearTradeMsg mes)
mes
- the messageprotected void handleDEVCARDCOUNT(SOCDevCardCount mes)
mes
- the messageprotected void handleDEVCARDACTION(boolean isPractice, SOCDevCardAction mes)
mes
- the messageprotected void handleSETPLAYEDDEVCARD(SOCSetPlayedDevCard mes)
mes
- the messageprotected void handlePOTENTIALSETTLEMENTS(SOCPotentialSettlements mes) throws java.lang.IllegalStateException
mes
- the message
java.lang.IllegalStateException
- if the board has
SOCBoardLarge.getAddedLayoutPart("AL")
!= null
but
badly formed (node list number 0, or a node list number not followed by a land area number).
This Added Layout Part is rarely used, and this would be discovered quickly while testing
the board layout that contained it.protected void handleCHANGEFACE(SOCChangeFace mes)
mes
- the messageprotected void handleREJECTCONNECTION(SOCRejectConnection mes)
mes
- the messageprotected void handleLONGESTROAD(SOCLongestRoad mes)
mes
- the messageprotected void handleLARGESTARMY(SOCLargestArmy mes)
mes
- the messageprotected void handleSETSEATLOCK(SOCSetSeatLock mes)
mes
- the messageprotected void handleROLLDICEPROMPT(SOCRollDicePrompt mes)
mes
- the messageprotected void handleRESETBOARDAUTH(SOCResetBoardAuth mes)
mes
- the messageSOCServer.resetBoardAndNotify(String, int)
,
SOCGame.resetAsCopy()
protected void handleRESETBOARDVOTEREQUEST(SOCResetBoardVoteRequest mes)
mes
- the messageprotected void handleRESETBOARDVOTE(SOCResetBoardVote mes)
mes
- the messageprotected void handleRESETBOARDREJECT(SOCResetBoardReject mes)
mes
- the messageprivate void handleGAMEOPTIONGETDEFAULTS(SOCGameOptionGetDefaults mes, boolean isPractice)
ServerGametypeInfo
private void handleGAMEOPTIONINFO(SOCGameOptionInfo mes, boolean isPractice)
ServerGametypeInfo.receiveInfo(SOCGameOptionInfo)
.
If all are now received, possibly show game info/options window for new game or existing game.
For a summary of the flags and variables involved with game options,
and the client/server interaction about their values, see
ServerGametypeInfo
.
private void handleNEWGAMEWITHOPTIONS(SOCNewGameWithOptions mes, boolean isPractice)
private void handleGAMESWITHOPTIONS(SOCGamesWithOptions mes, boolean isPractice)
private void handleLOCALIZEDSTRINGS(SOCLocalizedStrings mes, boolean isPractice)
isPractice
- Is the server SOCPlayerClient.ClientNetwork.practiceServer
, not remote?private void handleSCENARIOINFO(SOCScenarioInfo mes, boolean isPractice)
isPractice
- Is the server SOCPlayerClient.ClientNetwork.practiceServer
, not remote?private void handlePLAYERSTATS(SOCPlayerStats mes)
private final void handleDEBUGFREEPLACE(SOCDebugFreePlace mes)
private final void handleSIMPLEREQUEST(SOCSimpleRequest mes)
private final void handleSIMPLEACTION(SOCSimpleAction mes)
protected void handleGAMESERVERTEXT(SOCGameServerText mes)
protected void handleDICERESULTRESOURCES(SOCDiceResultResources mes)
private final void handleMOVEPIECE(SOCMovePiece mes)
private final void handleREMOVEPIECE(SOCRemovePiece mes)
protected void handleREVEALFOGHEX(SOCRevealFogHex mes)
protected void handlePIECEVALUE(SOCPieceValue mes)
protected void handleSVPTEXTMSG(SOCSVPTextMessage mes)
SOCPlayerElement
with the SVP total.
Also sent for each player's SVPs when client is joining a game in progress.
private void handleBOARDSPECIALEDGE(SOCBoardSpecialEdge mes)
private void handleINVENTORYITEMACTION(SOCInventoryItemAction mes)
private void handleSETSPECIALITEM(java.util.Map<java.lang.String,SOCGame> games, SOCSetSpecialItem mes)
SOCDisplaylessPlayerClient.handleSETSPECIALITEM(Map, SOCSetSpecialItem)
,
then calls PlayerClientListener
to update the game display.
games
- Games the client is playingmes
- the message
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |