X-Git-Url: https://git.cworth.org/git?p=ttt;a=blobdiff_plain;f=PROTOCOL;h=d855cdf348780bc1edecce3e10e5ddb93d36d471;hp=13391ffc2392008b35db92b3d69a02ed135a40da;hb=f2187ebd49f78b84bd2dca6172abc81e54dda199;hpb=66fa000def72aef690cc7522d905a021092e77c5 diff --git a/PROTOCOL b/PROTOCOL index 13391ff..d855cdf 100644 --- a/PROTOCOL +++ b/PROTOCOL @@ -41,14 +41,11 @@ Document Conventions use must be done through some external mechanism. Once connected, the client must identify itself: - HELO [] + HELO -> - HELO - - If the client doesn't supply , the server will compute - one and return it. + HELO Possible errors: INVALIDNAME @@ -62,7 +59,9 @@ Document Conventions WHO ... - lists connected users and the number of games they've won. + Lists connected users and the number of games they've won. + + Possible errors: NONAMESET 1.2.2. Message @@ -72,6 +71,12 @@ Document Conventions MESSAGE + 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: NONAMESET + 1.2.3. Help HELP { } @@ -88,6 +93,8 @@ Document Conventions QUIT + Disconnects the client from the server. + 1.2.5. Version VERSION @@ -112,7 +119,7 @@ Document Conventions INVITE - Possible errors: NOUSER, BUSY + Possible errors: NOUSER, BUSY, NONAMESET 1.3.2. Accepting an invitation @@ -122,6 +129,8 @@ Document Conventions ACCEPT + Possible errors: NONAMESET + 1.4. In-game commands 1.4.1. Get the game contents @@ -149,7 +158,7 @@ Document Conventions _|X|_ X|O|O" - Possible errors: NOTINGAME + Possible errors: NOTINGAME, NONAMESET 1.4.2. Part @@ -161,9 +170,9 @@ Document Conventions Departs the current game - Possible errors: NOTINGAME + Possible errors: NOTINGAME, NONAMESET - 1.5.3. Making a move + 1.4.3. Making a move MOVE @@ -174,11 +183,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: NOTINGAME, NOTYOURMOVE, NOTGRID, NONAMESET 2. Asynchronous notification. @@ -255,13 +264,16 @@ Document Conventions ERROR NONAMESET - '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 - All names must be unique. + All names must be of non-zero length and must be unique. Possibly returned by: HELO @@ -287,7 +299,7 @@ Document Conventions A non-numeric value was supplied where a number was required - 3.2.4. Not color + 3.2.4. Not a grid number ERROR NOTGRID @@ -301,7 +313,7 @@ Document Conventions Errors from game management commands - 3.3.1. No such game + 3.4.1. No such game ERROR NOGAME