上传代码

This commit is contained in:
liwei 2023-07-11 14:19:56 +08:00
parent 50a7ea5970
commit 3d5ff61e1d
5 changed files with 24 additions and 1 deletions

View File

@ -536,4 +536,8 @@ type (
//英雄升级 //英雄升级
HeroUpLv(uid string, heroid string, lv int32) HeroUpLv(uid string, heroid string, lv int32)
} }
// 世界任务
IWtask interface {
IOpenCmdNotice
}
) )

View File

@ -157,6 +157,12 @@ func (this *UserSession) Push() (err error) {
return return
} }
// 克隆
func (this *UserSession) Clone() (clone *UserSession) {
return
}
// 打印日志需要 // 打印日志需要
func (this *UserSession) ToString() string { func (this *UserSession) ToString() string {
return fmt.Sprintf("SessionId:%s UserId:%s GatewayServiceId:%s", this.SessionId, this.UserId, this.GatewayServiceId) return fmt.Sprintf("SessionId:%s UserId:%s GatewayServiceId:%s", this.SessionId, this.UserId, this.GatewayServiceId)

View File

@ -48,6 +48,7 @@ func (this *apiComp) FuncActivate(session comm.IUserSession, req *pb.SysFuncActi
return return
} }
go this.module.wtask.OpenCmdNotice(session.GetUserId(), req.Cid)
//手动激活通知模块 //手动激活通知模块
for _, m := range opencfg.Notify { for _, m := range opencfg.Notify {
i, err := this.service.GetModule(core.M_Modules(m)) i, err := this.service.GetModule(core.M_Modules(m))

View File

@ -13,6 +13,7 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
var ( var (
bChange bool bChange bool
change []string = make([]string, 0)
) )
rsp := &pb.SysFuncGetListResp{} rsp := &pb.SysFuncGetListResp{}
rsp.Cond = make(map[string]int32, 0) 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 //设置激活 list.Cond[id] = 1 //设置激活
} else { } else {
list.Cond[id] = 2 //自动激活 list.Cond[id] = 2 //自动激活
change = append(change, id)
} }
bChange = true bChange = true
} }
@ -50,6 +52,7 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
list.Cond[id] = 1 //设置激活 list.Cond[id] = 1 //设置激活
} else { } else {
list.Cond[id] = 2 //自动激活 list.Cond[id] = 2 //自动激活
change = append(change, id)
} }
bChange = true bChange = true
} }
@ -64,6 +67,9 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
"cond": list.Cond, "cond": list.Cond,
}) })
} }
if len(change) > 0 {
go this.module.wtask.OpenCmdNotice(session.GetUserId(), change...)
}
session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp) session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp)
return return
} }

View File

@ -16,6 +16,7 @@ var _ comm.ISys = (*ModuleSys)(nil)
type ModuleSys struct { type ModuleSys struct {
modules.ModuleBase modules.ModuleBase
wtask comm.IWtask
api *apiComp api *apiComp
configure *configureComp configure *configureComp
service base.IRPCXService service base.IRPCXService
@ -43,6 +44,11 @@ func (this *ModuleSys) Init(service core.IService, module core.IModule, options
func (this *ModuleSys) Start() (err error) { func (this *ModuleSys) Start() (err error) {
err = this.ModuleBase.Start() 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) this.service.RegisterFunctionName(string(comm.Rpc_OpendCond), this.OpenCond)
return return
} }