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