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) +}