-
Notifications
You must be signed in to change notification settings - Fork 5
Ultimate TTT Server: Protocol
Description of the message protocol.
This means that the client should get ready for a new game. After this the server will either request a new move or send an opponent move (the server will always coordinate who begins each game, so the client should just wait until it's asked)
Only sent in the first iteration, to indicate who begins. The server will be expecting a move from the player. Moves are sent in the following format:
{big board.x},{big board.y};{small board.x},{small board.y}
Example:
The following code would play where the X is located:
2,1;1,0
1 0 0 | 0 0 0 | 0 0 0
1 0 0 | 0 0 0 | 0 0 0
1 0 0 | 1 0 0 | 0 0 0
------+-------+-------
1 0 0 | 0 0 0 | 0 X 0
0 0 0 | 0 0 0 | 0 0 0
0 0 0 | 0 0 0 | 0 0 0
------+-------+-------
0 1 0 | 0 0 0 | 0 0 0
0 0 0 | 0 0 0 | 0 0 0
0 0 0 | 0 0 0 | 0 0 0
------+-------+-------
This indicates what the opponent has done, in the same format as moves requested from the player: {big board.x},{big board.y};{small board.x},{small board.y}
.
After receiving this, the player should reply directly with his move.