diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 3312c8014..8855215e9 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -217,6 +217,8 @@ func (this *ModelHero) resetJuexingProperty(hero *pb.DBHero) { hero.JuexProperty[comm.Atk] += int32(value) case comm.Speed: hero.JuexProperty[comm.Speed] += int32(value) + case comm.Cri: + hero.JuexProperty[comm.Cri] += int32(value) case comm.ResonanceHpPro: hero.JuexProperty[comm.Hp] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Hp]))) case comm.ResonanceAtkPro: diff --git a/modules/mline/model_mainline.go b/modules/mline/model_mainline.go index 76d16f916..a20bb637d 100644 --- a/modules/mline/model_mainline.go +++ b/modules/mline/model_mainline.go @@ -67,6 +67,7 @@ func (this *ModelMline) cleanChapter(uId string) (err error) { // 清除数据 func (this *ModelMline) cleanChapterDataById(uId string, ids ...string) (err error) { + this.module.Debugf("cleanChapterDataById:%s,%v", uId, ids) if err = this.DelListlds(uId, ids); err != nil { this.module.Errorf("err:%v", err) return diff --git a/modules/sys/api_getlist.go b/modules/sys/api_getlist.go index a639d3c04..93ff63767 100644 --- a/modules/sys/api_getlist.go +++ b/modules/sys/api_getlist.go @@ -11,49 +11,56 @@ func (this *apiComp) FuncGetListCheck(session comm.IUserSession, req *pb.SysFunc func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetListReq) (errdata *pb.ErrorData) { + var ( + bChange bool + ) rsp := &pb.SysFuncGetListResp{} rsp.Cond = make(map[string]int32, 0) + opencfg, err := this.module.configure.getOpencondCfg() + if err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Message: err.Error(), + } + return + } list, _ := this.module.modelSys.GetOpenCondList(session.GetUserId()) if len(req.Keys) == 0 { - confList := this.module.configure.getOpencondList() - for _, v := range confList { - - id := this.module.modelSys.validCond(session.GetUserId(), v) - if id != "" { - if v.ActivateType == 1 { - if _, ok := list.Cond[id]; ok { - rsp.Cond[id] = 1 - } else { - rsp.Cond[id] = 0 - } - } else { + for _, v := range opencfg.GetDataList() { + if list.Cond[v.Id] == 0 { + id := this.module.modelSys.validCond(session.GetUserId(), v) + if id != "" { rsp.Cond[id] = 1 + list.Cond[id] = 1 //设置激活 + bChange = true } + } else { + rsp.Cond[v.Id] = 1 } } } else { for _, key := range req.Keys { - opencfg, err := this.module.configure.getOpencondCfg() - if err != nil { - continue - } - if conf, ok := opencfg.GetDataMap()[key]; ok { - id := this.module.modelSys.validCond(session.GetUserId(), conf) - if id != "" { - if conf.ActivateType == 1 { - if _, ok := list.Cond[id]; ok { - rsp.Cond[id] = 1 - } else { - rsp.Cond[id] = 0 - } - } else { + if list.Cond[key] == 0 { + if conf, ok := opencfg.GetDataMap()[key]; ok { + id := this.module.modelSys.validCond(session.GetUserId(), conf) + if id != "" { rsp.Cond[id] = 1 + list.Cond[key] = 1 //设置激活 + bChange = true } } + } else { + rsp.Cond[key] = 1 } + } } + if bChange { + this.module.modelSys.ChangeOpenCondData(session.GetUserId(), map[string]interface{}{ + "cond": list.Cond, + }) + } session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp) return } diff --git a/modules/sys/config.go b/modules/sys/config.go index c7956cdfe..086052cbe 100644 --- a/modules/sys/config.go +++ b/modules/sys/config.go @@ -114,7 +114,7 @@ func (this *configureComp) GetOpenCondCfgById(id string) (data *cfg.GameOpencond return } -func (this *configureComp) getOpencondList() (list []*cfg.GameOpencondData) { +func (this *configureComp) getOpencondConf() (list []*cfg.GameOpencondData) { if cfg, err := this.getOpencondCfg(); err == nil { list = cfg.GetDataList() } diff --git a/modules/user/module.go b/modules/user/module.go index 4c22a7451..463c89b25 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -1000,6 +1000,7 @@ func (this *User) recoverUserPs(uid string) { this.Error("玩家体力变化 UserPsChangedPush推送失败", log.Field{Key: "uid", Value: u.Uid}, log.Field{Key: comm.ResPs, Value: changed}, + log.Field{Key: "err", Value: err.Error()}, ) } }