JML

net.sf.jqql.packets.in
Class FriendDataOpReplyPacket

java.lang.Object
  extended by net.sf.jqql.packets.Packet
      extended by net.sf.jqql.packets.InPacket
          extended by net.sf.jqql.packets.BasicInPacket
              extended by net.sf.jqql.packets.in.FriendDataOpReplyPacket

public class FriendDataOpReplyPacket
extends BasicInPacket

 reply packet of friend remark, format is:
 1. header
 2. subcommand, 1 byte
 3. if is 0x0, follow part is
        a. whether have more remark, 0x00 means have, 0x01 means not
    b. QQ number, 4 byte
    c. unknown 1 byte, 0x00
    d. name length, 1 byte
    e. name 
    f. mobile number length, 1 byte
    g. mobile number
    h. commonly used tele length, 1 byte
    i. commonly used tele
    j. address length, 1 byte
    k. address
    l. emial length, 1 byte
    m. email 
    n. postal code length, 1 byte
    o. postal code
    p. remark length, 1 byte
    q. remark
    r. if have more, repaeat part b-q
    if is 0x01 or 0x02, follow part is
         i. 1 byte rely code, 0x0 means success
    ii. unknown 1 byte
    iii. divider 0x1
    iv. remark info, total 7 field, sequence is
        name, mobile, common tele, address, emial, postal, remark
        every field have a pr- byte, this byte means byte length of this field
 4. tail
 上传下载好友备注的回复包,格式为:
 1. 头部
 2. 子命令,1字节
 3. 如果是0x0,后面的部分为
       a. 是否还有更多备注,0x00表示有,0x01表示无
    b. QQ号,4字节
    c. 一个未知字节,0x00
    d. 名称长度,1字节
    e. 名称
    f. 手机号码长度, 1字节
    g. 手机号码
    h. 常用电话长度, 1字节
    i. 常用电话
    j. 联系地址长度, 1字节
    k. 联系地址
    l. 电子邮箱长度, 1字节
    m. 电子邮箱
    n. 邮编长度,1字节
    o. 邮编
    p. 备注长度,1字节
    q. 备注
    r. 如果还有更多,重复b - q部分
    如果是0x1或者0x02,后面的部分为
    i. 1字节应答码,0x0表示成功
    如果是0x3,后面的部分为(后面也可能什么都没有,说明这个好友没有备注)
    i.   操作对象的QQ号,4字节
    ii.  一个未知字节0
    iii. 分隔符0x1
    iv.  以下为备注信息,一共7个域,域的顺序依次次是
          姓名、手机、电话、地址、邮箱、邮编、备注
         每个域都有一个前导字节,这个字节表示了这个域的字节长度
 4. 尾部
 

Author:
luma

Field Summary
 boolean hasRemark
           
 int qqNum
           
 FriendRemark remark
           
 Map<Integer,FriendRemark> remarks
           
 byte replyCode
           
 byte subCommand
           
 
Fields inherited from class net.sf.jqql.packets.Packet
bodyBuf, bodyDecrypted, command, crypter, ds, duplicated, header, log, sequence, source, user
 
Constructor Summary
FriendDataOpReplyPacket(ByteBuffer buf, int length, QQUser user)
          constructed function 构造函数
 
Method Summary
 String getPacketName()
           
protected  void parseBody(ByteBuffer buf)
          parse packet body, from begin position of buf 解析包体,从buf的开头位置解析起
 
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.InPacket
validateHeader
 
Methods inherited from class net.sf.jqql.packets.Packet
dump, equals, getCommand, getHeader, getSequence, getSource, hash, hashCode, isDuplicated, setDuplicated, setHeader, setSequence
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

replyCode

public byte replyCode

qqNum

public int qqNum

remark

public FriendRemark remark

subCommand

public byte subCommand

hasRemark

public boolean hasRemark

remarks

public Map<Integer,FriendRemark> remarks
Constructor Detail

FriendDataOpReplyPacket

public FriendDataOpReplyPacket(ByteBuffer buf,
                               int length,
                               QQUser user)
                        throws PacketParseException
constructed function 构造函数

Parameters:
buf - 缓冲区 // buffer
length - 包长度 // packet length
Throws:
PacketParseException - 解析错误 // parse error
Method Detail

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 如果解析出错

JML