ChatRev protocol:

Connecting to the chat:
You need to know the IP of the chat server to connect to it. The IP is: 81.221.127.96. Also currently there is a file which contains the IP of my server. its url is "http://www.revolutionboard.de/bvg/ip.txt" The port used is 8008, and you might find another server on port 8080. 8080 is the test server, and might be taken down any time, where 8008 is the stable server and has no planned downtimes.

Every message is delimited by returns. Every message is ended with return. In the examples I give, "return" is written as "cr". Also in the examples is "comma" which means the comma character (,). THe last mentioned delimiter is "tab" which means the tabulator.
Text you send is in quotes (eg: "login", variables you need to fill in are plain (eg: yourMessageHere). All communication is case independent.
 
Messages and how the Server expects them:

registering:

Registering is currently a simple matter, with few crosstalk. First you open the socket to the chatrev server.

Then you write your first message:
"register" & cr & nickname & comma & password & comma & "deprecate" & cr
The nickname can contain any chars, besides "tab" or ","(comma).
the password can contain any chars, besides ",".

The server responses with one of these messages:
"taken" & cr
this means that the nick is already registered.
"empty nick" & cr
this means that item one (above: nickname) of your message was empty.
"registered" & cr
your client has successfully registered the user nickname.

if you want to set the user modifiable data (mouseover, about, label), then you just send the appropriate messages now (they are described below).

after registering you send a disconnect message:
"disconnect" & cr
the socket to the server should now be closed by using the "close socket" command.

login:

First you open the socket to the chatrev server.

Then you send your login information:
"login" & cr & nickname & comma & password & cr

The server responds with one of these messages:
"login wrong" & cr
either the user was not found, or the password was wrong.
"logged in" & cr
You can now proceed with logging in (you are not finished yet).

You now write your version information:
"version 1.2" & cr

The server should now send you one of these:
"version OK" & cr
if it is ANYTHING else, then you should disconnect, and show the received message to the user.
"please update to version 1.2, http://homepage.mac.com/bvg/chatrev1.2.rev" & cr
the current error message, when connecting with anything but 1.2

the server now proceeds to send your login information to everyone else that is connected. This contains: a "member" message, a "setmouse" message.
The server also sends the same to you about every other logged in client.
the other clients also get a "message" from the server, saying "Nickname: logged on at " and the server time. Where you get a "message" from the server saying "Nickname: you are logged in!" and the server time. When you have received that, then you are properly connected.

Status messages:

all these messages can be received at any time after you have send the version number.

the setmouse message sets the caption (previously called "MouseOver" or "Label") of a user to a certain value. It goes like this:
"setmouse" & cr & Nickname & tab & label & cr
you now can set the label of the user Nickname.

the member message indicates that a user has logged on. It goes like this:
"member" & cr & nickname & tab & label & cr
After this message you automatically get a message by the server that the person has logged on. Note that you can't rely on the label for identifying users, just use the nickname to do that.

the unmember message indicates that a user has logged off It goes like this:
"unmember" & cr & Nickname & tab & label & cr
After this message you automatically get a message by the server that the person has logged off. Note that you can't rely on the label for identifying users, just use the nickname to do that.

The error message indicates that you have done something bad (not following the protocol) so you get this message:
"error" & cr & theErrorMessage & cr
you should disconnect after this message, socket communication can not be guaranteed anymore.

the kick message is there to kick too talkative people.
"kick" & cr 
you should disconnect when receiving this message.

Chat messages:

the chat message indicates a message that is send to everyone. Excluded are messages from the server which might get send to everyone, but are always "messages". Chat goes like this:
"chat" & cr & Nickname & cr & htmltext & cr
you receive this to show the text. Version 1.1 and 1.0 have submitted clear text here, but htmltext allows for multiple lines and formatting.

the message message indicates a private message, only send to you (except server messages which are send to everyone). it goes like this:
"message" & cr & Nickname & cr & htmltext & cr
you receive this to show the text. Version 1.1 and 1.0 have submitted clear text here, but htmltext allows for multiple lines and formatting.

the me message indicates a humorous action. it is send to everyone, like the chat message.
"me" & cr & Nickname & cr & plaintext & cr
The me message allows no formatting or htmltext.

Messages you can write:

"chat" & cr & htmltext & cr

"message" & cr & htmltext & cr

"me" & cr & text & cr

"setabout" & cr & text & cr

"setMouse" & cr & text & cr

"setmail" & cr & text & cr
this text may not contain spaces. and should be a mail address

"getmail" & cr & Nickname & space & subject & cr
When you send this message you automatically get a response from the server:
"mail" & cr & mailadress & space & subject & cr
where subject is the same as you have send before.

"getAbout" & cr & Nickname & cr
Again this gives you a autoreply, this time a private message which contains the about of the user Nickname.

last but not least there is the ping message. you should write a pong message to the server when you encounter a ping, or you will be disconnected.
"ping" & cr
"pong" & cr