Remote Commands
From IRCBotWiki
Bot Protocol 1.3
First Version (1.0): Thursday, January 29, 2004
This is a pretty simple protocol to implement, and was designed as such.
Here are the structures used in the protocol:
typedef struct {
int cmd; // command 0xXX
int datalen; // length of data sent along with the cmd (in bytes)
} REMOTE_HEADER;
typedef struct {
char title[64];// stream title
char dj[64];
int listeners;
int peak;
int max;
} STREAM_INFO;
typedef struct {
unsigned char comp;
unsigned long decomp_len;// (use header.datalen - sizeof(CONSOLE_HEADER) for compressed size)
} CONSOLE_HEADER;
I classify the commands (.cmd) in this way:
0x0X = Login Commands/
0x1X = Request System Commands
0x2X = Misc Commands
0x3X = Source Control Commands (AutoDJ, MP3-Source, etc.)
0xFE = Generic Error Message
Commands from Client to Server:
Login
0x00
Data Sent with Command: username\xFEpass\xFE\x0C
0C is the hex for your protocol version, i.e. 1.3 == 0x13
Log out of Req. System
0x10
Data Sent with Command: None
Log in to Req. System
0x11
Data Sent with Command: None
Dedicate Song (Loads ReqToChans, and sends to all channels)
0x13
Data Sent with Command: The dedication text
DoSpam Toggle
0x20
Data Sent with Command: None
Die
0x21
Data Sent with Command: None
Broadcast Message
0x22
Data Sent with Command: The message to display to the channels
Restart
0x23
Data Sent with Command: None
Remote Console Open
0x24
Data Sent with Command: None
Remote Console Close
0x25
Data Sent with Command: None
Source Control - Countdown
0x30
Data Sent with Command: None
Source Control - Force Off
0x31
Data Sent with Command: None
Source Control - Force On
0x32
Data Sent with Command: None
Source Control - Next
0x33
Data Sent with Command: None
Commands from Server to Client:
Login Failed
0x00
Data Sent with Command: An error message
Login Success
0x01
Data Sent with Command: 1 byte saying what level the user is
Logged out of Req. System
0x10
Data Sent with Command: None
Logged into Req. System
0x11
Data Sent with Command: None
Request from user (only when logged into req. system)
0x12
Data Sent with Command: The request line (just put it straight into a listbox.)
Stream Info Update
0x13
Data Sent with Command: A STREAM_INFO struct;
Console Open (for remote console)
0x20
Data Sent with Command: None
Console Line (for remote console)
0x21
Data Sent with Command: CONSOLE_HEADERstring (header.comp = 0 for no compression, 1 = compressed w/ zlib)
header.decomp_len = is an unsigned long describing the decompressed length, ignore unless header.comp > 0
Console Close (for remote console)
0x22
Data Sent with Command: None
Informational Message from Server
0xFE
Data Sent with Command: A message, just put it straight into a status display
Error Message from Server
0xFF
Data Sent with Command: An error message, just put it straight into a status display
