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