-
Notifications
You must be signed in to change notification settings - Fork 1
Protocol
This document describes the client-server protocol used by WalrusIRC. It uses the same database (plus a few extensions), checkLogin.php and IRC relay as OmnomIRC, so they can be used together using the same data (actually, it's recommended as it can serve as a failover for WalrusIRC), but the browser-server communication slightly differs.
This software makes use of the Socket.IO library, the protocol is therefore mainly composed of socket.on(event, function(data){})
and socket.emit(event, data)
events. Parameters (passed in data) are always passed in the form of a JSON object.
Those are events the server sends and the client recieves.
Parameters: One line from the irc_lines
table, in JSON format.
The client should add one line to the chat window, formatted depending of the type. Depending of the event, it should also send a userlist
event (join
, part
, quit
, kick
, nick
), update the topic bar (topic
) or add the line to the sent line history (message
, action
).
The server usually send them when a lastlines
or lastcurid
event is recieved or when the omnomirc_curid
file on the server changes.
Parameters: topic
: The current topic.
The client should update the topic bar with the current topic. Usually sent on loading.
Parameters: None.
The client should scroll the window to the bottom. Usually sent after each message or message batch.
Those events are sent by the socket.io library itself, they should be used to tell the user whether the client is connected to the server or not. Useful in case the server goes down or the user loses their Internet access.
Those are events the client sends and the server recieves.