This commit is contained in:
liwei1dao 2022-12-29 18:28:19 +08:00
commit 78993b940e
2 changed files with 5 additions and 5 deletions

View File

@ -321,7 +321,7 @@ const (
StarCoin = "starcoin" //星座币
SociatyCoin = "guildcoin" //公会币
ArenaCoin = "arenacoin" //竞技场币
ResVit = "vit" // 体力
ResVit = "ps" // 体力
)
const (
Gold int32 = 1 //金币

View File

@ -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
}