commit 56c56e86d77fffb437a43ce60bcd906a5027a56a
parent bcafacbf029e7ab00549f5f665060d0f12aaa812
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 18 Dec 2023 22:24:59 -0500
cleanup
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -732,7 +732,8 @@ func applyAutoAction(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet da
lastRaisePlayerIdx, playerAlive *int, playerToPlayIdx int, autoAction AutoAction,
autoCache map[database.Username]AutoAction) (actionResult int) {
- roomUserTopic := g.RoomID.UserTopic(p.Username)
+ pUsername := p.Username
+ roomUserTopic := g.RoomID.UserTopic(pUsername)
if autoAction.action > NoAction {
time.Sleep(500 * time.Millisecond)
p.LastActionTS = time.Now()
@@ -750,7 +751,7 @@ func applyAutoAction(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet da
actionResult = doAllIn(g, p, db, minBet, newlyAllInPlayers, pokerTableID, lastRaisePlayerIdx, playerToPlayIdx)
}
}
- delete(autoCache, p.Username)
+ delete(autoCache, pUsername)
setAutoAction(g, roomUserTopic, "")
return
}
@@ -759,12 +760,11 @@ func handlePlayerActionEvent(g *PokerGame, p *PokerPlayer, db *database.DkfDB, m
newlyAllInPlayers *[]*PokerPlayer, pokerTableID int64,
lastRaisePlayerIdx, playerAlive *int, playerToPlayIdx int, evt PlayerEvent) (actionResult int) {
- roomUserTopic := g.RoomID.UserTopic(p.Username)
p.LastActionTS = time.Now()
if evt.Fold {
- actionResult = doFold(g, p, playerAlive, roomUserTopic)
+ actionResult = doFold(g, p, playerAlive)
} else if evt.Check {
- actionResult = doCheck(g, p, minBet, roomUserTopic)
+ actionResult = doCheck(g, p, minBet)
} else if evt.Call {
actionResult = doCall(g, p, db, minBet, newlyAllInPlayers, pokerTableID)
} else if evt.AllIn {