This commit is contained in:
meixiongfeng 2023-09-01 17:06:44 +08:00
parent 8c759910c8
commit 0d56de59aa
5 changed files with 55 additions and 0 deletions

View File

@ -447,6 +447,7 @@ type (
IGourmet interface {
///红点
IGetReddot
GMCreateAltas(uid string)
}
ILibrary interface {

View File

@ -143,6 +143,7 @@ func (this *apiComp) Train(session comm.IUserSession, req *pb.DragonTrainReq) (e
}
rsp.Reward = atno
}
rsp.Dragons = dragon
this.module.modelDragon.UpdateDragonData(session.GetUserId(), dragon.Id, update)
session.SendMsg(string(this.module.GetType()), "train", rsp)
return

View File

@ -687,6 +687,22 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
module1.(comm.IBuried).CompleteCondition(session.GetUserId(), int32(condiId))
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[0]},
)
} else if len(datas) == 1 && (datas[0] == "groumet") {
var (
err error
)
module1, err := this.service.GetModule(comm.ModuleGourmet)
if err != nil {
return
}
module1.(comm.IGourmet).GMCreateAltas(session.GetUserId())
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[0]},

View File

@ -88,3 +88,20 @@ func (this *configureComp) GetNormalGourmetFood() string {
return this.normal
}
// gm 获取所有
func (this *configureComp) GMGetAllCookBookConf() (sz []string, err error) {
var (
v interface{}
)
if v, err = this.GetConfigure(game_food); err == nil {
if conf, ok := v.(*cfg.GameBreakingbad); ok {
for _, v := range conf.GetDataList() {
sz = append(sz, v.Delicacies)
}
return
}
}
err = comm.NewNotFoundConfErr("gourmet", game_food, "")
return
}

View File

@ -79,3 +79,23 @@ func (this *Gourmet) GetSuccessRate(m map[string]int32, conf *cfg.GameBreakingba
}
return
}
func (this *Gourmet) GMCreateAltas(uid string) {
_gourmet, err := this.modelAtlas.getGourmetAtlasList(uid)
if err != nil {
return
}
sz, err := this.configure.GMGetAllCookBookConf()
if err != nil { // 配置校验
return
}
_gourmet.Atlas = make(map[string]int32)
for _, v := range sz {
_gourmet.Atlas[v] = 1
}
if err := this.modelAtlas.Change(uid, map[string]interface{}{
"atlas": _gourmet.Atlas,
}); err != nil {
this.Errorf("change modelAtlas failed: %v", err)
}
}