From 5c299aced4275352aa57af12a984a0cd7170ac32 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 15 Jun 2023 21:05:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E7=82=B9=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/reddot/api_get.go | 15 +++++++++++---- modules/reddot/api_getall.go | 4 ++++ modules/reddot/module.go | 21 +++++++++++++-------- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/modules/reddot/api_get.go b/modules/reddot/api_get.go index 76215a7aa..881c0762b 100644 --- a/modules/reddot/api_get.go +++ b/modules/reddot/api_get.go @@ -47,6 +47,16 @@ func (this *apiComp) Get(session comm.IUserSession, req *pb.ReddotGetReq) (errda for k, v := range this.module.arena.Reddot(session, _rid) { reddot[int32(k)] = v } + //好友 + case comm.Reddot21101: + for k, v := range this.module.friend.Reddot(session, _rid) { + reddot[int32(k)] = v + } + //羁绊 + case comm.Reddot19103, comm.Reddot19105, comm.Reddot19109, comm.Reddot19110: + for k, v := range this.module.library.Reddot(session, _rid) { + reddot[int32(k)] = v + } case comm.Reddot17: for k, v := range this.module.horoscope.Reddot(session, _rid) { reddot[int32(k)] = v @@ -68,10 +78,7 @@ func (this *apiComp) Get(session comm.IUserSession, req *pb.ReddotGetReq) (errda for k, v := range this.module.hunting.Reddot(session, _rid) { reddot[int32(k)] = v } - case comm.Reddot19103, comm.Reddot19105, comm.Reddot19109, comm.Reddot19110: - for k, v := range this.module.library.Reddot(session, _rid) { - reddot[int32(k)] = v - } + } } session.SendMsg(string(this.module.GetType()), "get", &pb.ReddotGetAllResp{Reddot: reddot}) diff --git a/modules/reddot/api_getall.go b/modules/reddot/api_getall.go index 146bb45db..e8683181f 100644 --- a/modules/reddot/api_getall.go +++ b/modules/reddot/api_getall.go @@ -44,6 +44,10 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq) for k, v := range this.module.arena.Reddot(session, comm.Reddot22102) { reddot[int32(k)] = v } + for k, v := range this.module.friend.Reddot(session, comm.Reddot21101) { + reddot[int32(k)] = v + } + for k, v := range this.module.pagoda.Reddot(session, comm.Reddot6) { reddot[int32(k)] = v } diff --git a/modules/reddot/module.go b/modules/reddot/module.go index f5b131e67..c73bb17cc 100644 --- a/modules/reddot/module.go +++ b/modules/reddot/module.go @@ -22,18 +22,20 @@ type Reddot struct { modules.ModuleBase service base.IRPCXService - smithy comm.ISmithy //铁匠铺 + smithy comm.ISmithy //铁匠铺 + library comm.ILibrary //羁绊 + mail comm.Imail //邮件 + sociaty comm.ISociaty //工会 pagoda comm.IPagoda horoscope comm.IHoroscope - arena comm.IArena + arena comm.IArena //竞技场 + friend comm.IFriend gourmet comm.IGourmet - sociaty comm.ISociaty - mail comm.Imail viking comm.IViking hunting comm.IHunting - library comm.ILibrary - api_comp *apiComp - mline comm.IMline + + api_comp *apiComp + mline comm.IMline } //模块名 @@ -59,7 +61,10 @@ func (this *Reddot) Start() (err error) { return } this.smithy = module.(comm.ISmithy) - + if module, err = this.service.GetModule(comm.ModuleFriend); err != nil { + return + } + this.friend = module.(comm.IFriend) if module, err = this.service.GetModule(comm.ModulePagoda); err != nil { return }