1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00
This commit is contained in:
Mrs4s 2020-07-27 20:27:18 +08:00
parent 14d741fe93
commit 7a99648b00
2 changed files with 8 additions and 0 deletions

View File

@ -103,6 +103,7 @@ func NewClientMd5(uin int64, passwordMd5 [16]byte) *QQClient {
decoders: map[string]func(*QQClient, uint16, []byte) (interface{}, error){ decoders: map[string]func(*QQClient, uint16, []byte) (interface{}, error){
"wtlogin.login": decodeLoginResponse, "wtlogin.login": decodeLoginResponse,
"StatSvc.register": decodeClientRegisterResponse, "StatSvc.register": decodeClientRegisterResponse,
"StatSvc.ReqMSFOffline": decodeMSFOfflinePacket,
"MessageSvc.PushNotify": decodeSvcNotify, "MessageSvc.PushNotify": decodeSvcNotify,
"OnlinePush.PbPushGroupMsg": decodeGroupMessagePacket, "OnlinePush.PbPushGroupMsg": decodeGroupMessagePacket,
"OnlinePush.ReqPush": decodeOnlinePushReqPacket, "OnlinePush.ReqPush": decodeOnlinePushReqPacket,

View File

@ -672,6 +672,13 @@ func decodeForceOfflinePacket(c *QQClient, _ uint16, payload []byte) (interface{
return nil, nil return nil, nil
} }
func decodeMSFOfflinePacket(c *QQClient, _ uint16, _ []byte) (interface{}, error) {
if c.Online {
c.Online = false
c.dispatchDisconnectEvent(&ClientDisconnectedEvent{Message: "服务器端强制下线."})
}
}
func decodeMultiApplyUpResponse(c *QQClient, _ uint16, payload []byte) (interface{}, error) { func decodeMultiApplyUpResponse(c *QQClient, _ uint16, payload []byte) (interface{}, error) {
body := multimsg.MultiRspBody{} body := multimsg.MultiRspBody{}
if err := proto.Unmarshal(payload, &body); err != nil { if err := proto.Unmarshal(payload, &body); err != nil {