数据校验
This commit is contained in:
parent
bf2b99fedf
commit
a4143f24e3
@ -61,19 +61,20 @@ func (this *apiComp) Train(session comm.IUserSession, req *pb.DragonTrainReq) (e
|
||||
}
|
||||
return
|
||||
}
|
||||
if playConf.Cd > 0 {
|
||||
dragon.Play[req.Ttype].Cdendtime = configure.Now().Unix() + int64(playConf.Cd)
|
||||
}
|
||||
// 校验训练次数
|
||||
if dragon.Play[req.Ttype].Count >= playConf.Time {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DragonTrainMaxCount,
|
||||
Title: pb.ErrorCode_DragonTrainMaxCount.ToString(),
|
||||
}
|
||||
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)
|
||||
}
|
||||
// 校验训练次数
|
||||
if dragon.Play[req.Ttype].Count >= playConf.Time {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DragonTrainMaxCount,
|
||||
Title: pb.ErrorCode_DragonTrainMaxCount.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
// 校验消耗
|
||||
if errdata = this.module.CheckRes(session, playConf.Deplete); errdata != nil {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user