From f16e99007843a2283b66826023290fd79fc67282 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 3 Jan 2024 15:37:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=B8=AA=E4=BD=93=E5=8A=9B=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E5=B0=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/user/module.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/user/module.go b/modules/user/module.go index 9be69ec32..5acb42a08 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -679,9 +679,10 @@ func (this *User) change(session comm.IUserSession, attrs map[string]int32) (atn } return } + this.recoverUserPs(user) user.Ps += add userEx.ConsumPs += -add - this.recoverUserPs(user) + change.Ps = user.Ps go this.ModuleUiGame.HDPSTodayConsum(session.GetUserId(), userEx.ConsumPs) } else { @@ -1104,7 +1105,7 @@ func (this *User) recoverUserPs(user *pb.DBUser) (change bool, total int32, next yu int32 add int32 ) - + cur := configure.Now().Unix() ggd := this.ModuleTools.GetGlobalConf() if ggd == nil { return @@ -1114,10 +1115,11 @@ func (this *User) recoverUserPs(user *pb.DBUser) (change bool, total int32, next return } if user.Ps >= pconf.PsCeiling { + user.LastRecoverPsSec = cur return } total = pconf.PsCeiling - cur := configure.Now().Unix() + if user.LastRecoverPsSec == 0 { user.LastRecoverPsSec = cur change = true