This commit is contained in:
meixiongfeng 2023-06-30 23:08:31 +08:00
parent 7b809c856d
commit eed5cf07a0
5 changed files with 38 additions and 27 deletions

View File

@ -217,6 +217,8 @@ func (this *ModelHero) resetJuexingProperty(hero *pb.DBHero) {
hero.JuexProperty[comm.Atk] += int32(value) hero.JuexProperty[comm.Atk] += int32(value)
case comm.Speed: case comm.Speed:
hero.JuexProperty[comm.Speed] += int32(value) hero.JuexProperty[comm.Speed] += int32(value)
case comm.Cri:
hero.JuexProperty[comm.Cri] += int32(value)
case comm.ResonanceHpPro: case comm.ResonanceHpPro:
hero.JuexProperty[comm.Hp] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Hp]))) hero.JuexProperty[comm.Hp] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Hp])))
case comm.ResonanceAtkPro: case comm.ResonanceAtkPro:

View File

@ -67,6 +67,7 @@ func (this *ModelMline) cleanChapter(uId string) (err error) {
// 清除数据 // 清除数据
func (this *ModelMline) cleanChapterDataById(uId string, ids ...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 { if err = this.DelListlds(uId, ids); err != nil {
this.module.Errorf("err:%v", err) this.module.Errorf("err:%v", err)
return return

View File

@ -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) { func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetListReq) (errdata *pb.ErrorData) {
var (
bChange bool
)
rsp := &pb.SysFuncGetListResp{} rsp := &pb.SysFuncGetListResp{}
rsp.Cond = make(map[string]int32, 0) 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()) list, _ := this.module.modelSys.GetOpenCondList(session.GetUserId())
if len(req.Keys) == 0 { if len(req.Keys) == 0 {
confList := this.module.configure.getOpencondList() for _, v := range opencfg.GetDataList() {
for _, v := range confList { if list.Cond[v.Id] == 0 {
id := this.module.modelSys.validCond(session.GetUserId(), v) id := this.module.modelSys.validCond(session.GetUserId(), v)
if id != "" { if id != "" {
if v.ActivateType == 1 {
if _, ok := list.Cond[id]; ok {
rsp.Cond[id] = 1 rsp.Cond[id] = 1
} else { list.Cond[id] = 1 //设置激活
rsp.Cond[id] = 0 bChange = true
} }
} else { } else {
rsp.Cond[id] = 1 rsp.Cond[v.Id] = 1
}
} }
} }
} else { } else {
for _, key := range req.Keys { for _, key := range req.Keys {
opencfg, err := this.module.configure.getOpencondCfg() if list.Cond[key] == 0 {
if err != nil {
continue
}
if conf, ok := opencfg.GetDataMap()[key]; ok { if conf, ok := opencfg.GetDataMap()[key]; ok {
id := this.module.modelSys.validCond(session.GetUserId(), conf) id := this.module.modelSys.validCond(session.GetUserId(), conf)
if id != "" { if id != "" {
if conf.ActivateType == 1 {
if _, ok := list.Cond[id]; ok {
rsp.Cond[id] = 1 rsp.Cond[id] = 1
} else { list.Cond[key] = 1 //设置激活
rsp.Cond[id] = 0 bChange = true
}
} }
} else { } else {
rsp.Cond[id] = 1 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) session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp)
return return
} }

View File

@ -114,7 +114,7 @@ func (this *configureComp) GetOpenCondCfgById(id string) (data *cfg.GameOpencond
return return
} }
func (this *configureComp) getOpencondList() (list []*cfg.GameOpencondData) { func (this *configureComp) getOpencondConf() (list []*cfg.GameOpencondData) {
if cfg, err := this.getOpencondCfg(); err == nil { if cfg, err := this.getOpencondCfg(); err == nil {
list = cfg.GetDataList() list = cfg.GetDataList()
} }

View File

@ -1000,6 +1000,7 @@ func (this *User) recoverUserPs(uid string) {
this.Error("玩家体力变化 UserPsChangedPush推送失败", this.Error("玩家体力变化 UserPsChangedPush推送失败",
log.Field{Key: "uid", Value: u.Uid}, log.Field{Key: "uid", Value: u.Uid},
log.Field{Key: comm.ResPs, Value: changed}, log.Field{Key: comm.ResPs, Value: changed},
log.Field{Key: "err", Value: err.Error()},
) )
} }
} }