This commit is contained in:
liwei1dao 2023-09-14 16:38:52 +08:00
commit 2e214bf274
3 changed files with 14 additions and 14 deletions

View File

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

View File

@ -42,7 +42,6 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
configure.RegisterConfigure(dragon_play, cfg.NewGameDragonPlay, this.LoadDragonPlay)
configure.RegisterConfigure(game_buzkashimount, cfg.NewGameBuzkashiMount, this.LoadDragonMount)
this.GetDragonMount("20030001", 3)
return
}

View File

@ -122,9 +122,9 @@ func (this *ModelDragon) CreateDragon(session comm.IUserSession, dragons map[str
continue
}
if dbModel != nil {
err = dbModel.AddList(uid, dragonCfgId, dragon)
err = dbModel.AddList(uid, dragon.Id, dragon)
} else {
err = this.AddList(uid, dragonCfgId, dragon)
err = this.AddList(uid, dragon.Id, dragon)
}
if err != nil {
errdata = &pb.ErrorData{