上传功能开启事件触发

This commit is contained in:
liwei1dao 2022-12-27 17:42:33 +08:00
parent 55d0ad643b
commit d8b6e8b010

View File

@ -8,6 +8,7 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/event"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
@ -66,6 +67,7 @@ func (this *Moonfantasy) Start() (err error) {
this.battle = module.(comm.IBattle)
this.service.RegisterFunctionName(string(comm.Rpc_ModuleMoonfantasyTrigger), this.Rpc_ModuleMoonfantasyTrigger)
this.service.RegisterFunctionName(string(comm.Rpc_ModuleMoonfantasyTriggerMF), this.Rpc_ModuleMoonfantasyTriggerMF)
event.RegisterGO(comm.EventOpenCond, this.EventOpenCond)
return
}
@ -167,3 +169,29 @@ func (this *Moonfantasy) TriggerMF(session comm.IUserSession, Boosid string) (er
}
return
}
//功能开启事件触发
func (this *Moonfantasy) EventOpenCond(uid string, funcIds []string) {
for _, v := range funcIds {
if v == "Mystery" { //月子秘境
if this.IsCross() {
ss, _ := this.GetUserSession(uid)
this.modelDream.trigger(ss)
if err := ss.Push(); err != nil {
this.Errorln(err)
}
} else {
if _, err := this.service.AcrossClusterRpcGo(context.Background(),
this.GetCrossTag(),
comm.Service_Worker,
string(comm.Rpc_ModuleMoonfantasyTrigger),
pb.RPCGeneralReqA1{Param1: uid},
nil,
); err != nil {
this.Errorln(err)
}
}
break
}
}
}