From 1b3b15d469a62802864948474a46239884227f02 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 11 Nov 2022 16:50:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=BA=A2=E7=82=B9=E8=A1=A5?= =?UTF-8?q?=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/reddot/api_getall.go | 18 +++++++++--------- modules/reddot/module.go | 10 ++++++++++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/modules/reddot/api_getall.go b/modules/reddot/api_getall.go index 482c86a9b..010bdb508 100644 --- a/modules/reddot/api_getall.go +++ b/modules/reddot/api_getall.go @@ -21,15 +21,15 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq) if code = this.GetAllCheck(session, req); code != pb.ErrorCode_Success { return } - reddot[int32(comm.Reddot1)] = true - reddot[int32(comm.Reddot2)] = true - reddot[int32(comm.Reddot3)] = false - reddot[int32(comm.Reddot4)] = true - reddot[int32(comm.Reddot5)] = true - reddot[int32(comm.Reddot6)] = true - // for k, v := range this.module.martialhall.Reddot(session.GetUserId(), comm.Reddot1) { - // reddot[int32(k)] = v - // } + for k, v := range this.module.ModuleTask.Reddot(session.GetUserId(), comm.Reddot1, comm.Reddot2, comm.Reddot3, comm.Reddot4) { + reddot[int32(k)] = v + } + for k, v := range this.module.mainline.Reddot(session.GetUserId(), comm.Reddot5) { + reddot[int32(k)] = v + } + for k, v := range this.module.pagoda.Reddot(session.GetUserId(), comm.Reddot6) { + reddot[int32(k)] = v + } session.SendMsg(string(this.module.GetType()), "getall", &pb.ReddotGetAllResp{Reddot: reddot}) return } diff --git a/modules/reddot/module.go b/modules/reddot/module.go index 32910a5d0..9d5334943 100644 --- a/modules/reddot/module.go +++ b/modules/reddot/module.go @@ -20,6 +20,8 @@ func NewModule() core.IModule { type Reddot struct { modules.ModuleBase service base.IRPCXService + mainline comm.IMainline + pagoda comm.IPagoda martialhall comm.IMartialhall api_comp *apiComp } @@ -38,6 +40,14 @@ func (this *Reddot) Init(service core.IService, module core.IModule, options cor func (this *Reddot) Start() (err error) { err = this.ModuleBase.Start() var module core.IModule + if module, err = this.service.GetModule(comm.ModuleMainline); err != nil { + return + } + this.mainline = module.(comm.IMainline) + if module, err = this.service.GetModule(comm.ModulePagoda); err != nil { + return + } + this.pagoda = module.(comm.IPagoda) if module, err = this.service.GetModule(comm.ModuleMartialhall); err != nil { return }