mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-06-18 13:35:03 +08:00
client/internal/network: unify IncomingPacket&IncomingPacketInfo
This commit is contained in:
parent
1a7fcd76cf
commit
733944693c
@ -5,7 +5,7 @@ import (
|
||||
"github.com/Mrs4s/MiraiGo/client/pb/msg"
|
||||
)
|
||||
|
||||
var privateMsgDecoders = map[int32]func(*QQClient, *msg.Message, *network.IncomingPacketInfo){
|
||||
var privateMsgDecoders = map[int32]func(*QQClient, *msg.Message, *network.Packet){
|
||||
9: privateMessageDecoder, 10: privateMessageDecoder, 31: privateMessageDecoder,
|
||||
79: privateMessageDecoder, 97: privateMessageDecoder, 120: privateMessageDecoder,
|
||||
132: privateMessageDecoder, 133: privateMessageDecoder, 166: privateMessageDecoder,
|
||||
@ -13,21 +13,21 @@ var privateMsgDecoders = map[int32]func(*QQClient, *msg.Message, *network.Incomi
|
||||
208: privatePttDecoder,
|
||||
}
|
||||
|
||||
var nonSvcNotifyTroopSystemMsgDecoders = map[int32]func(*QQClient, *msg.Message, *network.IncomingPacketInfo){
|
||||
var nonSvcNotifyTroopSystemMsgDecoders = map[int32]func(*QQClient, *msg.Message, *network.Packet){
|
||||
36: troopSystemMessageDecoder, 85: troopSystemMessageDecoder,
|
||||
}
|
||||
|
||||
var troopSystemMsgDecoders = map[int32]func(*QQClient, *msg.Message, *network.IncomingPacketInfo){
|
||||
var troopSystemMsgDecoders = map[int32]func(*QQClient, *msg.Message, *network.Packet){
|
||||
35: troopSystemMessageDecoder, 37: troopSystemMessageDecoder,
|
||||
45: troopSystemMessageDecoder, 46: troopSystemMessageDecoder, 84: troopSystemMessageDecoder,
|
||||
86: troopSystemMessageDecoder, 87: troopSystemMessageDecoder,
|
||||
} // IsSvcNotify
|
||||
|
||||
var sysMsgDecoders = map[int32]func(*QQClient, *msg.Message, *network.IncomingPacketInfo){
|
||||
var sysMsgDecoders = map[int32]func(*QQClient, *msg.Message, *network.Packet){
|
||||
187: systemMessageDecoder, 188: systemMessageDecoder, 189: systemMessageDecoder,
|
||||
190: systemMessageDecoder, 191: systemMessageDecoder,
|
||||
} // IsSvcNotify
|
||||
|
||||
var otherDecoders = map[int32]func(*QQClient, *msg.Message, *network.IncomingPacketInfo){
|
||||
var otherDecoders = map[int32]func(*QQClient, *msg.Message, *network.Packet){
|
||||
33: troopAddMemberBroadcastDecoder, 529: msgType0x211Decoder,
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ const (
|
||||
AddressBookSource // 来自通讯录
|
||||
)
|
||||
|
||||
func (c *QQClient) c2cMessageSyncProcessor(rsp *msg.GetMessageResponse, info *network.IncomingPacketInfo) {
|
||||
func (c *QQClient) c2cMessageSyncProcessor(rsp *msg.GetMessageResponse, info *network.Packet) {
|
||||
c.sig.SyncCookie = rsp.SyncCookie
|
||||
c.sig.PubAccountCookie = rsp.PubAccountCookie
|
||||
// c.msgCtrlBuf = rsp.MsgCtrlBuf
|
||||
@ -77,7 +77,7 @@ func (c *QQClient) c2cMessageSyncProcessor(rsp *msg.GetMessageResponse, info *ne
|
||||
}
|
||||
}
|
||||
|
||||
func (c *QQClient) commMsgProcessor(pMsg *msg.Message, info *network.IncomingPacketInfo) {
|
||||
func (c *QQClient) commMsgProcessor(pMsg *msg.Message, info *network.Packet) {
|
||||
strKey := fmt.Sprintf("%d%d%d%d", pMsg.Head.FromUin.Unwrap(), pMsg.Head.ToUin.Unwrap(), pMsg.Head.MsgSeq.Unwrap(), pMsg.Head.MsgUid.Unwrap())
|
||||
if _, ok := c.msgSvcCache.GetAndUpdate(strKey, time.Hour); ok {
|
||||
c.debug("c2c msg %v already exists in cache. skip.", pMsg.Head.MsgUid.Unwrap())
|
||||
@ -99,7 +99,7 @@ func (c *QQClient) commMsgProcessor(pMsg *msg.Message, info *network.IncomingPac
|
||||
}
|
||||
}
|
||||
|
||||
func privateMessageDecoder(c *QQClient, pMsg *msg.Message, _ *network.IncomingPacketInfo) {
|
||||
func privateMessageDecoder(c *QQClient, pMsg *msg.Message, _ *network.Packet) {
|
||||
switch pMsg.Head.C2CCmd.Unwrap() {
|
||||
case 11, 175: // friend msg
|
||||
if pMsg.Head.FromUin.Unwrap() == c.Uin {
|
||||
@ -141,7 +141,7 @@ func privateMessageDecoder(c *QQClient, pMsg *msg.Message, _ *network.IncomingPa
|
||||
}
|
||||
}
|
||||
|
||||
func privatePttDecoder(c *QQClient, pMsg *msg.Message, _ *network.IncomingPacketInfo) {
|
||||
func privatePttDecoder(c *QQClient, pMsg *msg.Message, _ *network.Packet) {
|
||||
if pMsg.Body == nil || pMsg.Body.RichText == nil || pMsg.Body.RichText.Ptt == nil {
|
||||
return
|
||||
}
|
||||
@ -152,7 +152,7 @@ func privatePttDecoder(c *QQClient, pMsg *msg.Message, _ *network.IncomingPacket
|
||||
c.PrivateMessageEvent.dispatch(c, c.parsePrivateMessage(pMsg))
|
||||
}
|
||||
|
||||
func tempSessionDecoder(c *QQClient, pMsg *msg.Message, _ *network.IncomingPacketInfo) {
|
||||
func tempSessionDecoder(c *QQClient, pMsg *msg.Message, _ *network.Packet) {
|
||||
if pMsg.Head.C2CTmpMsgHead == nil || pMsg.Body == nil {
|
||||
return
|
||||
}
|
||||
@ -213,7 +213,7 @@ func tempSessionDecoder(c *QQClient, pMsg *msg.Message, _ *network.IncomingPacke
|
||||
}
|
||||
}
|
||||
|
||||
func troopAddMemberBroadcastDecoder(c *QQClient, pMsg *msg.Message, _ *network.IncomingPacketInfo) {
|
||||
func troopAddMemberBroadcastDecoder(c *QQClient, pMsg *msg.Message, _ *network.Packet) {
|
||||
groupJoinLock.Lock()
|
||||
defer groupJoinLock.Unlock()
|
||||
group := c.FindGroupByUin(pMsg.Head.FromUin.Unwrap())
|
||||
@ -240,12 +240,12 @@ func troopAddMemberBroadcastDecoder(c *QQClient, pMsg *msg.Message, _ *network.I
|
||||
}
|
||||
}
|
||||
|
||||
func systemMessageDecoder(c *QQClient, _ *msg.Message, _ *network.IncomingPacketInfo) {
|
||||
func systemMessageDecoder(c *QQClient, _ *msg.Message, _ *network.Packet) {
|
||||
_, pkt := c.buildSystemMsgNewFriendPacket()
|
||||
_ = c.sendPacket(pkt)
|
||||
}
|
||||
|
||||
func troopSystemMessageDecoder(c *QQClient, pMsg *msg.Message, info *network.IncomingPacketInfo) {
|
||||
func troopSystemMessageDecoder(c *QQClient, pMsg *msg.Message, info *network.Packet) {
|
||||
if !info.Params.Bool("used_reg_proxy") && pMsg.Head.MsgType.Unwrap() != 85 && pMsg.Head.MsgType.Unwrap() != 36 {
|
||||
c.exceptAndDispatchGroupSysMsg()
|
||||
}
|
||||
@ -260,7 +260,7 @@ func troopSystemMessageDecoder(c *QQClient, pMsg *msg.Message, info *network.Inc
|
||||
}
|
||||
}
|
||||
|
||||
func msgType0x211Decoder(c *QQClient, pMsg *msg.Message, info *network.IncomingPacketInfo) {
|
||||
func msgType0x211Decoder(c *QQClient, pMsg *msg.Message, info *network.Packet) {
|
||||
if pMsg.Head.C2CCmd.Unwrap() == 6 || pMsg.Head.C2CTmpMsgHead != nil {
|
||||
tempSessionDecoder(c, pMsg, info)
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ const (
|
||||
troopSystemMsgDecoders
|
||||
)
|
||||
|
||||
func peekC2CDecoder(msgType int32) (decoder func(*QQClient, *msg.Message, *network.IncomingPacketInfo), decoderType uint8) {
|
||||
func peekC2CDecoder(msgType int32) (decoder func(*QQClient, *msg.Message, *network.Packet), decoderType uint8) {
|
||||
switch msgType {
|
||||
case 9:
|
||||
return privateMessageDecoder, privateMsgDecoders
|
||||
|
@ -147,7 +147,7 @@ func (h *handlerInfo) getParams() network.RequestParams {
|
||||
return h.params
|
||||
}
|
||||
|
||||
var decoders = map[string]func(*QQClient, *network.IncomingPacketInfo, []byte) (any, error){
|
||||
var decoders = map[string]func(*QQClient, *network.Packet, []byte) (any, error){
|
||||
"wtlogin.login": decodeLoginResponse,
|
||||
"wtlogin.exchange_emp": decodeExchangeEmpResponse,
|
||||
"wtlogin.trans_emp": decodeTransEmpResponse,
|
||||
|
@ -33,7 +33,7 @@ var (
|
||||
)
|
||||
|
||||
// wtlogin.login
|
||||
func decodeLoginResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeLoginResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
reader := binary.NewReader(payload)
|
||||
reader.ReadUInt16() // sub command
|
||||
t := reader.ReadByte()
|
||||
@ -188,7 +188,7 @@ func decodeLoginResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []b
|
||||
}
|
||||
|
||||
// StatSvc.register
|
||||
func decodeClientRegisterResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeClientRegisterResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion2{}
|
||||
@ -205,7 +205,7 @@ func decodeClientRegisterResponse(c *QQClient, _ *network.IncomingPacketInfo, pa
|
||||
}
|
||||
|
||||
// wtlogin.exchange_emp
|
||||
func decodeExchangeEmpResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeExchangeEmpResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
reader := binary.NewReader(payload)
|
||||
cmd := reader.ReadUInt16()
|
||||
t := reader.ReadByte()
|
||||
@ -228,7 +228,7 @@ func decodeExchangeEmpResponse(c *QQClient, _ *network.IncomingPacketInfo, paylo
|
||||
}
|
||||
|
||||
// wtlogin.trans_emp
|
||||
func decodeTransEmpResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeTransEmpResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
if len(payload) < 48 {
|
||||
return nil, errors.New("missing payload length")
|
||||
}
|
||||
@ -317,7 +317,7 @@ func decodeTransEmpResponse(c *QQClient, _ *network.IncomingPacketInfo, payload
|
||||
}
|
||||
|
||||
// ConfigPushSvc.PushReq
|
||||
func decodePushReqPacket(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodePushReqPacket(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion2{}
|
||||
@ -390,7 +390,7 @@ func decodePushReqPacket(c *QQClient, _ *network.IncomingPacketInfo, payload []b
|
||||
}
|
||||
|
||||
// MessageSvc.PbGetMsg
|
||||
func decodeMessageSvcPacket(c *QQClient, info *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeMessageSvcPacket(c *QQClient, info *network.Packet, payload []byte) (any, error) {
|
||||
rsp := msg.GetMessageResponse{}
|
||||
err := proto.Unmarshal(payload, &rsp)
|
||||
if err != nil {
|
||||
@ -401,7 +401,7 @@ func decodeMessageSvcPacket(c *QQClient, info *network.IncomingPacketInfo, paylo
|
||||
}
|
||||
|
||||
// MessageSvc.PushNotify
|
||||
func decodeSvcNotify(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeSvcNotify(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload[4:]))
|
||||
data := &jce.RequestDataVersion2{}
|
||||
@ -428,7 +428,7 @@ func decodeSvcNotify(c *QQClient, _ *network.IncomingPacketInfo, payload []byte)
|
||||
}
|
||||
|
||||
// SummaryCard.ReqSummaryCard
|
||||
func decodeSummaryCardResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeSummaryCardResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion2{}
|
||||
@ -494,7 +494,7 @@ func decodeSummaryCardResponse(_ *QQClient, _ *network.IncomingPacketInfo, paylo
|
||||
}
|
||||
|
||||
// friendlist.getFriendGroupList
|
||||
func decodeFriendGroupListResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeFriendGroupListResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion3{}
|
||||
@ -519,7 +519,7 @@ func decodeFriendGroupListResponse(_ *QQClient, _ *network.IncomingPacketInfo, p
|
||||
}
|
||||
|
||||
// friendlist.delFriend
|
||||
func decodeFriendDeleteResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeFriendDeleteResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion3{}
|
||||
@ -532,7 +532,7 @@ func decodeFriendDeleteResponse(_ *QQClient, _ *network.IncomingPacketInfo, payl
|
||||
}
|
||||
|
||||
// friendlist.GetTroopListReqV2
|
||||
func decodeGroupListResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGroupListResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion3{}
|
||||
@ -563,7 +563,7 @@ func decodeGroupListResponse(c *QQClient, _ *network.IncomingPacketInfo, payload
|
||||
}
|
||||
|
||||
// friendlist.GetTroopMemberListReq
|
||||
func decodeGroupMemberListResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGroupMemberListResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion3{}
|
||||
@ -597,7 +597,7 @@ func decodeGroupMemberListResponse(_ *QQClient, _ *network.IncomingPacketInfo, p
|
||||
}
|
||||
|
||||
// group_member_card.get_group_member_card_info
|
||||
func decodeGroupMemberInfoResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGroupMemberInfoResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := pb.GroupMemberRspBody{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
@ -628,7 +628,7 @@ func decodeGroupMemberInfoResponse(c *QQClient, _ *network.IncomingPacketInfo, p
|
||||
}
|
||||
|
||||
// LongConn.OffPicUp
|
||||
func decodeOffPicUpResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeOffPicUpResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := cmd0x352.RspBody{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
@ -666,7 +666,7 @@ func decodeOffPicUpResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload
|
||||
}
|
||||
|
||||
// OnlinePush.PbPushTransMsg
|
||||
func decodeOnlinePushTransPacket(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeOnlinePushTransPacket(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
info := msg.TransMsgInfo{}
|
||||
err := proto.Unmarshal(payload, &info)
|
||||
if err != nil {
|
||||
@ -767,7 +767,7 @@ func decodeOnlinePushTransPacket(c *QQClient, _ *network.IncomingPacketInfo, pay
|
||||
}
|
||||
|
||||
// ProfileService.Pb.ReqSystemMsgNew.Friend
|
||||
func decodeSystemMsgFriendPacket(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeSystemMsgFriendPacket(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := structmsg.RspSystemMsgNew{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
@ -789,7 +789,7 @@ func decodeSystemMsgFriendPacket(c *QQClient, _ *network.IncomingPacketInfo, pay
|
||||
}
|
||||
|
||||
// MessageSvc.PushForceOffline
|
||||
func decodeForceOfflinePacket(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeForceOfflinePacket(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion2{}
|
||||
@ -802,7 +802,7 @@ func decodeForceOfflinePacket(c *QQClient, _ *network.IncomingPacketInfo, payloa
|
||||
}
|
||||
|
||||
// StatSvc.ReqMSFOffline
|
||||
func decodeMSFOfflinePacket(c *QQClient, _ *network.IncomingPacketInfo, _ []byte) (any, error) {
|
||||
func decodeMSFOfflinePacket(c *QQClient, _ *network.Packet, _ []byte) (any, error) {
|
||||
// c.lastLostMsg = "服务器端强制下线."
|
||||
c.Disconnect()
|
||||
// 这个decoder不能消耗太多时间, event另起线程处理
|
||||
@ -811,7 +811,7 @@ func decodeMSFOfflinePacket(c *QQClient, _ *network.IncomingPacketInfo, _ []byte
|
||||
}
|
||||
|
||||
// OidbSvc.0xd79
|
||||
func decodeWordSegmentation(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeWordSegmentation(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := oidb.D79RspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
@ -823,7 +823,7 @@ func decodeWordSegmentation(_ *QQClient, _ *network.IncomingPacketInfo, payload
|
||||
return nil, errors.New("no word received")
|
||||
}
|
||||
|
||||
func decodeSidExpiredPacket(c *QQClient, i *network.IncomingPacketInfo, _ []byte) (any, error) {
|
||||
func decodeSidExpiredPacket(c *QQClient, i *network.Packet, _ []byte) (any, error) {
|
||||
/*
|
||||
_, err := c.sendAndWait(c.buildRequestChangeSigPacket(true))
|
||||
if err != nil {
|
||||
@ -855,6 +855,6 @@ func decodeAppInfoResponse(_ *QQClient, _ *incomingPacketInfo, payload []byte) (
|
||||
}
|
||||
*/
|
||||
|
||||
func ignoreDecoder(_ *QQClient, _ *network.IncomingPacketInfo, _ []byte) (any, error) {
|
||||
func ignoreDecoder(_ *QQClient, _ *network.Packet, _ []byte) (any, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ func (c *QQClient) buildFaceroamRequestPacket() (uint16, []byte) {
|
||||
return c.uniPacket("Faceroam.OpReq", payload)
|
||||
}
|
||||
|
||||
func decodeFaceroamResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeFaceroamResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := faceroam.FaceroamRspBody{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
|
@ -334,7 +334,7 @@ func (c *QQClient) buildGroupFileDeleteReqPacket(groupCode int64, parentFolderId
|
||||
return c.uniPacket("OidbSvc.0x6d6_3", payload)
|
||||
}
|
||||
|
||||
func decodeOIDB6d81Response(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeOIDB6d81Response(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := oidb.D6D8RspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
@ -344,7 +344,7 @@ func decodeOIDB6d81Response(_ *QQClient, _ *network.IncomingPacketInfo, payload
|
||||
}
|
||||
|
||||
// OidbSvc.0x6d6_2
|
||||
func decodeOIDB6d62Response(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeOIDB6d62Response(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := oidb.D6D6RspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
@ -358,7 +358,7 @@ func decodeOIDB6d62Response(_ *QQClient, _ *network.IncomingPacketInfo, payload
|
||||
return fmt.Sprintf("http://%s/ftn_handler/%s/", ip, url), nil
|
||||
}
|
||||
|
||||
func decodeOIDB6d63Response(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeOIDB6d63Response(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := oidb.D6D6RspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
@ -367,7 +367,7 @@ func decodeOIDB6d63Response(_ *QQClient, _ *network.IncomingPacketInfo, payload
|
||||
return rsp.DeleteFileRsp.ClientWording.Unwrap(), nil
|
||||
}
|
||||
|
||||
func decodeOIDB6d60Response(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeOIDB6d60Response(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := oidb.D6D6RspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
@ -385,7 +385,7 @@ func decodeOIDB6d60Response(_ *QQClient, _ *network.IncomingPacketInfo, payload
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func decodeOIDB6d7Response(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeOIDB6d7Response(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := oidb.D6D7RspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
|
@ -181,7 +181,7 @@ func (c *QQClient) buildGroupSearchPacket(keyword string) (uint16, []byte) {
|
||||
}
|
||||
|
||||
// SummaryCard.ReqSearch
|
||||
func decodeGroupSearchResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGroupSearchResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion2{}
|
||||
@ -219,7 +219,7 @@ func decodeGroupSearchResponse(_ *QQClient, _ *network.IncomingPacketInfo, paylo
|
||||
}
|
||||
|
||||
// OidbSvc.0x88d_0
|
||||
func decodeGroupInfoResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGroupInfoResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := oidb.D88DRspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
|
@ -222,7 +222,7 @@ func (c *QQClient) buildAtAllRemainRequestPacket(groupCode int64) (uint16, []byt
|
||||
}
|
||||
|
||||
// OnlinePush.PbPushGroupMsg
|
||||
func decodeGroupMessagePacket(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGroupMessagePacket(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
pkt := msg.PushMessagePacket{}
|
||||
err := proto.Unmarshal(payload, &pkt)
|
||||
if err != nil {
|
||||
@ -257,7 +257,7 @@ func decodeGroupMessagePacket(c *QQClient, _ *network.IncomingPacketInfo, payloa
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func decodeMsgSendResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeMsgSendResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := msg.SendMessageResponse{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
@ -274,7 +274,7 @@ func decodeMsgSendResponse(c *QQClient, _ *network.IncomingPacketInfo, payload [
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func decodeGetGroupMsgResponse(c *QQClient, info *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGetGroupMsgResponse(c *QQClient, info *network.Packet, payload []byte) (any, error) {
|
||||
rsp := msg.GetGroupMsgResp{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
@ -323,7 +323,7 @@ func decodeGetGroupMsgResponse(c *QQClient, info *network.IncomingPacketInfo, pa
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func decodeAtAllRemainResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeAtAllRemainResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := oidb.D8A7RspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
@ -548,7 +548,7 @@ func (c *QQClient) buildEssenceMsgOperatePacket(groupCode int64, msgSeq, msgRand
|
||||
}
|
||||
|
||||
// OidbSvc.0xeac_1/2
|
||||
func decodeEssenceMsgResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeEssenceMsgResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := &oidb.EACRspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
|
@ -740,7 +740,7 @@ func (c *QQClient) buildSyncChannelFirstViewPacket() (uint16, []byte) {
|
||||
return c.uniPacket("trpc.group_pro.synclogic.SyncLogic.SyncFirstView", payload)
|
||||
}
|
||||
|
||||
func decodeGuildPushFirstView(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGuildPushFirstView(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
firstViewMsg := new(channel.FirstViewMsg)
|
||||
if err := proto.Unmarshal(payload, firstViewMsg); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
|
@ -27,7 +27,7 @@ type tipsPushInfo struct {
|
||||
ChannelId uint64
|
||||
}
|
||||
|
||||
func decodeGuildEventFlowPacket(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGuildEventFlowPacket(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
push := new(channel.MsgOnlinePush)
|
||||
if err := proto.Unmarshal(payload, push); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
|
@ -230,7 +230,7 @@ func decodeGuildMessageEmojiReactions(content *channel.ChannelMsgContent) (r []*
|
||||
return
|
||||
}
|
||||
|
||||
func decodeGuildImageStoreResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGuildImageStoreResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
body := new(cmd0x388.D388RspBody)
|
||||
if err := proto.Unmarshal(payload, body); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
|
@ -345,7 +345,7 @@ func (c *QQClient) buildImageOcrRequestPacket(url, md5 string, size, weight, hei
|
||||
}
|
||||
|
||||
// ImgStore.GroupPicUp
|
||||
func decodeGroupImageStoreResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGroupImageStoreResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
pkt := cmd0x388.D388RspBody{}
|
||||
err := proto.Unmarshal(payload, &pkt)
|
||||
if err != nil {
|
||||
@ -372,7 +372,7 @@ func decodeGroupImageStoreResponse(_ *QQClient, _ *network.IncomingPacketInfo, p
|
||||
}, nil
|
||||
}
|
||||
|
||||
func decodeGroupImageDownloadResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGroupImageDownloadResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
pkt := cmd0x388.D388RspBody{}
|
||||
if err := proto.Unmarshal(payload, &pkt); err != nil {
|
||||
return nil, errors.Wrap(err, "unmarshal protobuf message error")
|
||||
@ -387,7 +387,7 @@ func decodeGroupImageDownloadResponse(_ *QQClient, _ *network.IncomingPacketInfo
|
||||
}
|
||||
|
||||
// OidbSvc.0xe07_0
|
||||
func decodeImageOcrResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeImageOcrResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := oidb.DE07RspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
|
@ -1,16 +1,9 @@
|
||||
package network
|
||||
|
||||
type IncomingPacket struct {
|
||||
type Packet struct {
|
||||
SequenceId uint16
|
||||
Flag2 byte
|
||||
CommandName string
|
||||
SessionId []byte
|
||||
Payload []byte
|
||||
}
|
||||
|
||||
type IncomingPacketInfo struct {
|
||||
CommandName string
|
||||
SequenceId uint16
|
||||
Params RequestParams
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ func (c *QQClient) buildMultiApplyUpPacket(data, hash []byte, buType int32, grou
|
||||
}
|
||||
|
||||
// MultiMsg.ApplyUp
|
||||
func decodeMultiApplyUpResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeMultiApplyUpResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
body := multimsg.MultiRspBody{}
|
||||
if err := proto.Unmarshal(payload, &body); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
@ -91,7 +91,7 @@ func (c *QQClient) buildMultiApplyDownPacket(resID string) (uint16, []byte) {
|
||||
}
|
||||
|
||||
// MultiMsg.ApplyDown
|
||||
func decodeMultiApplyDownResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeMultiApplyDownResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
body := multimsg.MultiRspBody{}
|
||||
if err := proto.Unmarshal(payload, &body); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
|
@ -323,12 +323,12 @@ func (c *QQClient) netLoop() {
|
||||
errCount = 0
|
||||
c.debug("rev pkt: %v seq: %v", resp.CommandName, resp.SequenceID)
|
||||
c.stat.PacketReceived.Add(1)
|
||||
pkt := &network.IncomingPacket{
|
||||
pkt := &network.Packet{
|
||||
SequenceId: uint16(resp.SequenceID),
|
||||
CommandName: resp.CommandName,
|
||||
Payload: resp.Body,
|
||||
}
|
||||
go func(pkt *network.IncomingPacket) {
|
||||
go func(pkt *network.Packet) {
|
||||
defer func() {
|
||||
if pan := recover(); pan != nil {
|
||||
c.error("panic on decoder %v : %v\n%s", pkt.CommandName, pan, debug.Stack())
|
||||
@ -342,11 +342,8 @@ func (c *QQClient) netLoop() {
|
||||
var decoded any
|
||||
decoded = pkt.Payload
|
||||
if info == nil || !info.dynamic {
|
||||
decoded, err = decoder(c, &network.IncomingPacketInfo{
|
||||
SequenceId: pkt.SequenceId,
|
||||
CommandName: pkt.CommandName,
|
||||
Params: info.getParams(),
|
||||
}, pkt.Payload)
|
||||
pkt.Params = info.getParams()
|
||||
decoded, err = decoder(c, pkt, pkt.Payload)
|
||||
if err != nil {
|
||||
c.debug("decode pkt %v error: %+v", pkt.CommandName, err)
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ func (c *QQClient) buildOfflineFileDownloadRequestPacket(uuid []byte) (uint16, [
|
||||
return seq, packet
|
||||
}
|
||||
|
||||
func decodeOfflineFileDownloadResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeOfflineFileDownloadResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := cmd0x346.C346RspBody{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
c.error("unmarshal cmd0x346 rsp body error: %v", err)
|
||||
|
@ -23,7 +23,7 @@ var msg0x210Decoders = map[int64]func(*QQClient, []byte) error{
|
||||
}
|
||||
|
||||
// OnlinePush.ReqPush
|
||||
func decodeOnlinePushReqPacket(c *QQClient, info *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeOnlinePushReqPacket(c *QQClient, info *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion2{}
|
||||
|
@ -326,7 +326,7 @@ func (c *QQClient) buildC2CPttStoreBDHExt(target int64, md5 []byte, size, voiceL
|
||||
}
|
||||
|
||||
// PttCenterSvr.ShortVideoDownReq
|
||||
func decodePttShortVideoDownResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodePttShortVideoDownResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := pttcenter.ShortVideoRspBody{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
@ -338,7 +338,7 @@ func decodePttShortVideoDownResponse(_ *QQClient, _ *network.IncomingPacketInfo,
|
||||
}
|
||||
|
||||
// PttCenterSvr.GroupShortVideoUpReq
|
||||
func decodeGroupShortVideoUploadResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeGroupShortVideoUploadResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := pttcenter.ShortVideoRspBody{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
|
@ -155,7 +155,7 @@ func (c *QQClient) bigDataRequest(subCmd uint32, req proto.Message) ([]byte, err
|
||||
return tea.Decrypt(payload), nil
|
||||
}
|
||||
|
||||
func decodeLoginExtraResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeLoginExtraResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := cmd0x3f6.C3F6RspBody{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
@ -171,7 +171,7 @@ func decodeLoginExtraResponse(c *QQClient, _ *network.IncomingPacketInfo, payloa
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func decodeConnKeyResponse(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeConnKeyResponse(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := cmd0x6ff.C501RspBody{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
|
@ -92,7 +92,7 @@ func (c *QQClient) buildPrivateRecallPacket(uin, ts int64, msgSeq, random int32)
|
||||
return c.uniPacket("PbMessageSvc.PbMsgWithDraw", payload)
|
||||
}
|
||||
|
||||
func decodeMsgWithDrawResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeMsgWithDrawResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := msg.MsgWithDrawResp{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
|
@ -48,7 +48,7 @@ func (c *QQClient) buildUrlCheckRequest(url string) (uint16, []byte) {
|
||||
return c.uniPacket("OidbSvc.0xbcb_0", payload)
|
||||
}
|
||||
|
||||
func decodeUrlCheckResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeUrlCheckResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := oidb.DBCBRspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
|
@ -281,7 +281,7 @@ func (c *QQClient) buildPrivateMsgReadedPacket(uin, time int64) (uint16, []byte)
|
||||
}
|
||||
|
||||
// StatSvc.GetDevLoginInfo
|
||||
func decodeDevListResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeDevListResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion2{}
|
||||
@ -303,7 +303,7 @@ func decodeDevListResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload [
|
||||
}
|
||||
|
||||
// RegPrxySvc.PushParam
|
||||
func decodePushParamPacket(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodePushParamPacket(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion2{}
|
||||
@ -344,7 +344,7 @@ func decodePushParamPacket(c *QQClient, _ *network.IncomingPacketInfo, payload [
|
||||
}
|
||||
|
||||
// RegPrxySvc.PbSyncMsg
|
||||
func decodeMsgSyncResponse(c *QQClient, info *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeMsgSyncResponse(c *QQClient, info *network.Packet, payload []byte) (any, error) {
|
||||
rsp := &msf.SvcRegisterProxyMsgResp{}
|
||||
if err := proto.Unmarshal(payload, rsp); err != nil {
|
||||
return nil, err
|
||||
@ -388,7 +388,7 @@ func decodeMsgSyncResponse(c *QQClient, info *network.IncomingPacketInfo, payloa
|
||||
}
|
||||
|
||||
// OnlinePush.PbC2CMsgSync
|
||||
func decodeC2CSyncPacket(c *QQClient, info *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeC2CSyncPacket(c *QQClient, info *network.Packet, payload []byte) (any, error) {
|
||||
m := msg.PbPushMsg{}
|
||||
if err := proto.Unmarshal(payload, &m); err != nil {
|
||||
return nil, err
|
||||
@ -398,7 +398,7 @@ func decodeC2CSyncPacket(c *QQClient, info *network.IncomingPacketInfo, payload
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func decodeMsgReadedResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeMsgReadedResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := msg.PbMsgReadedReportResp{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
|
||||
@ -412,7 +412,7 @@ func decodeMsgReadedResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload
|
||||
var loginNotifyLock sync.Mutex
|
||||
|
||||
// StatSvc.SvcReqMSFLoginNotify
|
||||
func decodeLoginNotifyPacket(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeLoginNotifyPacket(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
request := &jce.RequestPacket{}
|
||||
request.ReadFrom(jce.NewJceReader(payload))
|
||||
data := &jce.RequestDataVersion2{}
|
||||
|
@ -190,7 +190,7 @@ func (c *QQClient) buildSystemMsgFriendActionPacket(reqID, requester int64, acce
|
||||
}
|
||||
|
||||
// ProfileService.Pb.ReqSystemMsgNew.Group
|
||||
func decodeSystemMsgGroupPacket(c *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeSystemMsgGroupPacket(c *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := structmsg.RspSystemMsgNew{}
|
||||
if err := proto.Unmarshal(payload, &rsp); err != nil {
|
||||
return nil, err
|
||||
|
@ -34,7 +34,7 @@ func (c *QQClient) Translate(src, dst, text string) (string, error) {
|
||||
}
|
||||
|
||||
// OidbSvc.0x990
|
||||
func decodeTranslateResponse(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodeTranslateResponse(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
rsp := oidb.TranslateRspBody{}
|
||||
err := unpackOIDBPackage(payload, &rsp)
|
||||
if err != nil {
|
||||
|
@ -220,7 +220,7 @@ func (c *QQClient) buildPrivateFileUploadReqPacket(target message.Source, file *
|
||||
}
|
||||
|
||||
// OfflineFilleHandleSvr.pb_ftn_CMD_REQ_APPLY_UPLOAD_V3-1700
|
||||
func decodePrivateFileUploadReq(_ *QQClient, _ *network.IncomingPacketInfo, payload []byte) (any, error) {
|
||||
func decodePrivateFileUploadReq(_ *QQClient, _ *network.Packet, payload []byte) (any, error) {
|
||||
var rsp cmd0x346.C346RspBody
|
||||
err := proto.Unmarshal(payload, &rsp)
|
||||
if err != nil {
|
||||
|
@ -27,7 +27,7 @@ const (
|
||||
{{end}}
|
||||
)
|
||||
|
||||
func peekC2CDecoder(msgType int32) (decoder func(*QQClient, *msg.Message, *network.IncomingPacketInfo), decoderType uint8) {
|
||||
func peekC2CDecoder(msgType int32) (decoder func(*QQClient, *msg.Message, *network.Packet), decoderType uint8) {
|
||||
switch msgType {
|
||||
{{range .Decoders}} case {{.Id}}:
|
||||
return {{.Func}}, {{.DecoderType}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user