dkforest

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

commit 5768315d53139a49bae03b1a7d8f9cf69254ab38
parent f87541caf8a5725c6bdecefb3f4f6296d497e866
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Mon, 18 Dec 2023 06:14:32 -0500

cleanup

Diffstat:
Mpkg/web/handlers/poker/poker.go | 28+++++++++++-----------------
1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -1190,28 +1190,22 @@ func processPot(winners []GameResult, mainPot, pokerTableMinBet database.PokerCh if collectRake { // https://www.pokerstars.com/poker/room/rake + // BB: pct, 2P, 3-4P, 5+P + rakeTable := map[database.PokerChip][]float64{ + 3: {0.035, 178, 178, 178}, + 20: {0.0415, 297, 297, 595}, + 200: {0.05, 446, 446, 1190}, + } maxRake := pokerTableMinBet * 15 rakePct := 0.045 - if pokerTableMinBet == 3 { - rakePct = 0.035 - maxRake = 178 - } else if pokerTableMinBet == 20 { - rakePct = 0.0415 - if nbPlayers == 2 { - maxRake = 297 - } else if nbPlayers == 3 || nbPlayers == 4 { - maxRake = 297 - } else if nbPlayers > 4 { - maxRake = 595 - } - } else if pokerTableMinBet == 200 { - rakePct = 0.05 + if val, ok := rakeTable[pokerTableMinBet]; ok { + rakePct = val[0] if nbPlayers == 2 { - maxRake = 446 + maxRake = database.PokerChip(val[1]) } else if nbPlayers == 3 || nbPlayers == 4 { - maxRake = 446 + maxRake = database.PokerChip(val[2]) } else if nbPlayers > 4 { - maxRake = 1190 + maxRake = database.PokerChip(val[3]) } } rake = database.PokerChip(math.RoundToEven(rakePct * float64(mainPot)))