commit b3831847f8556b098b580a1b09ecafc876913c50
parent b61e37a138055ebe38bb8b639080df23020b0f27
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Sat, 16 Dec 2023 02:34:03 -0500
cleanup
Diffstat:
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -914,17 +914,17 @@ END:
}
func applySmallBlindBet(db *database.DkfDB, g *PokerGame, bigBlindBet database.PokerChip, roomID RoomID) {
- p := g.Ongoing.Players[g.smallBlindIdx]
- bet := bigBlindBet / 2
- p.doBet(db, bet, g.PokerTableID, roomID.Topic())
- newLogEvent(g, roomID.LogsTopic(), fmt.Sprintf("%s small blind %d", p.Username, bet))
+ applyBlindBet(db, g, g.smallBlindIdx, bigBlindBet/2, roomID, "small blind")
}
func applyBigBlindBet(db *database.DkfDB, g *PokerGame, bigBlindBet database.PokerChip, roomID RoomID) {
- p := g.Ongoing.Players[g.bigBlindIdx]
- bet := bigBlindBet
+ applyBlindBet(db, g, g.bigBlindIdx, bigBlindBet, roomID, "big blind")
+}
+
+func applyBlindBet(db *database.DkfDB, g *PokerGame, playerIdx int, bet database.PokerChip, roomID RoomID, name string) {
+ p := g.Ongoing.Players[playerIdx]
p.doBet(db, bet, g.PokerTableID, roomID.Topic())
- newLogEvent(g, roomID.LogsTopic(), fmt.Sprintf("%s big blind %d", p.Username, bet))
+ newLogEvent(g, roomID.LogsTopic(), fmt.Sprintf("%s %s %d", p.Username, name, bet))
}
func autoUnsitInactivePlayers(db *database.DkfDB, g *PokerGame, roomID RoomID) {