定义用户创建角色事件
This commit is contained in:
parent
dfd3d6a292
commit
acf4969646
@ -34,7 +34,8 @@ const ( //Rpc
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Event_UserLogin core.Event_Key = "Event_UserLogin" //登录事件
|
Event_UserLogin core.Event_Key = "Event_UserLogin" //登录事件
|
||||||
|
Event_CreateUser core.Event_Key = "Event_CreateUser" //创建角色事件
|
||||||
)
|
)
|
||||||
|
|
||||||
type ISC_GateRouteComp interface {
|
type ISC_GateRouteComp interface {
|
||||||
|
@ -3,8 +3,11 @@ package pack
|
|||||||
import (
|
import (
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
|
"go_dreamfactory/sys/db"
|
||||||
|
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
|
"go_dreamfactory/lego/sys/event"
|
||||||
|
"go_dreamfactory/lego/sys/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -27,8 +30,22 @@ func (this *Pack) GetType() core.M_Modules {
|
|||||||
return comm.SM_PackModule
|
return comm.SM_PackModule
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *Pack) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||||
|
err = this.ModuleBase.Init(service, module, options)
|
||||||
|
event.RegisterGO(comm.Event_CreateUser, this.event_CreateUser)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (this *Pack) OnInstallComp() {
|
func (this *Pack) OnInstallComp() {
|
||||||
this.ModuleBase.OnInstallComp()
|
this.ModuleBase.OnInstallComp()
|
||||||
this.api_comp = this.RegisterComp(new(Api_Comp)).(*Api_Comp)
|
this.api_comp = this.RegisterComp(new(Api_Comp)).(*Api_Comp)
|
||||||
this.configure_comp = this.RegisterComp(new(Configure_Comp)).(*Configure_Comp)
|
this.configure_comp = this.RegisterComp(new(Configure_Comp)).(*Configure_Comp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Evens--------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
//接收玩家创建角色事件
|
||||||
|
func (this *Pack) event_CreateUser(uid string) {
|
||||||
|
if _, err := db.Defsys.Pack_InitUserPack(uid); err != nil {
|
||||||
|
log.Errorf("event_CreateUser err:%v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user