From 8736f54fe1e934da699f1f00d513befd5d6cace8 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 22 Aug 2024 16:07:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E9=87=91=E8=B4=AD=E4=B9=B0=E5=90=8Evi?= =?UTF-8?q?p=E7=BB=8F=E9=AA=8C=E8=8E=B7=E5=BE=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/player.go | 8 ++++---- worldsrv/trascate_webapi.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/worldsrv/player.go b/worldsrv/player.go index 654bf6e..bcc7c3e 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -3817,9 +3817,9 @@ func (this *Player) SCVIPInfo() { logger.Logger.Tracef("send vipinfo to client:%v", pack) } -func (this *Player) GetVIPExpByPay(payTotal int32) int32 { +func (this *Player) GetVIPExpByPay(payTotal int64) int64 { vips := VipMgrSington.GetVIPcfg(this.Platform) - return int32(math.Floor(float64(payTotal) * vips.MoneyRatio / 100)) + return payTotal * int64(vips.MoneyRatio) } func (this *Player) VIPDraw(id, vip int32) { @@ -3978,7 +3978,7 @@ func (this *Player) GetVIPLevel() int32 { vips := VipMgrSington.GetVIPcfg(this.Platform) vip := int32(0) if vips != nil && this.MoneyPayTotal != 0 { - allExp := int64(float64(this.MoneyPayTotal) * vips.MoneyRatio) + allExp := this.MoneyPayTotal * int64(vips.MoneyRatio) for _, v := range vips.List { if allExp >= int64(v.VipEx) { vip = v.VipId @@ -4111,7 +4111,7 @@ func (this *Player) GetPayGoodsInfo() { this.dirty = true this.SendDiffData() - info.Amount[2] = this.GetVIPExpByPay(info.ConsumeNum) + info.Amount[2] = int32(this.GetVIPExpByPay(int64(info.ConsumeNum))) BagMgrSingleton.AddItems(this, items, 0, info.GainWay, info.Operator, info.Remark, 0, 0, false) diff --git a/worldsrv/trascate_webapi.go b/worldsrv/trascate_webapi.go index 1800f00..76435ab 100644 --- a/worldsrv/trascate_webapi.go +++ b/worldsrv/trascate_webapi.go @@ -3444,7 +3444,7 @@ func init() { player.MoneyTotal += int64(info.ConsumeTypeNum) player.dirty = true player.SendDiffData() - info.Amount[2] = player.GetVIPExpByPay(info.ConsumeNum) + info.Amount[2] = int32(player.GetVIPExpByPay(int64(info.ConsumeNum))) var itemInfo []*playerproto.PayItem var items []*Item