!argument
: required[arguments]
: list of arguments, not space separated[arguments\*]
: List of arguments, space separated{argument|argument}
: Choice between arguments<argument>
Optional argument
The connect (CONNECT) method signals the server whom is connecting and what extensions the client supports. A request with this method must be sent immediately after establishing a connection with the server.
CONNECT !name ![exts]
CONNECT stevejobs 01
: The client is called stevejobs and supports extensions 0 and 1.
CONNECT hans
: The client is called hans, and supports no extensions.
The server is allowed to send a timeout error if the server decides the CONNECT method is not called in time.
The disconnect (DISCONNECT) method signals the server that the client will close the current socket. This command is mandatory, however upon TCP timeout, the socket can be closed too.
DISCONNECT
The game ready (GAME READY) method signals the server the client is ready to accept a random game to be assigned. The server is not required to respond immediately after this method.
GAME READY
Illegal method use: The server is allowed to send this command if the client is ready already.
The game unready (GAME UNREADY) method signals the server that the client may not be assigned a random game anymore.
GAME UNREADY
The game move (GAME MOVE) method may only be called while the client is in a game and it is his turn. This command tells the server the X and Y coordinates he wishes a playpiece may be placed. These coordinates, in the minimum implementation of this protocol, range from 0-3. The Z-coordinate is derived automattically by the state of the board.
GAME MOVE !x !y
GAME MOVE 0 2
: Lets the server know it must attempt to place a piece at (0, 2)
GAME MOVE 2 1
: Lets the server know it must attempt to place a piece at (2, 1)
Illegal move: The player has made a move at a moment it is not allowed to or at a position it is not allowed to.
Illegal method syntax: Either one or both coordinates are missing.
The players (PLAYERS) command requests the server to list all players or the players with the supplied extensions.
`PLAYERS !{ALL|[exts]}
PLAYERS ALL
: Lists all players currently connected
PLAYERS 02
: Lists all players with extension 0 and 2 installed.
Illegal method syntax: The parameter is missing
The error (ERROR) command is used to communicate errors. See the chapter describing errors and error codes for more information.
ERROR !error
The confirm (CONFIRM) command is used to confirm a connection. It also tells the client which extensions the server supports.
CONFIRM <[exts]>
CONFIRM 012
: Tells the client the extensions it supports are 0, 1 and 2. Also confirms a connection.
CONFIRM
: Tells the client it supports no extensions. It does confirm a successful connection.
The game start (GAME START) command is used to inform the client a game will start. It lists all players in the game in order of whom goes first and whom goes second.
GAME START ![players\*]
GAME START bob peter
: A game starts, bob is first, peter is second.
The game move (GAME MOVE) command is a broadcast command that lets every player know a move has been made, by whom it was made and which coordinates it was made at. It also signals the next player (if there is one).
GAME MOVE !current !x !y <next>
GAME MOVE bob 2 0 hans
: Bob has made a move at (2, 0) it is Hans' turn now.
GAME MOVE hans 2 2
: Hans has made a move at (2, 2) and it is the final move of this game.
The game end (GAME END) command is used to signal the end of the game, along with whom has won.
GAME END !{DRAW|PLAYER !username}
GAME END PLAYER hans
: Hans has won the game
GAME END DRAW
: The game ended in a draw
The players (PLAYERS) command is used as a response to the clients players (PLAYERS) command. It contains a list of all players that match the given criteria.
PLAYERS !{ALL|[exts]} [players\*]
PLAYERS ALL hans peter dirk jan
: All the players on this server are hans, peter, dirk and jan.
PLAYERS 0 hans
: Hans is the only player who supports extension 0.
The error (ERROR) command signals a server error. More information can be found in the errors section.
ERROR !code