dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit bfc7cf465e3b869ec126b0c79b3a16a44bc0ffed
parent 78495befd238a8b28bbcc301b53db9cfa047dfeb
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sun, 17 Dec 2023 05:54:28 -0500

cleanup

Diffstat:
Mpkg/web/handlers/poker/poker.go | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -1076,7 +1076,7 @@ END: winners := g.Ongoing.computeWinners() mainPot := g.Ongoing.getMainPot() - playersGain, rake := processPot(winners, mainPot, g.PokerTableMinBet, collectRake) + playersGain, rake := processPot(winners, mainPot, bigBlindBet, collectRake) winnersStr, winnerHand := applyGains(g, playersGain, mainPot, rake) g.Ongoing.setMainPot(0) @@ -1108,20 +1108,21 @@ func applyBlindBet(g *PokerGame, playerIdx int, bet database.PokerChip, name str } func autoUnsitInactivePlayers(g *PokerGame) { + pokerTableMinBet := g.PokerTableMinBet roomTopic := g.RoomID.Topic() g.PlayersMtx.Lock() defer g.PlayersMtx.Unlock() for _, p := range g.Players { if p != nil { playerShallBeBooted := false - if !p.isEligible(g.PokerTableMinBet) { + if !p.isEligible(pokerTableMinBet) { playerShallBeBooted = true } else if p.LastActionTS.Before(g.Ongoing.CreatedAt) { // If the player was playing the game, must be booted if he had the chance to make actions and did not. // If the player was not playing the game, must be booted if he's not eligible to play the next one. op := g.Ongoing.GetPlayer(p.Username) playerShallBeBooted = (op != nil && op.countChancesToAction > 0) || - (op == nil && !p.isEligible(g.PokerTableMinBet)) + (op == nil && !p.isEligible(pokerTableMinBet)) } if playerShallBeBooted { if err := g.UnSitPlayer1(p); err == nil {