Kassle

Message types and formats:

To Server
type 19 - 1 byte b 0 <= b <= 5 the number will be what mood

to Client
type 20 - 1 byte b 0 <= b <= 5 other player changed mood to b



to Client Chat number
 type 34 1 byte for Client's chat number.

to Client New Chatter
type 35 - 1 byte for chatter number, 1 byte for name length, n bytes for name.  New chatter joined.

to Server Send message
type 30 - 1 byte for chat number 1 byte n for message length, n bytes for message.  N will be string/UTF.

to Client Receive message
type 31 - 1 byte for Chatter number, 1 byte for message length, n bytes for message. String


To Server
type 21 - 1 byte for game number to join.

To Client
type 22 - 1 byte for player or observer. 0 or 1.

to Client - number of games
type 23 1 byte number of games 

To Client -
type 24 1 byte for game number, 1 byte for name length 1, player 1 name, 1 byte for namelength2, player 2 name








Dialog descriptions:

Client requests socket
Client sends Type 1 or Type 101 player name

If Client sent 101
server sends type 23 with 24, then go to lobby
Client can send type 21
Server sends type 22, either player or observer
if Observer, server sends type 10, then continues to send 14-18 as game goes on
If player, server sends type 2 and continues below.

if Client sends type 1
Server sends type 2 Wait for new player
Server sends type 3 when new player arrives, assigns player number
Server sends type 34 chat number
Server sends type 35 with other player's chat number

Repeatedly: Players send type 4 - 8, server sends 14 - 18 to both players
type 99 when game over, type 9 when false move.

For chat:
Players send type 30