]> git.cworth.org Git - ttt/commitdiff
2005-12-07 Richard D. Worth <richard@theworths.org>
authorRichard Worth <richard@theworths.org>
Wed, 7 Dec 2005 12:48:54 +0000 (12:48 +0000)
committerRichard Worth <richard@theworths.org>
Wed, 7 Dec 2005 12:48:54 +0000 (12:48 +0000)
        * 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.

ChangeLog
PROTOCOL
TODO
src/ttt-error.c
src/ttt-error.h

index b3ce3c93754627d75f0478068c74762920685ba4..6a8bdf419e71db66a54364241623e73aebe1e276 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+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)
 
index d765ba0ed853e9f9351289f7ee27421056d70380..91c8545b88ac96f482ca5c27893a3715ce10ba07 100644 (file)
--- a/PROTOCOL
+++ b/PROTOCOL
@@ -201,7 +201,7 @@ Document Conventions
         _|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
     
@@ -213,7 +213,7 @@ Document Conventions
     
        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
 
@@ -230,8 +230,8 @@ Document Conventions
        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.  
 
@@ -376,7 +376,7 @@ Document Conventions
        number.
 
        Possibly returned by: MOVE
-    
+
 3.3. Global command errors.
 
     There are no global command errors from any of the global
@@ -436,3 +436,11 @@ Document Conventions
            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
diff --git a/TODO b/TODO
index 25a1dd302e66e153cda597a5d06ea4c18c02cbfe..09463f7c8321060a0d82e3fe1434c6d1e6c5f754 100644 (file)
--- a/TODO
+++ b/TODO
@@ -59,4 +59,5 @@ S C
     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
 
index 9022e93b74b1f131789d29454576e6cda7115add..5d331afbef46d09c41663deafecd020ba89212c3 100644 (file)
@@ -27,10 +27,14 @@ ttt_error_string (ttt_error_t error)
     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:
@@ -39,19 +43,28 @@ ttt_error_string (ttt_error_t error)
        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;
index 3fb1dd915a103b88116ca4c8a5b6d6cfa06dcce4..fff3c14d4543c45e5e66cf911436b4d16b81d959 100644 (file)
 
 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