Length | Content (if fixed) | Designation | Description |
2 bytes | 01 00 | VERSION | Protocol version (First version) |
1 byte | 01 | PACKET_TYPE | Indicate it is server to client packet |
4 bytes | xx xx xx xx | UNICHAT_NO | Your (the client's) Number |
4 bytes | xx xx xx xx | SESSION_ID | Used to prevent 'spoofing'. |
2 bytes | xx xx | COMMAND | See below for list of commands |
2 bytes | xx xx | SEQ_NUM | Starts at 1 (Use for acknowledgement) |
4 bytes | xx xx xx xx | CHECKCODE | Use for valid the packet |
variable | xx ... | PARAMETERS | Parameters for the command being sent |
Command Name | Command Code | Description |
CLI_LOGIN | 00 01 | For Login to UNICHAT Server |
CLI_LOGOUT | 00 02 | For Logout from UNICHAT Server |
CLI_ACK | 00 03 | (Indicate the client has received the packet from UNICHAT Server |
CLI_SEND_MSG | 00 04 | Send a message to other user through UNICHAT Server |
CLI_KEEP_ALIVE | 00 05 | Inform UNICHAT Server that the client still online (Send every 2 minutes) |
CLI_SEND_CONTACT | 00 06 | Indicate the client wish to receive online events from these people |
CLI_REG_NEW | 00 07 | Register a new user through UNICHAT Server |
CLI_SELF_STATUS | 00 08 | Indicate the client's status (online or offline) |
CLI_ADD_USER | 00 09 | Add friend into contact list |
CLI_DEL_USER | 00 0A | Delete friend from contact list |
CLI_INI_SRH | 00 0B | Initial a search with UNICHAT number as key |
Length | Content (if fixed) | Designation | Description |
2 bytes | 01 00 | VERSION | Protocol version (First version) |
1 byte | 02 | ZERO | Indicate it is client to server packet |
4 bytes | xx xx xx xx | SESSION_ID | Same as in your login packet. |
2 bytes | xx xx | COMMAND | See below for list of commands |
2 bytes | xx xx | SEQ_NUM | Sequence number for acknowledgement |
4 bytes | xx xx xx xx | UNICHAT_NO | Your (the client's) Number |
4 bytes | xx xx xx xx | CHECKCODE | Use for valid the packet |
variable | xx ... | PARAMETERS | Parameters for the command being sent |
Command Name | Command Code | Description |
SRV_LOGIN_REPLY | 00 01 | Indicate valid login for client |
SRV_ACK | 00 03 | Indicate server has receive the packet from client |
SRV_RECV_MSG | 00 04 | Indicate a user has send messge to the client through server |
SRV_USER_STATUS | 00 05 | Indicate a user has change status |
SRV_AWAY | 00 06 | Indicate server is away from client |
SRV_SRH_RESULT | 00 0B | Indicate it is search result packet |