Client Protocol Messages

All information on this page applies only to c15 c protocol messages.

To allow Turf to filter which messages are passed, and to more easily allow parsing of messages by clients, by general consensus all messages should take an MAJOR.minor style, where the class of the message comes first, and the function next, such as, and then any arguments needed. This page briefly details the client messages understood by TkTurf.

CHESS.yield tells the other person that they have yielded. x y tells the other client that it should show piece x,y being

CHESS.move_selection x y tells it to move the selected piece to x,y

CHESS.wannaplay2 is sent to all, asking if the client is capable of chess, and
	the user is willing to play, and not playing anyone at the moment

CHESS.willingtoplay2 is a reply to the above saying the user on this end is
	willing to play.
CHESS.challenge is sent by the challenger to the person being challenged to
	indicate a challenge
CHESS.denied is the negative reply to the above

CHESS.gameon is the positive reply to the above

As far as chess, since the game is entirely client side moves should be checked
for legality on both sides of the send.  Errors and illegal moves should be
silently ignored.

REVERSI.wannplay : query who is using a Reversi capable client

REVERSI.willplay : reply to above

REVERSI.challenge : send a challenge

REVERSI.deny : refuse the above

REVERSI.gameon : accept challenge

REVERSI.move num : num is x,y represented as x * 10 + y

Be sure to check move validity, yet another client-side game.

BATTLESHIP.wannaplay : query who is using a battleship capable client

BATTLESHIP.willplay : response to the above

BATTLESHIP.challenge : challenge message

BATTLESHIP.deny : refuse a challenge

BATTLESHIP.gameon : accept a challenge

BATTLESHIP.ready : done placing ships

BATTLESHIP.yield : surrender message

BATTLESHIP.shot x y : send a shot to x y

BATTLESHIP.hit : last shot sent was a hit

BATTLESHIP.miss : last shot sent missed

BATTLESHIP.idiot : last shot sent was in a taken slot

BATTLESHIP.sink : last shot sent sunk something

BATTLESHIP.bbox x1 y1 x2 y2 : sends bounding boxes for all ships to show ship
	locations at the end of the game

Clients should ignore attempts to shoot until the client has received the ready message.

FILE.wannasend : request to see who will accept files

FILE.willconsider : reply to above

FILE.decline passwd: decline a file send identified by passwd, once offered

FILE.send PASS:passwd IP:ip_to_connect_to PORT:port SIZE:bytes FILE:name :
file send request, client will use IP and port to connect to, and then send
PASS:passwd across the socket, file transfer then begins if the pass is correct

The point to raw message passing is to allow client authors to create their own features, and to extend others. Therefore, any new protocols may be made, and any listed here extended. However, it is hoped that all client creators will make an attempt to keep their clients compatable with all the others for the sake of the users. This listing is by no means official, although it is fairly versatile and use of it is encouraged.

Back to Turf's Homepage