package gateway import ( "go_dreamfactory/modules" cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/lego/core" ) const ( game_msgdistrib = "game_msgdistrib.json" ) ///背包配置管理组件 type configureComp struct { modules.MCompConfigure } // Init 组件初始化接口 func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { this.ModuleCompBase.Init(service, module, comp, options) this.LoadConfigure(game_msgdistrib, cfg.NewGame_msgdistrib) return } // GetMsgDistribute 获取消息分发规则读取配置表 func (this *configureComp) GetMsgDistribute(msgid string) (rule string, ok bool) { var ( err error v interface{} item *cfg.Game_msgdistribData ) if v, err = this.GetConfigure(game_msgdistrib); err != nil { ok = false return } else { if item, ok = v.(*cfg.Game_msgdistrib).GetDataMap()[msgid]; ok { rule = item.Routrules } } return }