net.sf.jqql.packets.in
Class DownloadGroupFriendReplyPacket
java.lang.Object
net.sf.jqql.packets.Packet
net.sf.jqql.packets.InPacket
net.sf.jqql.packets.BasicInPacket
net.sf.jqql.packets.in.DownloadGroupFriendReplyPacket
public class DownloadGroupFriendReplyPacket
- extends BasicInPacket
reply packet of download group friend list requst, its format is
1. header
2. handle byte, download is 0x1
3. reply code, 1 byte
4. 4 unknown byte, all 0
5. beginning friend number of next download packet, 4 byte
6. firend QQ number, 4 byte
7. firend type, 0x1 means common friend, 0x4 means group
8. group sequence, 1 byte, but it's strange, not 1, 2, 3, but sequence multiply 4, for example if is belong group 2,
then this is 8, note if my friend group is 0, that is maybe not 4 multiple, can't know it's what.
but divide 4 to get group sequence is still usefull
9. if has more friend, repeat 4, 5, 6 part
10. tail
this packet data parsed can be accessed by hashMap friends, every group is a list, group index is key,
for example group 0, group 1, parting can get a list object, list include friend QQ number
请求下载分组好友列表的回复包,格式为
1. 头部
2. 操作字节,下载为0x1
3. 回复码,1字节
4. 4个未知字节,全0
5. 下一个下载包的起始好友号,4字节
6. 好友的QQ号,4字节
7. 好友类型,0x1表示普通好友,0x4表示群
8. 分组序号,1字节,但是这个很奇怪,不是1,2,3那样的,而是用序号乘4,比如如果是属于第2个组,
那么这个就是8,注意我的好友组是第0组,但是有可能这个数字不是4的倍数,那就不知道什么
意思了,但是除以4得到组序号的方法仍然不受影响
9. 如果还有更多好友,重复4,5,6部分
10. 尾部
这个包解析后产生的数据可以通过哈希表friends访问,每一个组为一个list,用组的索引为key,
比如第0,第1组,分别可以得到一个List对象,list中包含了好友的qq号
- Author:
- luma
Fields inherited from class net.sf.jqql.packets.Packet |
bodyBuf, bodyDecrypted, command, crypter, ds, duplicated, header, log, sequence, source, user |
Methods inherited from class net.sf.jqql.packets.BasicInPacket |
decryptBody, encryptBody, getBodyBytes, getCryptographStart, getFamily, getHeadLength, getLength, getTailLength, parseHeader, parseTail, putBody, putHead, putTail, toString |
Methods inherited from class net.sf.jqql.packets.Packet |
dump, equals, getCommand, getHeader, getSequence, getSource, hash, hashCode, isDuplicated, setDuplicated, setHeader, setSequence |
friends
public List<DownloadFriendEntry> friends
beginFrom
public int beginFrom
replyCode
public byte replyCode
subCommand
public byte subCommand
DownloadGroupFriendReplyPacket
public DownloadGroupFriendReplyPacket(ByteBuffer buf,
int length,
QQUser user)
throws PacketParseException
- constructed function
构造函数
- Parameters:
buf
- 缓冲区 // bufferlength
- 包长度 // packet length
- Throws:
PacketParseException
- 解析错误 // parse error
getPacketName
public String getPacketName()
- Overrides:
getPacketName
in class BasicInPacket
- Returns:
- descriptive name of packet
包的描述性名称
parseBody
protected void parseBody(ByteBuffer buf)
throws PacketParseException
- Description copied from class:
Packet
- parse packet body, from begin position of buf
解析包体,从buf的开头位置解析起
- Specified by:
parseBody
in class Packet
- Parameters:
buf
- ByteBuffer
- Throws:
PacketParseException
- if parse error
如果解析出错