commit ff47988430c8d197537083e2aaefea8d80703b17
parent ce84abad18429e0727931c4bf5d950f9c4d4f368
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Thu, 21 Dec 2023 22:16:04 -0500
auto fold/check
Diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -719,9 +719,9 @@ func doTimeout(g *PokerGame, p *pokerPlayer, minBet *database.PokerChip, playerA
func doFold(g *PokerGame, p *pokerPlayer, minBet *database.PokerChip, playerAlive *int) int {
roomUserTopic := g.roomID.UserTopic(p.userID)
if p.getBet() == *minBet {
- msg := fmt.Sprintf("Cannot fold if there is no bet")
+ msg := fmt.Sprintf("Cannot fold if there is no bet; check")
PokerPubSub.Pub(roomUserTopic, ErrorMsgEvent{Message: msg})
- return continueGetPlayerEventLoop
+ return doCheck(g, p, minBet)
}
foldPlayer(g, p)
g.newLogEvent(fmt.Sprintf("%s fold", p.username))
@@ -828,7 +828,12 @@ func handleAutoActionReceived(g *PokerGame, autoCache map[database.UserID]autoAc
action := evt.getAction()
if action != NoAction {
autoCache[evt.UserID] = autoAction{action: action, evt: evt}
- msg := "Will auto " + action.String()
+ msg := "Will auto "
+ if action == FoldAction {
+ msg += "fold/check"
+ } else {
+ msg += action.String()
+ }
if evt.Bet > 0 {
msg += fmt.Sprintf(" %d", evt.Bet.Raw())
}