版署 gm 增加所有美食图鉴

This commit is contained in:
meixiongfeng 2023-09-01 17:11:24 +08:00
parent fcb8eb923a
commit 8786123466
4 changed files with 54 additions and 0 deletions

View File

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

View File

@ -562,6 +562,22 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
module1.(comm.ISmithy).GmProficiency(session.GetUserId()) module1.(comm.ISmithy).GmProficiency(session.GetUserId())
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 ", this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[0]}, log.Field{Key: "0", Value: datas[0]},

View File

@ -88,3 +88,20 @@ func (this *configureComp) GetNormalGourmetFood() string {
return this.normal 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 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)
}
}