1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

fix lock.

This commit is contained in:
Mrs4s 2021-01-20 22:49:40 +08:00
parent 37b077e610
commit f5ba6391e7

View File

@ -6,6 +6,7 @@ import (
"github.com/Mrs4s/MiraiGo/protocol/packets"
"github.com/golang/protobuf/proto"
"github.com/pkg/errors"
"sync"
"time"
)
@ -196,6 +197,8 @@ func decodePushParamPacket(c *QQClient, _ uint16, payload []byte) (interface{},
return nil, nil
}
var loginNotifyLock sync.Mutex
// StatSvc.SvcReqMSFLoginNotify
func decodeLoginNotifyPacket(c *QQClient, _ uint16, payload []byte) (interface{}, error) {
request := &jce.RequestPacket{}
@ -205,6 +208,8 @@ func decodeLoginNotifyPacket(c *QQClient, _ uint16, payload []byte) (interface{}
reader := jce.NewJceReader(data.Map["SvcReqMSFLoginNotify"]["QQService.SvcReqMSFLoginNotify"][1:])
notify := &jce.SvcReqMSFLoginNotify{}
notify.ReadFrom(reader)
loginNotifyLock.Lock()
defer loginNotifyLock.Unlock()
if notify.Status == 1 {
found := false
for _, oc := range c.OnlineClients {