Data packet:
struct CB_Data_Packet {
int channel; 4 bytes
int command; 4 bytes
char handle[20]; 20 bytes
char message[100]; 100 bytes
};
Commands:
- CB_ON
Sets up data on server and sends welcome message
- CB_OFF
Closes socket and removes client data from server
- SET_CHAN
Sets the client's channel to the data contained in the channel field.
- WHO_CHAN
Creates a message containing the handles of everyone subscribed to the client's channel and sends it back to the requesting client.
- WHO_ALL
Same as above, but for all channels **not implemented yet**
- SVR_STATS
Send some stats on the server to a client **not implemented yet**
- SEND_MESSAGE
Broadcasts the message contained in the message field to all clients