模块注册
This commit is contained in:
parent
d581c883d8
commit
6ff124663d
@ -6,12 +6,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.HeroListReq) (errdata *pb.ErrorData) {
|
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.DragonGetListReq) (errdata *pb.ErrorData) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *apiComp) List(session comm.IUserSession, req *pb.HeroListReq) (errdata *pb.ErrorData) {
|
func (this *apiComp) List(session comm.IUserSession, req *pb.DragonGetListReq) (errdata *pb.ErrorData) {
|
||||||
rsp := &pb.HeroListResp{}
|
rsp := &pb.DragonGetListResp{}
|
||||||
|
|
||||||
session.SendMsg(string(this.module.GetType()), "", rsp)
|
session.SendMsg(string(this.module.GetType()), "", rsp)
|
||||||
return
|
return
|
||||||
|
@ -43,6 +43,7 @@ func (this *configureComp) LoadDragon() {
|
|||||||
if v, err := this.GetConfigure(dragon_trainlv); err == nil {
|
if v, err := this.GetConfigure(dragon_trainlv); err == nil {
|
||||||
this.hlock.Lock()
|
this.hlock.Lock()
|
||||||
defer this.hlock.Unlock()
|
defer this.hlock.Unlock()
|
||||||
|
this.dragon = make(map[string]*cfg.GameTrainlvData)
|
||||||
if _configure, ok := v.(*cfg.GameTrainlv); ok {
|
if _configure, ok := v.(*cfg.GameTrainlv); ok {
|
||||||
for _, v := range _configure.GetDataList() {
|
for _, v := range _configure.GetDataList() {
|
||||||
this.dragon[v.Id+"-"+strconv.Itoa(int(v.Lv))] = v
|
this.dragon[v.Id+"-"+strconv.Itoa(int(v.Lv))] = v
|
||||||
|
@ -22,7 +22,7 @@ type Dragon struct {
|
|||||||
|
|
||||||
// 模块名
|
// 模块名
|
||||||
func (this *Dragon) GetType() core.M_Modules {
|
func (this *Dragon) GetType() core.M_Modules {
|
||||||
return comm.ModuleHero
|
return comm.ModuleDragon
|
||||||
}
|
}
|
||||||
|
|
||||||
// 模块初始化接口 注册用户创建角色事件
|
// 模块初始化接口 注册用户创建角色事件
|
||||||
|
@ -16,6 +16,7 @@ import (
|
|||||||
"go_dreamfactory/modules/combat"
|
"go_dreamfactory/modules/combat"
|
||||||
"go_dreamfactory/modules/dailytask"
|
"go_dreamfactory/modules/dailytask"
|
||||||
"go_dreamfactory/modules/dispatch"
|
"go_dreamfactory/modules/dispatch"
|
||||||
|
"go_dreamfactory/modules/dragon"
|
||||||
"go_dreamfactory/modules/enchant"
|
"go_dreamfactory/modules/enchant"
|
||||||
"go_dreamfactory/modules/equipment"
|
"go_dreamfactory/modules/equipment"
|
||||||
"go_dreamfactory/modules/forum"
|
"go_dreamfactory/modules/forum"
|
||||||
@ -156,6 +157,7 @@ func main() {
|
|||||||
uigame.NewModule(),
|
uigame.NewModule(),
|
||||||
battlerecord.NewModule(),
|
battlerecord.NewModule(),
|
||||||
weektask.NewModule(),
|
weektask.NewModule(),
|
||||||
|
dragon.NewModule(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user