digital-scurf wiki Colloquy 2Protocol

Colloquy 2 Protocol, Revision 0
-------------------------------

Colloquy 2 will have a strict protocol, that then proxies will convert into
more user-friendly formats.  This will simplify the writing of bots, and mean
you can have a NILEX interface, as well as an IRC interface, as easily as each
other.

The protocol is shockingly simple.  The format for sending commands is:

<tag> <command> <data>\n

'tag' is a client-specified tag for this command.  It may consist of any
characters other than space and newline, and must not be the single character
'0', as this is used for when the talker wishes to send unrequested data to you.
'command' is the command that you wish to execute.  'data' is any parameters
you wish to transmit.

The result will look like this:

<tag> <response code> <data>\n

'tag' is what you specified, 'response code' we will go into shortly, and
'data' is the result.

The talker may send data to you that is unrequested by you.  For example,
talk traffic, people connecting and disconnecting, and such.  In this case,
the tag will be the single digit zero. ('0')

If a result will be sent in numerous lines, the last line's response code
will be either 'DONE' or 'ERROR', with further details in the data section.

Here is an example conversation:
( < signifies data sent by the talker, and > data sent to the talker)

< 0 HELLO colloquy 2.0 (28 May 2005)
> 1 LOGIN Bob bobpassword
< 1 DONE Login successful
> 2 LOOK
< 2 LOOK @Public Bob(M) Kinnison(M) dkscully(MI) mouse(P) aguest(I)
< 2 DONE
< 0 TALK @Public Kinnison Hi Bob.
> 3 SAY @Public Moo Kinnison.
< 3 DONE
< 0 TALK @Public Bob Moo Kinnison.
> Cheese QUIT I'll be back soon!
< Cheese DONE Bye!