Connecting to a server |
||||
Client | ||||
Once the TCP connection between a client
and a server is established, the client has to send a serie of messages
to log onto server. First message the client has to send is its identification: |
||||
If the client identification succeeds,
the server replies with its identification: | ||||
Once the client recieved the server identification,
it can send the player identification message: |
||||
If the player identification succeeds, the server
sends these messages: These messages act as a 'login ok' acknowlegdment. |
||||
If the player identification fails, the server returns an error message and closes the connection: | ||||
Possible errors when identificating the player: | ||||
If the login fails, the server returns an error message and closes the connection. | ||||
Possible errors when connecting to a server:
|
||||
Hall Users | ||||
When a player logs into server, the server sends this message to every hall users: |
Server service messages |
||
All Server Users (Game Players + Hall Users) | ||
To notify an exceptional event to all users connected, the server sends this message: |
logged
stateChatting |
||
Client | ||
Client sends this message: | ||
If the chat succeeds, the server replies with:: (the emitting client receives his own chat message) | ||
If the chat message fails, the server sends an error message: | ||
Possible errors when chatting: | ||
Game Players | ||
If the client is connected to a game, the server sends this message to other game players: | ||
Hall Users | ||
If the client isn't connected to a game, the server sends this message to hall users: |
Whispering |
||
Client | ||
If the client is sending the whisper message, it sends this message: | ||
If the whisper fails, the server sends an error message: | ||
Possible errors when whispering: | ||
The client used by the player to whom the message is sent to, receives this message: |
Chat Actions |
||
Client | ||
If the client is wishes to send a chat action, it sends this message: | ||
If the chat action fails, the server sends an error message: | ||
Possible errors when performing a chat action: | ||
Leaving the server |
||
Client | ||
To disconnect from a server, the client sends this message: | ||
Game Players | ||
If the client is connected to a game, the server sends this message to other game players: | ||
Hall Users | ||
The server send this message to hall users: |
A game has ended on the server |
||
Hall Users | ||
When a game is over, the server sends this message to every player in the hall. |
Joining a game on the server |
||
Client | ||
The client sends this message: | ||
If the game join succeeds, the server replies with the message: The game information of the game joined by the client is sent back and acts as an acknowledgement for the joining. Clients should then load the proper boardtype. | ||
If the game creation fails, the server replies with the error message: | ||
Possible errors when joining a game are: | ||
Game Players | ||
When a player joins a game, the server send this message to game players: | ||
Hall Users | ||
When a player joins a game, the server sends this message to hall users: |
Getting the board type |
||
Client | ||
The board type is defined in a specific field from the Game Information message received when joining a game: | ||
Once the boardtype for a game has been determined the client should behave as follows: | ||
If the boardtype field is DYNAMIC ,
occasional board type messages will
be sent by the server, requiring the client to dynamically change the
boardtype during the course of a game.
This is for example the case in the anagram gametype where the
boardtype is changed every turn. |
||
If the boardtype is known to the client, it should load the boardtype definition from its own local resources. | ||
If the board type is unknown to the client, a board type request should be issued in order to receive a board type message from the server, which will describe the board type in detail. Note: The client is strongly encouraged to save the content of the board type message to a local file in order to be able to reload it at a later time. This saves time and bandwidth for both the server and the client. |
Game starting |
||
Client | ||
To start a game, the client sends this message: | ||
If the game started successfully, the server replies with the message: | ||
If the game creation fails, the server replies with the error message: | ||
Possible error when starting a game are: | ||
Game Players | ||
When a game is started by the game creator or a game operator, the servers sends this message to game players: |
Kicking a player from a game |
||
Client | ||
To kick a player from a game, the client sends this message: | ||
If the kick command succeeds, the server replies with the message: | ||
If the kick command fails, the server replies with the error message: | ||
Possible errors when kicking a player out of a game are: | ||
Game Players | ||
When a player is kicked out of a game,
the server sends this message to game players:
This message is sent to all players connected to this game, even to the
player being kicked out. The kicked player returns then to the hall (ie: when the client detects its own playername as the kicked argument of the message,
it has to set its state to 'in hall'). |
Playing moves |
||
Client | ||
Before the end of the turn, the client can send his moves using this message: | ||
The server evaluates the player's moves, and if the moves are erroneous sends an error message: | ||
Possible errors when playing moves are:
|
||
If end of turn has been reached (countdown is over), the server requests players' moves using this message: | ||
Once the request moves message is received by the client, the player's moves have to be sent using this message: | ||
The server evaluates the player's moves, and if the moves are erroneous sends an error message: (see above for possible errors) |
Start Of Turn |
||
Game Players | ||
At the beginig of a turn, the server sends this message to the game players: |
End Of Turn |
||
Game Players | ||
At the end of a turn, the server sends this message to the game players: |
End of a game |
||
Game Players | ||
At the end of a game, the server sends this message to game players: |
Leaving the game |
||
Client | ||
To leave a game, clients send this message: | ||
If the leaving fails, the server replies with the error message: | ||
Possible errors when leaving a game are: | ||
Game Players | ||
When a player leaves the game, the server sends this message to all game players: |