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