数据校验

This commit is contained in:
meixiongfeng 2023-09-14 16:23:47 +08:00
parent bf2b99fedf
commit a4143f24e3

View File

@ -61,6 +61,9 @@ func (this *apiComp) Train(session comm.IUserSession, req *pb.DragonTrainReq) (e
}
return
}
if conf, err := this.module.configure.GetDragonConfById(dragon.Dragonid, dragon.Lv); err == nil {
if playConf, err = this.module.configure.GetDragonPlayConfById(dragon.Dragonid, conf.Type, req.Ttype); err == nil {
if playConf.Cd > 0 {
dragon.Play[req.Ttype].Cdendtime = configure.Now().Unix() + int64(playConf.Cd)
}
@ -72,8 +75,6 @@ func (this *apiComp) Train(session comm.IUserSession, req *pb.DragonTrainReq) (e
}
return
}
if conf, err := this.module.configure.GetDragonConfById(dragon.Dragonid, dragon.Lv); err == nil {
if playConf, err = this.module.configure.GetDragonPlayConfById(dragon.Dragonid, conf.Type, req.Ttype); err == nil {
// 校验消耗
if errdata = this.module.CheckRes(session, playConf.Deplete); errdata != nil {
return