This file contains the specifics of exactly how the client and server communicate.
This section regards all the formating that I've used in this document.
The types of data used in this document
lowerCamelCase = Variable
UPPERCASE = Static string
<WRAPPEDSTR> = The "replace me with X"
Variable information
display_name - Display name
name - Unique identifier
Password - MD5 hash of password
Token - MD5 hash we use for identification.
Protocol responses
INVALID - Invalid token
UNKNOWN_COMMAND - User tried executing a nonexistent command
NOT_IMPLEMENTED - Feature is not implemented or enabled
DONE - Sender marks operation as completed.
Logical operators used in this document
&& - And - Different pieces of data separated by "|"
|| - Or - Server will respond with either of the specified responses
Request format
<REQUEST_display_name>
<DESCRIPTION>
<CONVERSATION>
Everything that the client and server can send to eachother
LOGIN
Exchange valid user details for token.
CLIENT-> display_name && hashed psw
SERVER-> token || INVALID
SET_USER
Request server to change our display display_name.
CLIENT-> display_name && token && newname
SERVER-> newname || INVALID
SEND_MESSAGE
Request server to deliver our message.
CLIENT-> display_name && token && message
SERVER-> DONE || INVALID
SEND_COMMAND
Request server to execute a / command.
CLIENT-> display_name && token && command
SERVER-> commandResponse || UNKNOWN_COMMAND || INVALID
SEND_DM
Send a private (direct) message to a user.
CLIENT-> display_name && token && user && msg
SERVER-> DONE || INVALID
DISPLAY
Request the client to display text.
SERVER-> message
CLIENT-> DONE
SET_display_name
Request the client to set the client display_name.
SERVER-> display_name
CLIENT-> DONE
MESSAGE
Send a message to the client
SERVER-> display_name && name && message
CLIENT-> DONE
DM
Request the client to set the client display_name.
SERVER-> display_name
CLIENT-> DONE