e "meme" chat protocol
Elliott Hird, December 2007
= Message format ===============================================================
<message> = <tag>\t<command>[\t<args>]\n
<tag> is a base-10 number.
<command> is one of the valid commands (described below).
<args> = <key>: <value>[\t<args>]
<key> is one of the valid argument names for the command.
<value> is any UTF-8 string -- to escape tabs, use '\t' in the message, and to
escape backslashes, use '\.'.
= Example session ==============================================================
(Note: replace 8 spaces with a tab.)
> = from client
< = from server
> 1 hello client: netcat user: ehird
< 1 ok
> 2 join room: main
< 2 ok
< - join room: main user: ehird
> 3 say room: main text: Hello, world!
< 3 ok
< - say room: main user: ehird text: Hello, world!
> 4 bye reason: quit
< 4 ok
= Server responses =============================================================
<response> = <tag>\t<status>[\t<args>]\n
<tag> and <args> are the same as above, <status> is either "ok" or "fail".
The arguments given are command-specific.
= Server messages ==============================================================
<server-message> = -\t<type>[\t<args>]\n
<type> is one of the valid server messages (described below).
Most often resembles the message that triggered it.