+2005-12-07 Richard D. Worth <richard@theworths.org>
+
+ * PROTOCOL: Remove unused error NOT_IN_GAME. Add error
+ NOT_VALID_MOVE.
+
+ * TODO: Add error NOT_VALID_MOVE.
+
+ * src/ttt-error.h:
+ * src/ttt-error.c: (ttt_error_string): Add section comments. Add
+ error NOT_VALID_MOVE.
+
2005-12-06 Bryan Worth <bryan@theworths.org>
* src/ttt-error.c: fixed missing errors (NO_INVITE, NO_GAME)
_|X|_
X|O|O"
- Possible errors: NO_NAME_SET, NO_GAME, NOT_IN_GAME
+ Possible errors: NO_NAME_SET, NO_GAME
1.4.2. Part
Departs the specified game
- Possible errors: NO_NAME_SET, NO_GAME, NOT_IN_GAME
+ Possible errors: NO_NAME_SET, NO_GAME
1.4.3. Making a move
3|4|5
6|7|8
- Possible errors: NO_NAME_SET, NO_GAME, NOT_IN_GAME,
- NOT_PLAYING, NOT_YOUR_MOVE, NOT_GRID
+ Possible errors: NO_NAME_SET, NO_GAME, NOT_PLAYING,
+ NOT_YOUR_MOVE, NOT_GRID, NOT_VALID_MOVE
2. Asynchronous notification.
number.
Possibly returned by: MOVE
-
+
3.3. Global command errors.
There are no global command errors from any of the global
A move was submitted during the other player's turn.
Possibly returned by: MOVE
+
+ 3.6.2.2. Not a valid move
+
+ ERROR NOT_VALID_MOVE
+
+ A move was submitted for a cell that is occupied.
+
+ Possibly returned by: MOVE
3.6.1.1. ERROR NOT_PLAYING
3.6.2. Moving errors
3.6.2.1. ERROR NOT_YOUR_TURN
+ 3.6.2.2. ERROR NOT_VALID_MOVE
switch (error) {
case TTT_ERROR_NONE:
return "ERROR NONEi\r\n";
+
+ /* 3.1. Connection setup errors */
case TTT_ERROR_NO_NAME_SET:
return "ERROR NO_NAME_SET\r\n";
case TTT_ERROR_INVALID_NAME:
return "ERROR INVALID_NAME\r\n";
+
+ /* 3.2. Command format errors */
case TTT_ERROR_COMMAND:
return "ERROR COMMAND\r\n";
case TTT_ERROR_SYNTAX:
return "ERROR NOT_NUMBER\r\n";
case TTT_ERROR_NOT_GRID:
return "ERROR NOT_GRID\r\n";
+
+ /* 3.3. Global command errors */
+
+ /* 3.4. Game management errors */
case TTT_ERROR_NO_INVITE:
return "ERROR NO_INVITE\r\n";
case TTT_ERROR_NO_GAME:
return "ERROR NO_GAME\r\n";
+
+ /* 3.5. User information errors */
case TTT_ERROR_NO_USER:
return "ERROR NO_USER\r\n";
- case TTT_ERROR_NOT_IN_GAME:
- return "ERROR_NOT_IN_GAME\r\n";
+
+ /* 3.6. In-game errors */
case TTT_ERROR_NOT_PLAYING:
return "ERROR_NOT_PLAYING\r\n";
case TTT_ERROR_NOT_YOUR_TURN:
return "ERROR NOT_YOUR_TURN\r\n";
- /* Not an actual protocol errror, so this should never happen. */
+ case TTT_ERROR_NOT_VALID_MOVE:
+ return "ERROR NOT_VALID_MOVE\r\n";
+
+ /* Here's a non-protocol pseudo-error used to implement QUIT. */
case TTT_ERROR_QUIT_REQUESTED:
ASSERT_NOT_REACHED;
break;
typedef enum {
TTT_ERROR_NONE,
+ /* 3.1. Connection setup errors */
TTT_ERROR_NO_NAME_SET,
TTT_ERROR_INVALID_NAME,
+ /* 3.2. Command format errors */
TTT_ERROR_COMMAND,
TTT_ERROR_SYNTAX,
TTT_ERROR_NOT_NUMBER,
TTT_ERROR_NOT_GRID,
+ /* 3.3. Global command errors */
+ /* 3.4. Game management errors */
+ TTT_ERROR_NO_INVITE,
+ TTT_ERROR_NO_GAME,
+ /* 3.5. User information errors */
TTT_ERROR_NO_USER,
- TTT_ERROR_NOT_IN_GAME,
+ /* 3.6. In-game errors */
TTT_ERROR_NOT_PLAYING,
TTT_ERROR_NOT_YOUR_TURN,
- TTT_ERROR_NO_INVITE,
- TTT_ERROR_NO_GAME,
-
+ TTT_ERROR_NOT_VALID_MOVE,
/* Here's a non-protocol pseudo-error used to implement QUIT. */
TTT_ERROR_QUIT_REQUESTED