net.sf.jqql.packets.out
Class ClusterSendTempIMPacket
java.lang.Object
net.sf.jqql.packets.Packet
net.sf.jqql.packets.OutPacket
net.sf.jqql.packets.BasicOutPacket
net.sf.jqql.packets.out.ClusterCommandPacket
net.sf.jqql.packets.out.ClusterSendIMExPacket
net.sf.jqql.packets.out.ClusterSendTempIMPacket
public class ClusterSendTempIMPacket
- extends ClusterSendIMExPacket
send temp cluster message
1. head
2. command type, 1 byte, 0x35
3. cluster category, 1byte
4. parent cluster internal ID, 4 byte
5. cluster internal ID, 4 byte
6. total length of data behind, 2 byte
7. Content Type, 2 byte, 0x0001 is plain text, 0x0002 means exists custom face.
8. message fragment count, 1 byte.
9. fragment sequence, 1 byte, begin from 0
11. message id, 2 byte, the same message of different fragment has the same id.
12. 4 byte, unknown.
13. message content, append space to the last fragment
Note: space in tail is a must. Without the space, it will cause some default face to present as mess code.
14. message tail, contain some message parameter, like font color, and so on. The order is:
1. font decoration attribute, bold, tialic and so on. 2 byte, concrete setting is:
i. bit0-bit4 is used to present font size, thus the largest is 32
ii. bit5 presents bold or not
iii. bit6 presents italic or not
iv. bit7 presents underline or not
2. color Red,, 1 byte
3. color Green, 1 byte
4. color Blue, 1 byte
5. 1 unknown byte, set 0 first
6. message encoding, 2 byte, 0x8602 is GB, 0x0000 is EN, other unknown, seems can be custom, for server seems not to interfere
7. a piece of length changable info, after the font name is an enter, like 0xcb, 0xcc, 0xe5 presents SongTi
15. 1 byte, present the length of part 14 and 15
16. tail
Notice: only the last fragment has part 14, 15 and 16.
发送临时群消息
1. 头部
2. 命令类型,1字节,0x35
3. 群类型,1字节
4. 父群内部ID,4字节
5. 群内部ID,4字节
6. 后面的数据的总长度,2字节
7. Content Type, 2字节,0x0001表示纯文件,0x0002表示有自定义表情
8. 消息分片数,1字节
9. 分片序号,1字节,从0开始
11. 消息id,2字节,同一条消息的不同分片id相同
12. 4字节,未知
13. 消息内容,最后一个分片追加空格
Note: 结尾处的空格是必须的,如果不追加空格,会导致有些缺省表情显示为乱码
14. 消息的尾部,包含一些消息的参数,比如字体颜色啦,等等等等,顺序是
1. 字体修饰属性,bold,italic之类的,2字节,具体的设置是
i. bit0-bit4用来表示字体大小,所以最大是32
ii. bit5表示是否bold
iii. bit6表示是否italic
iv. bit7表示是否underline
2. 颜色Red,1字节
3. 颜色Green,1字节
4. 颜色Blue,1字节
5. 1个未知字节,置0先
6. 消息编码,2字节,0x8602为GB,0x0000为EN,其他未知,好像可以自定义,因为服务器好像不干涉
7. 可变长度的一段信息,字体名后面跟一个回车符,比如0xcb, 0xce, 0xcc, 0xe5,表示宋体
15. 1字节,表示14和15部分的字节长度
16. 尾部
注意:只有最后一个分片有14, 15, 16部分
- 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.out.ClusterSendIMExPacket |
getBlue, getEncoding, getFontName, getFontSize, getFragmentSequence, getGreen, getMessage, getMessageId, getRed, getTotalFragments, isBold, isItalic, isUnderline, setBlue, setBold, setEncoding, setFontName, setFontSize, setFragmentSequence, setGreen, setItalic, setMessage, setMessageId, setRed, setTotalFragments, setUnderline |
| 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, setKey, setSendCount, setTimeout |
| Methods inherited from class net.sf.jqql.packets.Packet |
equals, getCommand, getHeader, getSequence, getSource, hash, hashCode, isDuplicated, setDuplicated, setHeader, setSequence |
ClusterSendTempIMPacket
public ClusterSendTempIMPacket(QQUser user)
- constructor
构造函数
ClusterSendTempIMPacket
public ClusterSendTempIMPacket(ByteBuffer buf,
int length,
QQUser user)
throws PacketParseException
- Parameters:
buf - length -
- Throws:
PacketParseException
getPacketName
public String getPacketName()
- Overrides:
getPacketName in class ClusterSendIMExPacket
- Returns:
- descriptive name of packet
包的描述性名称
putBody
protected void putBody(ByteBuffer buf)
- Description copied from class:
Packet
- initialize packet body
初始化包体
- Overrides:
putBody in class ClusterSendIMExPacket
- Parameters:
buf - ByteBuffer
getParentClusterId
public int getParentClusterId()
- Returns:
- Returns the externalId.
setParentClusterId
public void setParentClusterId(int externalId)
- Parameters:
externalId - The externalId to set.
getType
public byte getType()
- Returns:
- Returns the type.
setType
public void setType(byte type)
- Parameters:
type - The type to set.