Bkgo Network Protocol: Version 0.6 =================================== This documents all valid messages send between client (MessagePasser) and server (ClientConnector). Any message which is not valid is assumed to be a network error. If the server receives garbage, it assumes the client has died and removes the player. If the client receives garbage, it simply complains and discards it. These messages are generally sent with methods PrintWriter.println() and received by a home-made readLine(). The command portion of a message is always an alphanumeric text string -- no spaces allowed. The message ends either with a newline, or a colon followed by arguments followed by a newline. The format of the arguments depends on the message, but it seems safe to say that none of the arguments can contain a newline (with the exception of binary streams, about which see below). Occasionally, a message indicates that a binary (serialized) object is (or should) be sent. When this is the case, the receiver and sender each build temporary ObjectIn/Outputstreams around the sockets. (After transmission, these Objectstreams are discarded.) A. Initial Connection Handshakes > BKGO-Server-version-X < BKGO-Client-version-Y > OK In the future, protocol negotiation will happen, and the server will send "OK" when completed. After the "OK", the client sends one of three requests, ("join", "status", or "shutdown"): < join > GimmeGoPlayer ... < status > Moves made: 47, Black score: 3, ... ... < shutdown > GimmePassword < Password: foobar > server terminated B. Sent from Server to Client: Command[: arg1[, arg2 ...]] Meaning --------------------------- ------- ClearPlayers Please empty out your list of players BlackPlayer: [string] Set the name of the black player (in GoBoard) WhitePlayer: [string] Set the name of the black player (in GoBoard) AddPlayer: [string] Append this to "currently connected" playerlist AnnouncePlayer: [string] Announce the arrival of this player GoodbyePlayer: [string] Announce the departure of this player Dialog: [string] Pop up a dialog with this message ID: [string] This is your server-assigned unique ID number Board: I am about to send you an SGF stream EOF That was the end of the SGF stream GimmeBoard I am ready to receive a GoBoard object GimmeGoPlayer I am ready to receive a GoPlayer object GimmeNewPassword I am asking you to create a password GimmePassword I am challenging you for an existing password ServerRejectedFatal Server rejected you, now die. ServerRejectedNonFatal Server rejected you, oh well. Place: [x, y] Somebody placed a stone at x, y (mass broadcast) Message: [string] Somebody made a comment (mass broadcast) Pass Color to play has passed (mass broadcast) C. Sent from Client to Server: Command[: arg1[, arg2 ...]] Meaning --------------------------- ------- Place: [x, y] I have placed a stone at x, y; tell the world. Message: [string] I have entered a chat message; tell the world. Pass I have passed my turn; tell the world. Quitting: [IDnum] I am leaving the game, and this is my ID number SendingBoard I am sending you an SGF stream EOF That was the end of the SGF stream Player: [string] Here is a new player (see GoPlayer.toString()) Password: [string] I am sending you this password string NewBoard Please broadcast my new board to everyone SetName: [string] I am setting the name of the server