From 7a0916b006cca107029031a17820da22e35ca8a4 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 7 Sep 2023 19:04:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 2 ++ comm/imodule.go | 4 ++-- modules/user/model_user.go | 1 + modules/user/module.go | 6 +++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/comm/const.go b/comm/const.go index d82925994..a4114a141 100644 --- a/comm/const.go +++ b/comm/const.go @@ -515,7 +515,9 @@ const ( const ( ResGold = "gold" //金币 ResExp = "exp" //经验 + Lv = "lv" //等级 VipExp = "vipexp" //经验 + Vip = "vip" //vip ResDiamond = "diamond" //钻石 ResTaskActive = "taskActive" //任务活跃度 ResFriend = "friendPoint" //友情点 diff --git a/comm/imodule.go b/comm/imodule.go index 0fb442fc9..76dc667cb 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -173,8 +173,8 @@ type ( // 批量处理 AddAttributeValues(session IUserSession, attrs map[string]int32, bPush bool) (errdata *pb.ErrorData) //用户改变事件 - EventUserChanged(session IUserSession) - EventUserVipChanged(session IUserSession) + // EventUserChanged(session IUserSession) + // EventUserVipChanged(session IUserSession) //获取用户expand GetUserExpand(uid string) (result *pb.DBUserExpand, err error) //更新用户expand diff --git a/modules/user/model_user.go b/modules/user/model_user.go index ca14ec041..2bf1949e4 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -279,6 +279,7 @@ func (this *ModelUser) changelv(session comm.IUserSession, lv int32, exp int64, ) } this.module.chat.SendSysChatToUser(session, comm.ChatSystem12, lv, 0, name) + this.module.sys.CheckOpenCond(session, comm.OpencondTypePlatlv, lv) session.Push() } diff --git a/modules/user/module.go b/modules/user/module.go index bc46ae994..dff61ca83 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -53,6 +53,7 @@ func NewModule() core.IModule { type User struct { modules.ModuleBase chat comm.IChat + sys comm.ISys api *apiComp modelUser *ModelUser modelSession *ModelSession @@ -97,7 +98,10 @@ 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 }