X-Git-Url: https://git.cworth.org/git?p=ttt;a=blobdiff_plain;f=PROTOCOL;h=be0f04d04a6b2a5640215c4622d366c672145c9b;hp=666379735435cb56aebda1c4aed3be5adfeac89a;hb=47ff725ff3b109b94a23ea7c8c07c8b1417e31ef;hpb=f8bdcd97af8d0dcee79ab692fffb83dba5a5498a diff --git a/PROTOCOL b/PROTOCOL index 6663797..be0f04d 100644 --- a/PROTOCOL +++ b/PROTOCOL @@ -31,11 +31,11 @@ Document Conventions is one of: - ERROR + ERROR 1. Requests -1.1 Connection setup +1.1. Connection setup The TTTP server has no well defined port; agreement on which port to use must be done through some external mechanism. Once connected, @@ -47,21 +47,37 @@ Document Conventions HELO - Possible errors: INVALIDNAME + Possible errors: INVALID_NAME 1.2. Global commands - 1.2.1 Listing available users + 1.2.1. Listing available users WHO -> - WHO ... + WHO ... - lists connected users and the number of games they've won. + Lists connected users. - 1.2.2. Message + Possible errors: NO_NAME_SET + + 1.2.2. STATISTICS + + STATISTICS + + -> + + STATISTICS " + TICTACTOE WINS + " + + Lists the statistics for the specified user. + + Possible errors: NO_NAME_SET, NO_USER + + 1.2.3. Message MESSAGE @@ -69,15 +85,27 @@ Document Conventions MESSAGE - 1.2.3. Help + Sends a message to all connected users. The text must be a + single token. Use a quoted-string to include spaces in the + message text. + + Possible errors: NO_NAME_SET + + 1.2.4. Help HELP { } + -> + + HELP { } " + + " + Displays help. If is provided, displays more detailed help on a specific command, otherwise displays an overview of all commands. - 1.2.4. Quit + 1.2.5. Quit QUIT @@ -85,7 +113,9 @@ Document Conventions QUIT - 1.2.5. Version + Disconnects the client from the server. + + 1.2.6. Version VERSION @@ -109,7 +139,7 @@ Document Conventions INVITE - Possible errors: NOUSER, BUSY + Possible errors: NO_USER, BUSY, NO_NAME_SET 1.3.2. Accepting an invitation @@ -119,6 +149,8 @@ Document Conventions ACCEPT + Possible errors: NO_NAME_SET + 1.4. In-game commands 1.4.1. Get the game contents @@ -146,7 +178,7 @@ Document Conventions _|X|_ X|O|O" - Possible errors: NOTINGAME + Possible errors: NOT_IN_GAME, NO_NAME_SET 1.4.2. Part @@ -158,7 +190,7 @@ Document Conventions Departs the current game - Possible errors: NOTINGAME + Possible errors: NOT_IN_GAME, NO_NAME_SET 1.4.3. Making a move @@ -171,11 +203,11 @@ Document Conventions indicates a number in the tic-tac-toe grid as follows: - 1|2|3 - 4|5|6 - 7|8|9 + 0|1|2 + 3|4|5 + 6|7|8 - Possible errors: NOTINGAME, NOTYOURMOVE, NOTGRID + Possible errors: NOT_IN_GAME, NOT_YOUR_MOVE, NOT_GRID, NO_NAME_SET 2. Asynchronous notification. @@ -214,6 +246,8 @@ Document Conventions NOTICE MESSAGE + where is a quoted-string. Quotes escaped with '\"' + 2.2. Game notices These notices are sent to all players and watchers in @@ -231,7 +265,7 @@ Document Conventions NOTICE GAMEOVER - is either WON in which case indicates + is either WON in which case indicates the winner or CATSGAME in which case is "". 2.2.2. Move notices @@ -250,13 +284,16 @@ Document Conventions 3.1.1. No name set - ERROR NONAMESET + ERROR NO_NAME_SET - 'helo' must be sent before any command other than 'quit'. + 'helo' must be sent before any command other than 'help', + 'version', 'quit'. + + Possibly returned by: WHO MESSAGE INVITE ACCEPT SHOW PART MOVE 3.1.2. Invalid name - ERROR INVALIDNAME + ERROR INVALID_NAME All names must be of non-zero length and must be unique. @@ -280,13 +317,13 @@ Document Conventions 3.2.3. Not number - ERROR NOTNUMBER + ERROR NOT_NUMBER A non-numeric value was supplied where a number was required 3.2.4. Not a grid number - ERROR NOTGRID + ERROR NOT_GRID The number specified in the command was not a valid grid number @@ -300,7 +337,7 @@ Document Conventions 3.4.1. No such game - ERROR NOGAME + ERROR NO_GAME A game name was provided that does not exist. @@ -308,7 +345,7 @@ Document Conventions 3.5.1. No such user - ERROR NOUSER + ERROR NO_USER A user name was provided that does not exist. @@ -318,7 +355,7 @@ Document Conventions 3.6.1.1. Not in game - ERROR NOTINGAME + ERROR NOT_IN_GAME A game playing command was made, but the user is not a particpant of any game. @@ -327,7 +364,7 @@ Document Conventions 3.6.1.2. Not playing - ERROR NOTPLAYING + ERROR NOT_PLAYING A command was executed by a watching user that is permitted only to players @@ -336,7 +373,7 @@ Document Conventions 3.6.2.1. Not your turn - ERROR NOTYOURTURN + ERROR NOT_YOUR_TURN A move was submitted during the other player's turn