添加论坛模块以及用户离线通知
This commit is contained in:
parent
426120cefb
commit
1f3106ce77
42
modules/forum/configure_comp.go
Normal file
42
modules/forum/configure_comp.go
Normal file
@ -0,0 +1,42 @@
|
||||
package forum
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/modules"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
|
||||
"go_dreamfactory/lego/core"
|
||||
)
|
||||
|
||||
const (
|
||||
game_equipment = "game_equipment.json"
|
||||
)
|
||||
|
||||
///背包配置管理组件
|
||||
type Configure_Comp struct {
|
||||
modules.MComp_Configure
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *Configure_Comp) 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_equipment, cfg.NewGame_equipment)
|
||||
return
|
||||
}
|
||||
|
||||
//获取装备配置数据
|
||||
func (this *Configure_Comp) GetEquipmentConfigure() (configure *cfg.Game_equipment, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(game_equipment); err != nil {
|
||||
return
|
||||
} else {
|
||||
if configure, ok = v.(*cfg.Game_equipment); !ok {
|
||||
err = fmt.Errorf("%T no is *cfg.Game_equipment", v)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
Loading…
Reference in New Issue
Block a user