JML

net.sf.jqql.packets.in
Class LoginReplyPacket

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

public class LoginReplyPacket
extends BasicInPacket

 reply packet of login
 1. header
 2. reply code, 1 byte
 part2 if is 0x00
 3. session key, 16 byte
 4. user QQ number, 4 byte
 5. my Internet IP, 4 byte
 6. my Internet IP, 2 byte
 7. server IP, 4 byte
 8. server port, 2 byte
 9. times of this login, 4 byte, is 1970-1-1 / 1000
 10. unknown 2 byte
 11. user authentication token, 24 byte
 12. unknown server 1 ip, 4 byte
 13. unknown server 1 port, 2 byte
 14. unknown server 2 ip, 4 byte
 15. unknown server 2 port, 2 byte
 16. unknown 2 byte
 17. unknown 2 byte
 18. clent key , 32 byte, this key use in place such login QQ homestead 
 19. unknown 12 byte
 20. last login ip, 4 byte
 21. last login times, 4 byte
 22. unknown 39 byte
 part 2 if is 0x01, means redirect
 3. QQ user number, 4 byte
 4. server IP redirect to, 4 byte
 5. server port redirect to, 2 byte
 part 2 if is 0x05, means lonin fail
 3. a error info  
 QQ登陆应答包
 1. 头部
 2. 回复码, 1字节
 2部分如果是0x00
 3. session key, 16字节
 4. 用户QQ号,4字节
 5. 我的外部IP,4字节
 6. 我的外部端口,2字节
 7. 服务器IP,4字节
 8. 服务器端口,2字节
 9. 本次登录时间,4字节,为从1970-1-1开始的毫秒数除1000
 10. 未知的2字节
 11. 用户认证令牌,24字节
 12. 一个未知服务器1的ip,4字节
 13. 一个未知服务器1的端口,2字节
 14. 一个未知服务器2的ip,4字节
 15. 一个未知服务器2的端口,2字节
 16. 两个未知字节
 17. 两个未知字节
 18. client key,32字节,这个key用在比如登录QQ家园之类的地方
 19. 12个未知字节
 20. 上次登陆的ip,4字节
 21. 上次登陆的时间,4字节
 22. 39个未知字节
 2部分如果是0x01,表示重定向
 3. 用户QQ号,4字节
 4. 重定向到的服务器IP,4字节
 5. 重定向到的服务器的端口,2字节
 2部分如果是0x05,表示登录失败
 3. 一个错误消息
 

Author:
luma

Field Summary
 byte[] authToken
           
 byte[] clientKey
           
 byte[] ip
           
 byte[] lastLoginIp
           
 long lastLoginTime
           
 long loginTime
           
 int port
           
 byte[] redirectIp
           
 int redirectPort
           
 byte replyCode
           
 String replyMessage
           
 byte[] serverIp
           
 int serverPort
           
 byte[] sessionKey
           
 
Fields inherited from class net.sf.jqql.packets.Packet
bodyBuf, bodyDecrypted, command, crypter, ds, duplicated, header, log, sequence, source, user
 
Constructor Summary
LoginReplyPacket(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

sessionKey

public byte[] sessionKey

ip

public byte[] ip

serverIp

public byte[] serverIp

lastLoginIp

public byte[] lastLoginIp

redirectIp

public byte[] redirectIp

port

public int port

serverPort

public int serverPort

redirectPort

public int redirectPort

loginTime

public long loginTime

lastLoginTime

public long lastLoginTime

replyCode

public byte replyCode

replyMessage

public String replyMessage

clientKey

public byte[] clientKey

authToken

public byte[] authToken
Constructor Detail

LoginReplyPacket

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