上传代码
This commit is contained in:
parent
50a7ea5970
commit
3d5ff61e1d
@ -536,4 +536,8 @@ type (
|
||||
//英雄升级
|
||||
HeroUpLv(uid string, heroid string, lv int32)
|
||||
}
|
||||
// 世界任务
|
||||
IWtask interface {
|
||||
IOpenCmdNotice
|
||||
}
|
||||
)
|
||||
|
@ -157,6 +157,12 @@ func (this *UserSession) Push() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// 克隆
|
||||
func (this *UserSession) Clone() (clone *UserSession) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 打印日志需要
|
||||
func (this *UserSession) ToString() string {
|
||||
return fmt.Sprintf("SessionId:%s UserId:%s GatewayServiceId:%s", this.SessionId, this.UserId, this.GatewayServiceId)
|
||||
|
@ -48,6 +48,7 @@ func (this *apiComp) FuncActivate(session comm.IUserSession, req *pb.SysFuncActi
|
||||
return
|
||||
}
|
||||
|
||||
go this.module.wtask.OpenCmdNotice(session.GetUserId(), req.Cid)
|
||||
//手动激活通知模块
|
||||
for _, m := range opencfg.Notify {
|
||||
i, err := this.service.GetModule(core.M_Modules(m))
|
||||
|
@ -13,6 +13,7 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
||||
|
||||
var (
|
||||
bChange bool
|
||||
change []string = make([]string, 0)
|
||||
)
|
||||
rsp := &pb.SysFuncGetListResp{}
|
||||
rsp.Cond = make(map[string]int32, 0)
|
||||
@ -34,6 +35,7 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
||||
list.Cond[id] = 1 //设置激活
|
||||
} else {
|
||||
list.Cond[id] = 2 //自动激活
|
||||
change = append(change, id)
|
||||
}
|
||||
bChange = true
|
||||
}
|
||||
@ -50,6 +52,7 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
||||
list.Cond[id] = 1 //设置激活
|
||||
} else {
|
||||
list.Cond[id] = 2 //自动激活
|
||||
change = append(change, id)
|
||||
}
|
||||
bChange = true
|
||||
}
|
||||
@ -64,6 +67,9 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
||||
"cond": list.Cond,
|
||||
})
|
||||
}
|
||||
if len(change) > 0 {
|
||||
go this.module.wtask.OpenCmdNotice(session.GetUserId(), change...)
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp)
|
||||
return
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ var _ comm.ISys = (*ModuleSys)(nil)
|
||||
|
||||
type ModuleSys struct {
|
||||
modules.ModuleBase
|
||||
wtask comm.IWtask
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
service base.IRPCXService
|
||||
@ -33,7 +34,7 @@ func (this *ModuleSys) OnInstallComp() {
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
}
|
||||
|
||||
//模块初始化
|
||||
// 模块初始化
|
||||
func (this *ModuleSys) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
this.service = service.(base.IRPCXService)
|
||||
@ -43,6 +44,11 @@ func (this *ModuleSys) Init(service core.IService, module core.IModule, options
|
||||
|
||||
func (this *ModuleSys) Start() (err error) {
|
||||
err = this.ModuleBase.Start()
|
||||
var module core.IModule
|
||||
if module, err = this.service.GetModule(comm.ModuleSys); err != nil {
|
||||
return
|
||||
}
|
||||
this.wtask = module.(comm.IWtask)
|
||||
this.service.RegisterFunctionName(string(comm.Rpc_OpendCond), this.OpenCond)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user