net.sf.jqql.packets.out
Class GetOnlineOpPacket
java.lang.Object
net.sf.jqql.packets.Packet
net.sf.jqql.packets.OutPacket
net.sf.jqql.packets.BasicOutPacket
net.sf.jqql.packets.out.GetOnlineOpPacket
public class GetOnlineOpPacket
- extends BasicOutPacket
get online friend list request packet, format:
1. head
2. 1 byte, server resposes for value 0x02 or 0x03, or else return 0xFF
via initial test, we find that 3 get friends that are all system service, number like 72000001
to 72000013, are QQ mobile, member service and so on; and 2 is used to get friends.
3. intial position, 4 byte. This initial position has totally different meaning from the field from the friend list we get. May be
they are designed by two teams.
the inital position need reply packet to get. As we know, online friend reply packet can at most get 30 friends for one time.
If your online friends count exceeds 30, you need to cout the value. The first request packet, the field surely 0, later request
packet is relatd to the previous one. The concrete rule is like this, find the biggest QQ number in 30 friends from the previus reply
packet, and then add 1 to his QQ number, and it's next request packet initial position.
6. tail
获å–在线好å‹åˆ—è¡¨çš„è¯·æ±‚åŒ…ï¼Œæ ¼å¼ä¸º
1. 头部
2. 1个å—èŠ‚ï¼Œåªæœ‰å€¼ä¸º0x02或者0x03æ—¶æœåŠ¡å™¨æ‰æœ‰å应,ä¸ç„¶éƒ½æ˜¯è¿”回0xFF
ç»è¿‡åˆæ¥çš„试验,å‘现3得到的好å‹éƒ½æ˜¯ä¸€äº›ç³»ç»ŸæœåŠ¡ï¼Œå·ç 比如72000001到72000013,
就是那些移动QQ,会员æœåŠ¡ä¹‹ç±»çš„ï¼›è€Œ2是用æ¥å¾—到好å‹çš„
3. èµ·å§‹ä½ç½®ï¼Œ4å—节。这个起始ä½ç½®çš„å«ä¹‰ä¸Žå¾—到好å‹åˆ—表ä¸çš„å—æ®µå®Œå…¨ä¸åŒã€‚估计是两拨人
设计的,-_-!...
这个起始ä½ç½®éœ€è¦æœ‰å›žå¤åŒ…得到,我们已ç»çŸ¥é“,在线好å‹çš„回å¤åŒ…一次最多返回30个好å‹ï¼Œ
é‚£ä¹ˆå¦‚æžœä½ çš„åœ¨çº¿å¥½å‹è¶…过30个,就需è¦è®¡ç®—è¿™ä¸ªå€¼ã€‚ç¬¬ä¸€ä¸ªè¯·æ±‚åŒ…ï¼Œè¿™ä¸ªå—æ®µè‚¯å®šæ˜¯0,åŽé¢
的请求包和å‰ä¸€ä¸ªå›žå¤åŒ…å°±æ˜¯ç›¸å…³çš„äº†ã€‚å…·ä½“çš„è§„åˆ™æ˜¯è¿™æ ·çš„ï¼Œåœ¨å‰ä¸€ä¸ªå›žå¤åŒ…ä¸çš„30个好å‹é‡Œé¢ï¼Œ
找到QQå·æœ€å¤§çš„é‚£ä¸ªï¼Œç„¶åŽæŠŠä»–çš„QQå·åŠ 1,就是下一个请求包的起始ä½ç½®äº†ï¼
6. 尾部
- 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.BasicOutPacket |
decryptBody, encryptBody, getBodyBytes, getCryptographStart, getFamily, getHeadLength, getLength, getTailLength, parseHeader, parseTail, postFill, putHead, putTail, toString, validateHeader |
Methods inherited from class net.sf.jqql.packets.OutPacket |
dump, fill, getKey, getNextSeq, getSendCount, getTimeout, needAck, needResend, parseBody, setKey, setSendCount, setTimeout |
Methods inherited from class net.sf.jqql.packets.Packet |
equals, getCommand, getHeader, getSequence, getSource, hash, hashCode, isDuplicated, setDuplicated, setHeader, setSequence |
GetOnlineOpPacket
public GetOnlineOpPacket(QQUser user)
- constructor
æž„é€ å‡½æ•°
GetOnlineOpPacket
public GetOnlineOpPacket(ByteBuffer buf,
int length,
QQUser user)
throws PacketParseException
- Parameters:
buf
- length
-
- Throws:
PacketParseException
getPacketName
public String getPacketName()
- Overrides:
getPacketName
in class BasicOutPacket
- Returns:
- descriptive name of packet
包的æè¿°æ€§åç§°
putBody
protected void putBody(ByteBuffer buf)
- Description copied from class:
Packet
- initialize packet body
åˆå§‹åŒ–包体
- Specified by:
putBody
in class Packet
- Parameters:
buf
- ByteBuffer
getStartPosition
public int getStartPosition()
- Returns:
- Returns the position.
setStartPosition
public void setStartPosition(int position)
- Parameters:
position
- The position to set.
getSubCommand
public byte getSubCommand()
- Returns:
- Returns the subCommand.
setSubCommand
public void setSubCommand(byte subCommand)
- Parameters:
subCommand
- The subCommand to set.