diff --git a/modules/friend/api_cross_agree.go b/modules/friend/api_cross_agree.go index 3b66bf39e..37358410c 100644 --- a/modules/friend/api_cross_agree.go +++ b/modules/friend/api_cross_agree.go @@ -173,6 +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))) // 拥有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 f94c6abcb..82cad3bb0 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))) 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 33981f859..79e65c53a 100644 --- a/modules/friend/module.go +++ b/modules/friend/module.go @@ -38,6 +38,7 @@ type Friend struct { configure *modules.MCompConfigure service base.IRPCXService globalConf *cfg.GameGlobalData + sys comm.ISys } func (this *Friend) GetType() core.M_Modules { @@ -54,6 +55,7 @@ func (this *Friend) OnInstallComp() { this.ModuleBase.OnInstallComp() this.api = this.RegisterComp(new(apiComp)).(*apiComp) this.modelFriend = this.RegisterComp(new(ModelFriend)).(*ModelFriend) + this.ModelFriendQiecuo = this.RegisterComp(new(ModelFriendQiecuo)).(*ModelFriendQiecuo) } @@ -65,6 +67,11 @@ 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 3495e3e7f..168811edf 100644 --- a/modules/pagoda/api_challengeover.go +++ b/modules/pagoda/api_challengeover.go @@ -175,6 +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) // 通关奖励 errdata = this.module.DispenseRes(session, conf.Reward, true) if errdata != nil { diff --git a/modules/pagoda/module.go b/modules/pagoda/module.go index 8d7fdc9c4..190692d35 100644 --- a/modules/pagoda/module.go +++ b/modules/pagoda/module.go @@ -28,6 +28,7 @@ type Pagoda struct { mail comm.Imail friend comm.IFriend modelRacePagoda *ModelRace + sys comm.ISys } func NewModule() core.IModule { @@ -84,6 +85,11 @@ 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 }