From f2f2938780654067307caa52a56fc84157c46814 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 26 Jun 2023 23:00:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=83=B9=E9=A5=AA=E7=9A=84=E8=8F=9C=E5=90=83?= =?UTF-8?q?=E4=BA=86=E5=A2=9E=E5=8A=A0=E7=9A=84=E5=A5=BD=E6=84=9F=E5=BA=A6?= =?UTF-8?q?=20=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 1 + modules/library/api_usegift.go | 3 ++- modules/tools/comp_configure.go | 20 ++++++++++++++++++++ modules/tools/module.go | 4 ++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/comm/imodule.go b/comm/imodule.go index 9bf81cc15..f0e229051 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -487,6 +487,7 @@ type ( GetPriceGroupCost(pricegroupId int32, purchase int32) (res []*cfg.Gameatn, err error) GetPriceGroupLen(pricegroupId int32) (count int32, err error) + GetGrormetLlame(id string) (data int32, err error) } IReputation interface { diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index 669ffecfe..66eedda2a 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -120,13 +120,14 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe if errdata = this.module.CheckRes(session, res); errdata != nil { // 道具不够直接返回 return } + //itemConf, err1 := this.module.ModuleTools.GetGrormetLlame(req.Items) itemConf, err1 := this.module.configure.GetItemConfigureData(req.Items) // 获取食物的 if err1 != nil { this.module.Errorf("赠送菜品配置没找到:%s", req.Items) errdata = &pb.ErrorData{ Code: pb.ErrorCode_ConfigNoFound, Title: pb.ErrorCode_ConfigNoFound.ToString(), - Message: err.Error(), + Message: err1.Error(), } return } diff --git a/modules/tools/comp_configure.go b/modules/tools/comp_configure.go index 65af54ccb..e42e9510e 100644 --- a/modules/tools/comp_configure.go +++ b/modules/tools/comp_configure.go @@ -29,6 +29,8 @@ const ( game_lottery = "game_lottery.json" game_price = "game_pricegroup.json" + + game_food = "game_breakingbad.json" ) ///配置管理基础组件 @@ -66,6 +68,7 @@ func (this *MCompConfigure) Init(service core.IService, module core.IModule, com err = this.LoadConfigure(game_equip, cfg.NewGameEquip) err = this.LoadConfigure(game_item, cfg.NewGameItem) err = this.LoadConfigure(game_vip, cfg.NewGameVip) + err = this.LoadConfigure(game_food, cfg.NewGameBreakingbad) err = this.LoadConfigure(game_lottery, cfg.NewGameLottery) this._dropMap = make(map[int32][]*cfg.GameDropData, 0) this._sign = make(map[int32]*cfg.GameSignData, 0) @@ -610,3 +613,20 @@ func (this *MCompConfigure) GetPriceGroupLen(pricegroupId int32) (count int32, e return } + +func (this *MCompConfigure) GetGrormetLlame(id string) (data int32, err error) { + var ( + v interface{} + ) + if v, err = this.GetConfigure(game_food); err == nil { + if conf, ok := v.(*cfg.GameBreakingbad); ok { + _d := conf.Get(id) + if _d != nil { + data = _d.Flame + return + } + } + } + err = comm.NewNotFoundConfErr("gourmet", game_food, id) + return +} diff --git a/modules/tools/module.go b/modules/tools/module.go index 77a053823..54bb2e9a1 100644 --- a/modules/tools/module.go +++ b/modules/tools/module.go @@ -56,3 +56,7 @@ func (this *Tools) GetPriceGroupCost(pricegroupId int32, purchase int32) (res [] func (this *Tools) GetPriceGroupLen(pricegroupId int32) (count int32, err error) { return this.configure.GetPriceGroupLen(pricegroupId) } + +func (this *Tools) GetGrormetLlame(id string) (data int32, err error) { + return this.configure.GetGrormetLlame(id) +}