JML

net.sf.jqql.packets.out
Class SearchUserPacket

java.lang.Object
  extended by net.sf.jqql.packets.Packet
      extended by net.sf.jqql.packets.OutPacket
          extended by net.sf.jqql.packets.BasicOutPacket
              extended by net.sf.jqql.packets.out.SearchUserPacket

public class SearchUserPacket
extends BasicOutPacket

 search online user packet, format
 1. head
 2. 1 byte, stands for search type, like 0x31 is to search all online user, 0x30 is to custom search
 3. 1 byte delimiter: 0x1f
 4. search parameter
    i. for request to search all online user, it's a page number, in string form, begins with 0
    ii. for request to custom search, 4 field, separated by 0x1F, order like:
        a. QQ number to search in string form
        b. user nick name to search
        c. user email to search
        d. page number in string form, no delimiter behind, end with 0x0
 5. tail

 搜索在线用户的包,格式为
 1. 头部
 2. 1个字节,表示搜索类型,比如搜索全部在线用户是0x31,自定义搜索是0x30
 3. 1字节分隔符: 0x1F
 4. 搜索参数
       i.  对于搜索全部在线用户的请求,是一个页号,用字符串表示,从0开始
    ii. 对于自定义搜索类型,是4个域,用0x1F分隔,依次是
            a. 要搜索的用户的QQ号的字符串形式
            b. 要搜索的用户的昵称
            c. 要搜索的用户的email
         d. 页号的字符串形式,这后面没有分隔符了,是用0x0结尾的         
 5. 尾部
 

Author:
luma

Field Summary
 
Fields inherited from class net.sf.jqql.packets.OutPacket
ack, key, resendCountDown, sendCount, seq, timeout
 
Fields inherited from class net.sf.jqql.packets.Packet
bodyBuf, bodyDecrypted, command, crypter, ds, duplicated, header, log, sequence, source, user
 
Constructor Summary
SearchUserPacket(ByteBuffer buf, int length, QQUser user)
           
SearchUserPacket(QQUser user)
          constructor 构造函数
 
Method Summary
 String getPacketName()
           
protected  void putBody(ByteBuffer buf)
          initialize packet body 初始化包体
 void setEmail(String email)
           
 void setNick(String nick)
           
 void setPage(int page)
           
 void setQQStr(int qqNum)
           
 void setQQStr(String qqStr)
           
 void setSearchType(byte searchType)
           
 
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchUserPacket

public SearchUserPacket(QQUser user)
constructor 构造函数


SearchUserPacket

public SearchUserPacket(ByteBuffer buf,
                        int length,
                        QQUser user)
                 throws PacketParseException
Parameters:
buf -
length -
Throws:
PacketParseException
Method Detail

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

setPage

public void setPage(int page)
Parameters:
page - The page to set.

setSearchType

public void setSearchType(byte searchType)
Parameters:
searchType - The searchType to set.

setNick

public void setNick(String nick)
Parameters:
nick - The nick to set.

setQQStr

public void setQQStr(int qqNum)
Parameters:
qqNum - The qqNum to set.

setQQStr

public void setQQStr(String qqStr)
Parameters:
qqStr -

setEmail

public void setEmail(String email)
Parameters:
email - The email to set.

JML