From c2a7fa3834a0416930c73c766b122d8aea13c054 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Thu, 27 Jun 2024 10:49:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=92=BB=E7=9F=B3=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E7=BD=90=E8=AE=A1=E7=AE=97=E4=BF=9D=E7=95=99=E5=90=8E?= =?UTF-8?q?4=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/welfmgr.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/worldsrv/welfmgr.go b/worldsrv/welfmgr.go index 30f5822..dff3434 100644 --- a/worldsrv/welfmgr.go +++ b/worldsrv/welfmgr.go @@ -3,6 +3,7 @@ package main import ( "fmt" "math" + "strconv" "time" "mongo.games.com/goserver/core/logger" @@ -1063,7 +1064,7 @@ func (this *WelfareMgr) BlindBoxInfo(p *Player, bid int32) { if cyc == 1 || blindBox.Cycle == model.WelfareOpen { p.WelfData.BlindBoxId = 0 } - } // == 1代表当日循环 + } // == 1代表当日循环 if p.WelfData.BlindBoxId == 0 { // 未领取过发随机Date idx := bid @@ -1922,8 +1923,11 @@ func (this *WelfareMgr) UpdateDiamondBankData(p *Player, coinNum int64, isWin bo } else { addDiamond = float64(coinNum) * float64(LoseCoinRate) / 10000000 } + //保留小数点后4位 + diamondStr := fmt.Sprintf("%.4f", addDiamond) + addDiamond, _ = strconv.ParseFloat(diamondStr, 64) p.WelfData.DiamondBank.BankDiamond += addDiamond - logger.Logger.Tracef("更新钻石存储罐数据 snid = %d,coinNum = %d,isWin = %s,当前钻石存储罐钻石数量:%f", p.SnId, coinNum, isWin, p.WelfData.DiamondBank.BankDiamond) + logger.Logger.Tracef("玩家更新钻石存储罐数据 snid = %d,coinNum = %d,isWin = %s,当前钻石存储罐钻石数量:%f,本次增加钻石数量:%f", p.SnId, coinNum, isWin, p.WelfData.DiamondBank.BankDiamond, addDiamond) } func (this *WelfareMgr) Update() {