diff --git a/comm/imodule.go b/comm/imodule.go index a94d3e10d..863f6bebc 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -421,6 +421,7 @@ type ( IGourmet interface { ///红点 IGetReddot + GMCreateAltas(uid string) } ILibrary interface { diff --git a/modules/gm/module.go b/modules/gm/module.go index 4e92e4fee..1dc184278 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -562,6 +562,22 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er 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 ", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "0", Value: datas[0]}, diff --git a/modules/gourmet/comp_configure.go b/modules/gourmet/comp_configure.go index b0b2ab66f..af12bf412 100644 --- a/modules/gourmet/comp_configure.go +++ b/modules/gourmet/comp_configure.go @@ -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 +} diff --git a/modules/gourmet/module.go b/modules/gourmet/module.go index c8fca7e6a..85f1965ed 100644 --- a/modules/gourmet/module.go +++ b/modules/gourmet/module.go @@ -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) + } +}