上传武馆数据初始化修复

This commit is contained in:
liwei1dao 2023-03-27 14:26:01 +08:00
parent cdb7361b7e
commit c001258929
2 changed files with 17 additions and 22 deletions

View File

@ -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
}

View File

@ -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 {