Many of the messages of class GAME are strictly unecessary. It would be possible for clients to maintain their own state information. However, retaining state in the server, and allowing the clients to remain substantially stateless, means that recovery in the event of disconnection is easier.

There are three classes of message:

Types:

card
cardinal cardsuit
cardinal
{2 | 3 | 4 | 5 | 6 | 7| 8 | 9 | 10 | J | Q | K | A }
cardsuit
{ C | D | H | S }
suit
{ cardsuit | NT }
bid
{ contractvalue | PASS | DOUBLE | REDOUBLE }
contractvalue
digit suit
gameid
string
team
{ NS | EW }
string
[a-zA-Z0-9]
position
{ N | E | S | W }

The following messages are used:

Name Class RequiredArguments Optional Arguments
HELLO PLAYER
  1. The player's real name as a UTF-8 string
This message announces a player to a server.

Normally sent immediately after a client connects to the server. Clients should not expect any responses from a server unless this message has been sent.

TOURNAMENTS CLIENT
  1. A list of tournamentids
Shows a list of all the tournaments currently in progress.
GAMES CLIENT
  1. A list of gameids
Shows a list of all NonTournament games which are available to join. ie have < 4 players.
JOIN-T PLAYER
  1. The tournamentid of the tournament to join. If ommitted,

    a new tournament will be created and a the client joins it.

  2. The name of another player whom the client wishes to partner for the duration of the tournament.
This message requests a tournament be joined.

If successfull, then the server would normally allocate them a game, by sending a JOINED message.

JOIN-M PLAYER
  1. The gameid of the game to join. If omitted, then a new game will be created and the client joins it.
  2. The position of play in the game. If omitted, then the server will allocate a position.
This message requests the client be allowed to join a game.
JOINED GAME
  1. The gameid
  2. The position of play in the game.
  1. The player's real name as a UTF-8 string
This message announces that a player has joined a game.

Clients may interpret this either as a response to a JOIN request, or as allocation by the server. The latter would normally only occur after a client has joined a tournament.

NAK CLIENT
  1. Description of the problem as a UTF-8 string

Typically used to deny requests or send error messages. Clients should not rely upon this or any message as a result of any request.
AUCOPEN GAME
  1. The position whose turn it is to bid, or 0 if no bids are being accepted.
  2. A list of bids so far.
This may be sent by the server any time during the auction..
BID PLAYER
  1. The bid made
This message is sent by a client to make a bid.
HAND CLIENT
  1. A list of cards the player now holds
This message is sent by a server to a client, to indicate what cards the client currently has in his hand. It is typically sent when a hand is dealt, by can be sent at any time.
PLAY PLAYER
  1. The card to play
Sent by the client to the server to indicate that the player wishes to play a card.
DUMMY GAME
  1. A list of cards currently in the dummy hand.
Sent by the server to clients, to indicate the cards held in the dummy hand. Typically sent immediately after the first lead, but possibly at any time.
TRICK GAME
  1. The position whose turn it is to play, or 0 if no play is being accepted.
  2. A list of all cards played in the trick so far, in the order in which they were played..
Sent by the server to clients. It indicates the cards in the trick and invites a particular client to play a card.
TRICKSWON GAME
  1. A list of up to 13 positions indicating the teams winning the tricks, in the order they were played. This list will be empty if no tricks have been completed.
Sent by the server to indicate the number of tricks won by each team. Usually sent when a trick is won, but can arrive at any time.
AUCCLOSE GAME
  1. The trump suit
  2. The contract value
  3. The double status
  4. The team holding the contract.
Normally sent at the close of an auction, to indicate its result.
SCORE-M GAME
  1. The number of points above the line (NS)
  2. The number of points below the line (NS)
  3. The vulnerability (NS)
  4. The number of points above the line (EW)
  5. The number of points below the line (EW)
  6. The vulnerability (EW)
Sent to indicate the current score. Normally sent at the close of a hand. This message is not applicable to tournaments.

hello

Examples

These examples are for illustration only. They should not be treated as part of the specification