dkforest

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

commit a230fa24ef25b7c344baed0aa9acf63225f949bd
parent ab75d520470409f2862865ad47c55ee3fc20348e
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Fri, 15 Dec 2023 01:17:28 -0500

ensure player cannot bet below amount of big blind

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

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -641,6 +641,12 @@ OUTER: } else if evt.Bet > 0 { bet := evt.Bet + // Ensure the player cannot bet below the table minimum bet (amount of the big blind) + if bet < g.PokerTableMinBet { + msg := fmt.Sprintf("Bet (%d) is too low. Must bet at least %d", bet, g.PokerTableMinBet) + PokerPubSub.Pub(roomUserTopic, ErrorMsgEvent{Message: msg}) + continue + } if (p.Bet + bet) < minBet { msg := fmt.Sprintf("Bet (%d) is too low. Must bet at least %d", bet, minBet-p.Bet) PokerPubSub.Pub(roomUserTopic, ErrorMsgEvent{Message: msg})