JML

net.sf.jqql.packets.in
Class KeepAliveReplyPacket

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.KeepAliveReplyPacket

public class KeepAliveReplyPacket
extends BasicInPacket

 reply packet of keep alive, its format is
 1. header
 2. 6 field, parting is "0", "0", all onlien user count, my port, unknown field, compart by ascii 31
 3. tail
 Keep Alive的应答包,格式为
 1. 头部
 2. 6个域,分别是"0", "0", 所有在线用户数,我的IP,我的端口,未知含义字段,用ascii码31分隔
 3. 尾部
 

Author:
luma

Field Summary
static String DIVIDER
           
 String ip
           
 int onlines
           
 int port
           
 
Fields inherited from class net.sf.jqql.packets.Packet
bodyBuf, bodyDecrypted, command, crypter, ds, duplicated, header, log, sequence, source, user
 
Constructor Summary
KeepAliveReplyPacket(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

DIVIDER

public static final String DIVIDER

onlines

public int onlines

ip

public String ip

port

public int port
Constructor Detail

KeepAliveReplyPacket

public KeepAliveReplyPacket(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