X-Git-Url: https://git.cworth.org/git?p=ttt;a=blobdiff_plain;f=src%2Fttt-error.c;h=5d331afbef46d09c41663deafecd020ba89212c3;hp=d3e57cba6791da535d6ac64f90ad2aad5de51bc7;hb=d9e3756a30a242d9858829865f54ff4e37e296b9;hpb=47ff725ff3b109b94a23ea7c8c07c8b1417e31ef diff --git a/src/ttt-error.c b/src/ttt-error.c index d3e57cb..5d331af 100644 --- a/src/ttt-error.c +++ b/src/ttt-error.c @@ -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,15 +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;