diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index 430b8c0d1..b14188b33 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -96,29 +96,20 @@ locp: code, err = this.secAuth(msg) if err == nil { // this.gateway.Debugf("----------2 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) - - // key := msg.MainType + msg.SubType // 加锁 - // if v, ok := this.protoMsg[key]; ok { - // if v != 0 && configure.Now().Unix()-v < 2 { - // // 返回错误码 - // this.protoMsg[key] = configure.Now().Unix() - // data, _ := anypb.New(&pb.NotifyErrorNotifyPush{ - // ReqMainType: msg.MainType, - // ReqSubType: msg.SubType, - // Arg: msg.Data, - // Code: pb.ErrorCode_InsufficientPermissions}) - // err = this.WriteMsg(&pb.UserMessage{ - // MainType: comm.MainTypeNotify, - // SubType: comm.SubTypeErrorNotify, - // Data: data, - // }) - // continue - // } - // } - // this.protoMsg[key] = configure.Now().Unix() - - if err := this.messageDistribution(msg); err != nil { + if err = this.messageDistribution(msg); err != nil { this.gateway.Errorf("messageDistribution err:%v", err) + data, _ := anypb.New(&pb.NotifyErrorNotifyPush{ + ReqMainType: msg.MainType, + ReqSubType: msg.SubType, + Arg: msg.Data, + Code: pb.ErrorCode_GatewayException, + Message: err.Error(), + }) + err = this.WriteMsg(&pb.UserMessage{ + MainType: comm.MainTypeNotify, + SubType: comm.SubTypeErrorNotify, + Data: data, + }) go this.Close() break locp } diff --git a/modules/practice/api_info.go b/modules/practice/api_info.go index 07b560f9b..ca8276ab2 100644 --- a/modules/practice/api_info.go +++ b/modules/practice/api_info.go @@ -26,6 +26,10 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.PracticeInfoReq) (c return } + if room.Npcstate == 0 && room.Currnpc == 0 { + this.module.modelPandata.refreshnpc(room) + } + if room.Npcstate == 3 { //CD中 cd := int32(configure.Now().Sub(time.Unix(room.Refresh, 0)).Seconds()) if cd >= this.module.configure.GetGlobalConf().PandamasChallengeCd {