commit 5775735e55aef2af09633595c212202751a75a05
parent 481410afaf3f3b4a0d8c158d1362ca30d0fa1e36
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 18 Dec 2023 14:33:41 -0500
cleanup
Diffstat:
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -719,21 +719,28 @@ RoundIsSettledLoop:
setAutoAction(g, roomUserTopic, "")
return continueGetPlayerEventLoop
}
+
+ action := NoAction
+ msg := ""
if evt.Fold {
- autoCache[evt.Player] = AutoAction{v: FoldAction, evt: evt}
- setAutoAction(g, roomUserTopic, "Will auto fold")
+ action = FoldAction
+ msg = "Will auto fold"
} else if evt.Call {
- autoCache[evt.Player] = AutoAction{v: CallAction, evt: evt}
- setAutoAction(g, roomUserTopic, "Will auto call")
+ action = CallAction
+ msg = "Will auto call"
} else if evt.Check {
- autoCache[evt.Player] = AutoAction{v: CheckAction, evt: evt}
- setAutoAction(g, roomUserTopic, "Will auto check")
+ action = CheckAction
+ msg = "Will auto check"
} else if evt.Bet > 0 {
- autoCache[evt.Player] = AutoAction{v: BetAction, evt: evt}
- setAutoAction(g, roomUserTopic, "Will auto bet"+evt.Bet.String())
+ action = BetAction
+ msg = "Will auto bet"
} else if evt.AllIn {
- autoCache[evt.Player] = AutoAction{v: AllInAction, evt: evt}
- setAutoAction(g, roomUserTopic, "Will auto all-in")
+ action = AllInAction
+ msg = "Will auto all-in"
+ }
+ if action != NoAction {
+ autoCache[evt.Player] = AutoAction{v: action, evt: evt}
+ setAutoAction(g, roomUserTopic, msg)
}
return continueGetPlayerEventLoop
}