commit 2e30b57785f2b143496fc4151a3762f37daa6427
parent 24d0d2bf7993899c2568217d4a1f05225ba57c0a
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Fri, 8 Dec 2023 21:58:14 -0500
call 0 to act like check
Diffstat:
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -509,14 +509,18 @@ OUTER:
} else if evt.Call {
bet := utils.MinInt(minBet-p.Bet, p.Cash)
- p.doBet(bet)
- PokerPubSub.Pub(roomTopic, PlayerBetEvent{PlayerIdx: p.SeatIdx, Player: p.Username, Bet: bet, TotalBet: p.Bet, Cash: p.Cash})
- logMsg := fmt.Sprintf("%s call (%d)", p.Username, bet)
- if p.isAllIn() {
- logMsg += " (all-in)"
- newlyAllInPlayers = append(newlyAllInPlayers, p)
+ if bet == 0 {
+ newLogEvent(g, roomLogsTopic, fmt.Sprintf("%s check", p.Username))
+ } else {
+ p.doBet(bet)
+ PokerPubSub.Pub(roomTopic, PlayerBetEvent{PlayerIdx: p.SeatIdx, Player: p.Username, Bet: bet, TotalBet: p.Bet, Cash: p.Cash})
+ logMsg := fmt.Sprintf("%s call (%d)", p.Username, bet)
+ if p.isAllIn() {
+ logMsg += " (all-in)"
+ newlyAllInPlayers = append(newlyAllInPlayers, p)
+ }
+ newLogEvent(g, roomLogsTopic, logMsg)
}
- newLogEvent(g, roomLogsTopic, logMsg)
} else if evt.AllIn {
bet := p.Cash