From a53e7785d1b3707415836ffd2e1e6309571b9912 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Thu, 29 Dec 2022 18:25:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=93=E5=8A=9B=E5=B8=B8?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 2 +- modules/user/module.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/comm/const.go b/comm/const.go index b9d7f7340..65e00213e 100644 --- a/comm/const.go +++ b/comm/const.go @@ -321,7 +321,7 @@ const ( StarCoin = "starcoin" //星座币 SociatyCoin = "guildcoin" //公会币 ArenaCoin = "arenacoin" //竞技场币 - ResVit = "vit" // 体力 + ResVit = "ps" // 体力 ) const ( Gold int32 = 1 //金币 diff --git a/modules/user/module.go b/modules/user/module.go index 862513ac7..15a3d889e 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -663,7 +663,7 @@ func (this *User) recoverUserVit(uid string) { total := u.Vit + yu if total <= pconf.PsCeiling { if isession, ok := this.ModuleBase.GetUserSession(u.Uid); ok { - if code := this.AddAttributeValue(isession, "vit", yu, false); code == pb.ErrorCode_Success { + if code := this.AddAttributeValue(isession, comm.ResVit, yu, false); code == pb.ErrorCode_Success { update := map[string]interface{}{ "lastRecoverVitSec": cur, } @@ -672,7 +672,7 @@ func (this *User) recoverUserVit(uid string) { &pb.UserVitChangedPush{Vit: total}, u.Uid); err != nil { this.Error("玩家体力变化 UserVitChangedPush推送失败", log.Field{Key: "uid", Value: u.Uid}, - log.Field{Key: "vit", Value: total}, + log.Field{Key: comm.ResVit, Value: total}, ) } } @@ -695,12 +695,12 @@ func (this *User) AddUserVit(session comm.IUserSession, add int32) (code pb.Erro changed := u.Vit + add if changed <= ggd.PsUl { - if code = this.AddAttributeValue(session, "vit", add, false); code == pb.ErrorCode_Success { + if code = this.AddAttributeValue(session, comm.ResVit, add, false); code == pb.ErrorCode_Success { if err := session.SendMsg(string(this.GetType()), "vitchanged", &pb.UserVitChangedPush{Vit: changed}); err != nil { this.Error("玩家体力变化 UserVitChangedPush推送失败", log.Field{Key: "uid", Value: u.Uid}, - log.Field{Key: "vit", Value: changed}, + log.Field{Key: comm.ResVit, Value: changed}, ) code = pb.ErrorCode_SystemError }