From 050d1deb2f2a75429ed7ff1390adef3225f8d608 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 8 Sep 2023 15:01:27 +0800 Subject: [PATCH] update --- modules/friend/api_cross_agree.go | 2 +- modules/friend/api_cross_del.go | 2 +- modules/friend/module.go | 7 +------ modules/pagoda/api_challengeover.go | 2 +- modules/pagoda/module.go | 6 ------ modules/user/model_user.go | 2 +- modules/user/module.go | 6 +----- 7 files changed, 6 insertions(+), 21 deletions(-) diff --git a/modules/friend/api_cross_agree.go b/modules/friend/api_cross_agree.go index 37358410c..01917ba98 100644 --- a/modules/friend/api_cross_agree.go +++ b/modules/friend/api_cross_agree.go @@ -173,7 +173,7 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (e // event.TriggerEvent(comm.EventFriendChange, uid, int32(len(self.FriendIds))) } - go this.module.sys.CheckOpenCond(session.Clone(), comm.OpencondTypeFriend, int32(len(self.FriendIds))) + go this.module.ModuleSys.CheckOpenCond(session.Clone(), comm.OpencondTypeFriend, int32(len(self.FriendIds))) // 拥有xx个好友 // this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype10, int32(len(agreeIds))) var sz []*pb.BuriedParam diff --git a/modules/friend/api_cross_del.go b/modules/friend/api_cross_del.go index 82cad3bb0..ac36a2734 100644 --- a/modules/friend/api_cross_del.go +++ b/modules/friend/api_cross_del.go @@ -78,7 +78,7 @@ func (this *apiComp) Del(session comm.IUserSession, req *pb.FriendDelReq) (errda ) return } - go this.module.sys.CheckOpenCond(session.Clone(), comm.OpencondTypeFriend, int32(len(self.FriendIds))) + go this.module.ModuleSys.CheckOpenCond(session.Clone(), comm.OpencondTypeFriend, int32(len(self.FriendIds))) session.SendMsg(string(this.module.GetType()), FriendSubTypeDel, &pb.FriendDelResp{FriendId: req.FriendId, UserId: self.Uid}) return diff --git a/modules/friend/module.go b/modules/friend/module.go index 79e65c53a..12f3941a3 100644 --- a/modules/friend/module.go +++ b/modules/friend/module.go @@ -38,7 +38,6 @@ type Friend struct { configure *modules.MCompConfigure service base.IRPCXService globalConf *cfg.GameGlobalData - sys comm.ISys } func (this *Friend) GetType() core.M_Modules { @@ -67,11 +66,7 @@ func (this *Friend) Start() (err error) { if this.globalConf == nil { err = errors.New("global config not found") } - var module core.IModule - if module, err = this.service.GetModule(comm.ModuleSys); err != nil { - return - } - this.sys = module.(comm.ISys) + return } diff --git a/modules/pagoda/api_challengeover.go b/modules/pagoda/api_challengeover.go index 168811edf..f16fbb22a 100644 --- a/modules/pagoda/api_challengeover.go +++ b/modules/pagoda/api_challengeover.go @@ -175,7 +175,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal this.module.SetPagodaRankList("pagodaList"+strconv.Itoa(int(newData.PagodaId)), pagoda.PagodaId, newData.Id) } - go this.module.sys.CheckOpenCond(session.Clone(), comm.OpencondTypePagoda, conf.Key) + go this.module.ModuleSys.CheckOpenCond(session.Clone(), comm.OpencondTypePagoda, conf.Key) // 通关奖励 errdata = this.module.DispenseRes(session, conf.Reward, true) if errdata != nil { diff --git a/modules/pagoda/module.go b/modules/pagoda/module.go index 190692d35..8d7fdc9c4 100644 --- a/modules/pagoda/module.go +++ b/modules/pagoda/module.go @@ -28,7 +28,6 @@ type Pagoda struct { mail comm.Imail friend comm.IFriend modelRacePagoda *ModelRace - sys comm.ISys } func NewModule() core.IModule { @@ -85,11 +84,6 @@ func (this *Pagoda) Start() (err error) { return } this.friend = module.(comm.IFriend) - - if module, err = this.service.GetModule(comm.ModuleSys); err != nil { - return - } - this.sys = module.(comm.ISys) //this.service.RegisterFunctionName(string(comm.Rpc_ModuleSeasonPagodaReward), this.Rpc_ModuleSeasonPagodaReward) return } diff --git a/modules/user/model_user.go b/modules/user/model_user.go index 316e0f138..fc0b738b7 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -275,7 +275,7 @@ func (this *ModelUser) changelv(session comm.IUserSession, lv int32, exp int64, ) } this.module.chat.SendSysChatToUser(session, comm.ChatSystem12, lv, 0, name) - go this.module.sys.CheckOpenCond(session.Clone(), comm.OpencondTypePlatlv, lv) + go this.module.ModuleSys.CheckOpenCond(session.Clone(), comm.OpencondTypePlatlv, lv) session.Push() } diff --git a/modules/user/module.go b/modules/user/module.go index dff61ca83..bc46ae994 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -53,7 +53,6 @@ func NewModule() core.IModule { type User struct { modules.ModuleBase chat comm.IChat - sys comm.ISys api *apiComp modelUser *ModelUser modelSession *ModelSession @@ -98,10 +97,7 @@ func (this *User) Start() (err error) { return } this.chat = module.(comm.IChat) - if module, err = this.service.GetModule(comm.ModuleSys); err != nil { - return - } - this.sys = module.(comm.ISys) + return }