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