mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
mostly auto-generated by ``` rf ' ex { var c QQClient var seq uint16 var payload []byte var command string BuildUniPacket(c.Uin, seq, command, 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload) -> c.uniPacket(seq, command, payload) } ' ```
49 lines
1.1 KiB
Go
49 lines
1.1 KiB
Go
package client
|
|
|
|
import (
|
|
"github.com/Mrs4s/MiraiGo/client/internal/codec"
|
|
)
|
|
|
|
//go:noinline
|
|
func (c *QQClient) buildOicqRequestPacket(uin int64, command uint16, body []byte) []byte {
|
|
req := codec.OICQ{
|
|
Uin: uint32(uin),
|
|
Command: command,
|
|
EncryptMethod: c.ecdh,
|
|
Key: c.RandomKey,
|
|
Body: body,
|
|
}
|
|
return req.Encode()
|
|
}
|
|
|
|
//go:noinline
|
|
func (c *QQClient) uniPacketWithSeq(command string, body []byte) (uint16, []byte) {
|
|
seq := c.nextSeq()
|
|
req := codec.Uni{
|
|
Uin: c.Uin,
|
|
Seq: seq,
|
|
CommandName: command,
|
|
EncryptType: 1,
|
|
SessionID: c.OutGoingPacketSessionId,
|
|
ExtraData: EmptyBytes,
|
|
Key: c.sigInfo.d2Key,
|
|
Body: body,
|
|
}
|
|
return seq, req.Encode()
|
|
}
|
|
|
|
//go:noinline
|
|
func (c *QQClient) uniPacket(seq uint16, command string, body []byte) []byte {
|
|
req := codec.Uni{
|
|
Uin: c.Uin,
|
|
Seq: seq,
|
|
CommandName: command,
|
|
EncryptType: 1,
|
|
SessionID: c.OutGoingPacketSessionId,
|
|
ExtraData: EmptyBytes,
|
|
Key: c.sigInfo.d2Key,
|
|
Body: body,
|
|
}
|
|
return req.Encode()
|
|
}
|