From 0d8d2e27758db25281be7e6e816aaf8535a8c789 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 12 Sep 2023 15:32:10 +0800 Subject: [PATCH] update --- modules/user/module.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/user/module.go b/modules/user/module.go index be412fcb8..9a35b6d9e 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -980,11 +980,17 @@ func (this *User) RecoverUserPsStart(session comm.IUserSession) (recoverTime int } else { add = yu changed = total + if u.LastRecoverPsSec != 0 { + u.LastRecoverPsSec += int64(yu * re) + if u.LastRecoverPsSec > time.Now().Unix() { + u.LastRecoverPsSec = time.Now().Unix() + } + } } } else { add = 0 } - u.LastRecoverPsSec = time.Now().Unix() + //u.LastRecoverPsSec = time.Now().Unix() update := map[string]interface{}{} if add > 0 { u.Ps += add @@ -993,7 +999,6 @@ func (this *User) RecoverUserPsStart(session comm.IUserSession) (recoverTime int } if err := this.modelUser.Change(u.Uid, update); err == nil { if changed > 0 { - this.reddot.PushReddot(session, &pb.ReddotItem{ Rid: int32(comm.Reddot30100), Nextchanagetime: u.LastRecoverPsSec + int64(re), @@ -1001,7 +1006,6 @@ func (this *User) RecoverUserPsStart(session comm.IUserSession) (recoverTime int session.Push() } } - } recoverTime = u.LastRecoverPsSec + int64(re) return recoverTime