Skip to content

Protocol version Remix

Jonathan Silverman edited this page Jul 21, 2020 · 19 revisions

GlobalChat Protocol

seperator: "::!!::"

all messages have a chat_token to help identify the sender

all commands are "\0" (null byte) terminated

any arrays returned are "\n" (new line) delimited

TO SERVER

SIGNON::!!::handle::!!::password

login as your handle with an optional server password

GETHANDLES::!!::chat_token

ask the server to send me the currently online handles

GETBUFFER::!!::chat_token

ask the server to return the scrollback in text (BUFFER message) or a blank string if disabled

MESSAGE::!!::message::!!::chat_token

send a global message to everyone in the server

SIGNOFF::!!::chat_token

exit the system.. not necessary to be removed from server

PING::!!::chat_token

PING/PONG mechanism, keeps connection alive and helps with autoreconnect

PUBKEY::!!::public_key::!!::chat_token

Tell the server your public key, so it can be shared (public_key is Base64 encoded)

PRIVMSG::!!::handle::!!::message::!!::chat_token

Send a private, E2E encrypted message to a user (ChaChaPoly)

GETPUBKEYS::!!::chat_token

Request to be sent all users public keys for private messaging

POINT::!!::x::!!::y::!!::mouse_is_dragging::!!::red::!!::green::!!::blue::!!::line_width::!!::chat_token

Tell the server about a point you just drew, so it can be saved and replayed to recreate the drawing

GETPOINTS::!!::chat_token

Tell the server to pack up all it's points and send to you (for global draw replay)

CLEARCANVAS::!!::chat_token

admin only, clear the server's canvas and the clients canvases permanently

DELETELAYERS::!!::handle::!!::chat_token

admin only, delete the user's layers from the server and clients

BAN::!!::handle::!!::chat_token

admin only, ban the user's IP from the server

UNBAN::!!::handle::!!::chat_token

admin only, unban the user's IP from the server

KEY::!!::public_key

tell the server your public key (to secure the socket)


TO CLIENT

TOKEN::!!::chat_token::!::handle::!!::server_name

a response to SIGNON, gets your chat token, a random token used to send commands to the server that identifies you, and also returns your handle and the current server name

BUFFER::!!::buffer

a response to GETBUFFER, this returns the chat log for buffer replay

HANDLES::!!::handles

a response to GETHANDLES, gets the handles online

JOIN::!!::handle

a join message, handle just joined

LEAVE::!!::handle

a leave message, saying handle just exited

SAY::!!::handle::!!::message

a public (global) chat message from handle

PONG::!!::handles

response to PING, contains the currently online handles

PUBKEY::!!::public_key::!!::handle

which public key to use for sending encrypted PRIVMSGs to this handle (public_key is Base64 encoded)

PRIVMSG::!!::handle::!!::encypted_message

sent to client when PRIVMSG'd, encrypted with their public key

CANVAS::!!::canvas_size::!!::num_of_points

(ie 1280x800) Open a shared drawing window on user's screen or just set the size and let them open later (size is fixed). num_of_points refers to how many points you will be sent

POINT::!!::x::!!::y::!!::mouse_is_dragging::!!::red::!!::green::!!::blue::!!::line_width::!!::username

Add the point at x,y to canvas, connecting to last point is mouse_is_dragging is true, setting the color RGB(red, green, blue) and line width Int(line_width) to the canvas in username's layers and redraw

CLEARCANVAS::!!::handle_who_cleared

clear the canvas for this server

DELETELAYERS::!!::handle

delete the layers for this handle locally and redraw

KEY::!!::public_key

tell the client the server's public key, to use for encrypting messages to the server

Clone this wiki locally