Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
2e214bf274
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user