]> git.cworth.org Git - ttt/blobdiff - PROTOCOL
2005-12-03 Richard D. Worth <richard@theworths.org>
[ttt] / PROTOCOL
index be0f04d04a6b2a5640215c4622d366c672145c9b..4fcec635a468d92e7d491d81c35467ecaa0b8663 100644 (file)
--- a/PROTOCOL
+++ b/PROTOCOL
@@ -149,17 +149,40 @@ Document Conventions
 
        ACCEPT
 
-       Possible errors: NO_NAME_SET
+       Possible errors: NO_USER, NO_NAME_SET
+
+    1.3.3. Retracting an invitiation
+
+       RETRACT <username>
+
+       ->
+
+       RETRACT
+
+       Possible errors: NO_USER, NO_NAME_SET
+
+    1.3.3. Declining an invitation
+
+       DECLINE <username>
+
+       ->
+
+       DECLINE
+
+       Possible errors: NO_USER, NO_NAME_SET
 
 1.4. In-game commands
 
+    <game> is a game id generated by the server and first returned in
+    NOTICE NEWGAME
+
     1.4.1. Get the game contents
     
-       SHOW
+       SHOW <game>
     
        ->
     
-       SHOW <game-board>
+       SHOW <game> <game-board>
     
        <game-board> is a quoted multi-line string containing an
        diagram of the tic-tac-toe board, which is a 3x3 array of
@@ -173,28 +196,28 @@ Document Conventions
     
        For example:
     
-       SHOW "
+       SHOW <game> "
        _|X|O 
         _|X|_
         X|O|O"
     
-       Possible errors: NOT_IN_GAME, NO_NAME_SET
+       Possible errors: NO_NAME_SET, NO_GAME, NOT_IN_GAME
     
     1.4.2. Part
     
-       PART
+       PART <game>
     
        ->
     
        PART
     
-       Departs the current game
+       Departs the specified game
 
-       Possible errors: NOT_IN_GAME, NO_NAME_SET
+       Possible errors: NO_NAME_SET, NO_GAME, NOT_IN_GAME
     
     1.4.3. Making a move
 
-       MOVE <number>
+       MOVE <game> <number>
     
        ->
     
@@ -207,7 +230,8 @@ Document Conventions
        3|4|5
        6|7|8
     
-       Possible errors: NOT_IN_GAME, NOT_YOUR_MOVE, NOT_GRID, NO_NAME_SET
+       Possible errors: NO_NAME_SET, NO_GAME, NOT_IN_GAME,
+       NOT_YOUR_MOVE, NOT_GRID
     
 2. Asynchronous notification.  
 
@@ -235,14 +259,36 @@ Document Conventions
        NOTICE QUIT <username>
     
     2.1.3. Game invitation
+
+       2.1.3.1. Invitation is made
+
+               NOTICE INVITE <username1> <username2>
+
+       2.1.3.2. Invitation is accepted
+
+               NOTICE ACCEPT <username2> <username1>
+
+       2.1.3.3. Invitation is retracted
+
+               NOTICE RETRACT <username1> <username2>
+
+       2.1.3.4. Invitation is declined
+
+               NOTICE DECLINE <username2> <username1>
+
+       The first username listed is the one performing the action.
+
+    2.1.4. New games
+
+       NOTICE NEWGAME <game> <username> <username>
     
-       NOTICE INVITE <username>
-    
-    2.1.4. Terminated games
+       The first username listed will go first.
+
+    2.1.5. Terminated games
     
        NOTICE DISPOSE <game>
     
-    2.1.5. Message
+    2.1.6. Message
 
        NOTICE MESSAGE <username> <text>
 
@@ -251,19 +297,16 @@ Document Conventions
 2.2. Game notices
 
     These notices are sent to all players and watchers in
-    the affected game
+    the affected game.
 
-    2.2.1. Global game notices
-
-       2.2.1.1. New game begins
+    <game> is a game id generated by the server and first returned in
+    NOTICE NEWGAME
 
-           NOTICE NEWGAME <username> <username>
-
-           The first username listed will go first
+    2.2.1. Global game notices
 
-       2.2.1.2. Game over, and winner
+       2.2.1.1. Game over, and winner
 
-           NOTICE GAMEOVER <outcome> <username>
+           NOTICE GAMEOVER <game> <outcome> <username>
 
            <outcome> is either WON in which case <username> indicates
            the winner or CATSGAME in which case <username> is "".
@@ -272,7 +315,7 @@ Document Conventions
 
        2.2.2.1. Move
        
-           NOTICE MOVE <username> <number>
+           NOTICE MOVE <game> <username> <number>
 
 3. Errors