From 147f95685758235c759447a2ff4df0869947f541 Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <121212121@qq.com> Date: Mon, 21 Oct 2024 13:54:36 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A8=83=E5=A8=83=E6=9C=BA=E6=8A=93?= =?UTF-8?q?=E5=8F=96=E6=A6=82=E7=8E=87=E5=85=AC=E5=BC=8F=E3=80=91=20https:?= =?UTF-8?q?//www.tapd.cn/31044302/prong/stories/view/1131044302001001287?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/clawdoll/scene_clawdoll.go | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/gamesrv/clawdoll/scene_clawdoll.go b/gamesrv/clawdoll/scene_clawdoll.go index 1c60d81..efa13c4 100644 --- a/gamesrv/clawdoll/scene_clawdoll.go +++ b/gamesrv/clawdoll/scene_clawdoll.go @@ -150,10 +150,12 @@ func (this *SceneEx) OnPlayerLeave(p *base.Player, reason int) { return } - if len(this.players) <= 0 { - logger.Logger.Trace("Clawdoll (*SceneEx) OnPlayerLeave, cur player num = ", len(this.players)) - // 发送http Get请求 关闭直播间流 - operateTask(this, 2, rule.Zego_ForbidRTCStream, p.Platform) + if !rule.DebugSwitch { + if len(this.players) <= 0 { + logger.Logger.Trace("Clawdoll (*SceneEx) OnPlayerLeave, cur player num = ", len(this.players)) + // 发送http Get请求 关闭直播间流 + operateTask(this, 2, rule.Zego_ForbidRTCStream, p.Platform) + } } } @@ -349,18 +351,24 @@ func (this *SceneEx) GetPlayGrabType(player *PlayerEx) int32 { machineId := this.GetDBGameFree().GetId() % 6080000 machineInfo := this.GetMachineServerInfo(machineId, player.Platform) if machineInfo == nil { - logger.Logger.Errorf("GetPlayGrabType machineId: %v, platform: %v", machineId, player.Platform) + logger.Logger.Errorf("Clawdoll GetPlayGrabType machineId: %v, platform: %v", machineId, player.Platform) return rule.ClawWeak } ProfitRate := common.RandFloat(machineInfo.ProfitMin, machineInfo.ProfitMax) - strongRate := machineInfo.CatchPrice/machineInfo.BuyPrice*ProfitRate*float64(this.PayCoinCount) - 1 + strongRate := (machineInfo.CatchPrice/(machineInfo.BuyPrice*ProfitRate))*float64(this.PayCoinCount) - 1 + + logger.Logger.Tracef("Clawdoll GetPlayGrabType: SnId: %v, PayCoinCount:%v, ProfitRate:%v, strongRate:%v", player.SnId, this.PayCoinCount, ProfitRate, strongRate) + if strongRate <= 0.00000 { return rule.ClawWeak } else if strongRate > 0.00000 && strongRate <= 0.99999 { // 再次随机 newRate := common.RandFromRangeInt64(0, 100) - if int64(strongRate*100) > newRate { + logger.Logger.Tracef("Clawdoll GetPlayGrabType: newRate:%v, SnId: %v, PayCoinCount:%v, ProfitRate:%v, strongRate:%v ", newRate, player.SnId, this.PayCoinCount, ProfitRate, strongRate) + + if int64(strongRate*100) >= newRate { + logger.Logger.Tracef("Clawdoll GetPlayGrabType: SnId: %v gain ClawStrong, PayCoinCount:%v", player.SnId, this.PayCoinCount) return rule.ClawStrong } else { return rule.ClawWeak