The basic information has been obtained. Now you can chat. It is necessary to note that webqq is based on the HTTP protocol, so the server will not send information to the client when new information is required for the client, and the client needs to regularly go to the server for query.
The scheduled query command for webqq is 00 in the following format:
1030196367; 00; message number; 4b2b432f;
Webqq sends a message to the server every about 1 second.
1. Get group chat content
Command returned by the server: 17
The format is as follows:
1030196367; 17; 28656; xxxxxx; 54028; 2B; 0b; chat content; 0c40808010 10; 1; 86540289; xxxxxx; 128783; 374; 1281709924; 3305670154;
The second value is the command number 17. The third value can be interpreted as the chat content number. The fourth value is the group ID. Note that it is not the group number. The fifth value is the chat content number. The sixth value is the sub-command number, 2b indicates the group message. The seventh is unknown. The eighth is the chat content. The Chat content is somewhat complicated. It is different from the QQ expression. Now, only the simplest text is processed. The ninth is the font, the first two characters "0C" constitute the hexadecimal number of a byte. The first byte is the underline, the second italic, and the third is the bold, the last five digits are the font size, "408080" is the text color, "10" is meaningless, and then the font is later. 12th are the spokesman's QQ number, and 15th are the speech time.
After receiving the chat message, you must tell the server that the message is successfully received. The format is as follows:
1030196367; 17; 28656; 4b2b432f; xxxxxx; 1030196367; 54028; 2; 3305670154;
Obviously, the third, fifth, and 16th numbers received by the server are required, and the data is easy to analyze. If you do not reply to this message, the server will think that the client has not received the chat content and will send it again. Of course, even if the reply is received, therefore, you need to record the chat content number to check whether the chat content has been received.
Author: yjh4866
Source Address: http://blog.csdn.net/yjh4866