ggz.cards.common
Class ServerOpCode

java.lang.Object
  extended by ggz.cards.common.ServerOpCode

public class ServerOpCode
extends java.lang.Object

Messages from server


Field Summary
static ServerOpCode MSG_BADPLAY
          Tells the player that they have made a bad play.
static ServerOpCode MSG_BID
          Tells the client of a player's bid.
static ServerOpCode MSG_GAME_MESSAGE_CARDLIST
          A list of cards for each player.
static ServerOpCode MSG_GAME_MESSAGE_PLAYER
          A text message for the player, consisting of a seat # followed by a message string.
static ServerOpCode MSG_GAME_MESSAGE_TEXT
          A simple text message, containing two strings: a "marker" and the "message".
static ServerOpCode MSG_GAME_SPECIFIC
          Block data that may be game-specific.
static ServerOpCode MSG_GAMEOVER
          Tells the client of a gameover situation.
static ServerOpCode MSG_HAND
          Tells the client of a player's hand.
static ServerOpCode MSG_NEWGAME
          Tells the client of a start of a new game.
static ServerOpCode MSG_NEWHAND
          Tells the client a new hand is starting.
static ServerOpCode MSG_PLAY
          Tells the client of a player playing a card onto the table.
static ServerOpCode MSG_PLAYERS
          Tells the client the list of seats.
static ServerOpCode MSG_PLAYERS_STATUS
          Tells the client the status of each player.
static ServerOpCode MSG_SCORES
          Tells the client scores.
static ServerOpCode MSG_TABLE
          Sends out the current table to the client.
static ServerOpCode MSG_TRICK
          Tells the client of the end of a trick.
static ServerOpCode MSG_TRICKS_COUNT
          Tells the client tricks.
static ServerOpCode MSG_TRUMP
          Contains a single byte that tells the trump suit.
static ServerOpCode REQ_BID
          Requests a bid from the client.
static ServerOpCode REQ_NEWGAME
          Requests a newgame response (RSP_NEWGAME) from the client.
static ServerOpCode REQ_OPTIONS
          Requests options from the client.
static ServerOpCode REQ_PLAY
          Requests a play (of a card) from the client.
 
Method Summary
 java.lang.String toString()
           
static ServerOpCode valueOf(int ordinal)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REQ_NEWGAME

public static final ServerOpCode REQ_NEWGAME
Requests a newgame response (RSP_NEWGAME) from the client. No data.


MSG_NEWGAME

public static final ServerOpCode MSG_NEWGAME
Tells the client of a start of a new game. Followed by a string containing the game type, and an integer containing the cardset type.


MSG_GAMEOVER

public static final ServerOpCode MSG_GAMEOVER
Tells the client of a gameover situation. It'll be followed by an integer n followed by a list of n players who are the winners of the game.


MSG_PLAYERS

public static final ServerOpCode MSG_PLAYERS
Tells the client the list of seats. It'll be followed by an integer containing the number of seats, one containing the number of players, and one containing the number of teams, followed by data for all seats. For each seat, an integer giving the seat status (GGZSeat), a string for the seats's name, and integer for the player sitting at the seat, and and integer for the team of that player will be sent. Note that the names may be invalid or empty for OPEN seats.


MSG_SCORES

public static final ServerOpCode MSG_SCORES
Tells the client scores. Consists of the hand number (between 0 and the current hand), an integer containing the number of "extra" scores (0 or higher), and one score per team. Each score consists of an integer for the main score plus one integer for each extra score.


MSG_TRICKS_COUNT

public static final ServerOpCode MSG_TRICKS_COUNT
Tells the client tricks. Consists of one integer per player that gives the number of tricks won by that player (only applicable in some games).


REQ_OPTIONS

public static final ServerOpCode REQ_OPTIONS
Requests options from the client. It is followed by an integer n followed by n option requests. Each option request consists of a descriptive text for the option, an integer m telling how many choices there are for this option, and integer in the range 0..(m-1) giving the default option choice, then m strings representing the option choices themselves. For each of the n options, the client must choose one of the m choices and send this back to the server with a RSP_OPTIONS. If m==1 then the option is considered "boolean" and either a 0 or 1 may be sent. It needs a RSP_OPTIONS in response.


MSG_NEWHAND

public static final ServerOpCode MSG_NEWHAND
Tells the client a new hand is starting. It is followed by an single integer containing the hand number (hand counting starts at 0), then by the 'dealer' seat.


MSG_TRUMP

public static final ServerOpCode MSG_TRUMP
Contains a single byte that tells the trump suit.


MSG_HAND

public static final ServerOpCode MSG_HAND
Tells the client of a player's hand. It'll be followed by a seat # for whom the hand belongs to, followed by an integer n for the hand size, followed by n cards.


MSG_PLAYERS_STATUS

public static final ServerOpCode MSG_PLAYERS_STATUS
Tells the client the status of each player. This consists of two integers, each of which is a bit vector containing one bit per player. The first integer has bits set if the player is bidding, the second if the player is playing.


REQ_BID

public static final ServerOpCode REQ_BID
Requests a bid from the client. It'll be followed by an integer n, then n bid choices. Each bid choice consists of the bid itself (see read_bid/write_bid) and two strings: a short bid text, and a longer bid description. The client must choose one of these bids and send a RSP_BID in response.


MSG_BID

public static final ServerOpCode MSG_BID
Tells the client of a player's bid. It is followed by a seat # for the seat from which the bid comes, then the bid itself.


REQ_PLAY

public static final ServerOpCode REQ_PLAY
Requests a play (of a card) from the client. It'll be followd by the seat # of the hand from which the client is supposed to play (only a few games, like bridge, ever require a player to play from a hand that is not their own), then a number n, then a list of n valid cards. The client should send a RSP_PLAY in response.


MSG_BADPLAY

public static final ServerOpCode MSG_BADPLAY
Tells the player that they have made a bad play. It is followed by a string that is the error message. It needs a RSP_PLAY in response.


MSG_PLAY

public static final ServerOpCode MSG_PLAY
Tells the client of a player playing a card onto the table. It is followed by a seat # for the seat from which the card has been played, then the card that was played from their hand.


MSG_TRICK

public static final ServerOpCode MSG_TRICK
Tells the client of the end of a trick. It is followed by a seat # giving the player who won the trick.


MSG_TABLE

public static final ServerOpCode MSG_TABLE
Sends out the current table to the client. It is followed by a card for each player, in order. Note that only one card per player/seat may be on the table at a time.


MSG_GAME_MESSAGE_TEXT

public static final ServerOpCode MSG_GAME_MESSAGE_TEXT
A simple text message, containing two strings: a "marker" and the "message".


MSG_GAME_MESSAGE_PLAYER

public static final ServerOpCode MSG_GAME_MESSAGE_PLAYER
A text message for the player, consisting of a seat # followed by a message string.


MSG_GAME_MESSAGE_CARDLIST

public static final ServerOpCode MSG_GAME_MESSAGE_CARDLIST
A list of cards for each player. First comes a "marker" string, then (for each player) an integer n plus n cards for that player.


MSG_GAME_SPECIFIC

public static final ServerOpCode MSG_GAME_SPECIFIC
Block data that may be game-specific. It is up to the client frontend to determine what (if anything) to do with this data; it'll be built at the server end by the game module.

Method Detail

valueOf

public static ServerOpCode valueOf(int ordinal)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object