dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 5497fdc8b84f1571e5e827d9b290d66a30a8030d
parent 2e09d2ea94731a81657bab03d4531c11388a5995
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Mon, 18 Dec 2023 22:44:45 -0500

cleanup

Diffstat:
Mpkg/web/handlers/poker/poker.go | 15+++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -641,7 +641,8 @@ func doCheck(g *PokerGame, p *PokerPlayer, minBet *database.PokerChip) int { return doNothing } -func doCall(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet *database.PokerChip, newlyAllInPlayers *[]*PokerPlayer) int { +func doCall(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet *database.PokerChip, + newlyAllInPlayers *[]*PokerPlayer) int { pUsername := p.Username bet := utils.MinInt(*minBet-p.GetBet(), p.GetCash()) if bet == 0 { @@ -658,7 +659,8 @@ func doCall(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet *database.P return doNothing } -func doAllIn(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet *database.PokerChip, newlyAllInPlayers *[]*PokerPlayer, lastRaisePlayerIdx *int, playerToPlayIdx int) int { +func doAllIn(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet *database.PokerChip, + newlyAllInPlayers *[]*PokerPlayer, lastRaisePlayerIdx *int, playerToPlayIdx int) int { bet := p.GetCash() if (p.GetBet() + bet) > *minBet { *lastRaisePlayerIdx = playerToPlayIdx @@ -673,7 +675,8 @@ func doAllIn(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet *database. return doNothing } -func doBet(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet *database.PokerChip, newlyAllInPlayers *[]*PokerPlayer, lastRaisePlayerIdx *int, playerToPlayIdx int, evt PlayerEvent) int { +func doBet(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet *database.PokerChip, + newlyAllInPlayers *[]*PokerPlayer, lastRaisePlayerIdx *int, playerToPlayIdx int, evt PlayerEvent) int { roomTopic := g.RoomID.Topic() roomUserTopic := g.RoomID.UserTopic(p.Username) pokerTableMinBet := g.PokerTableMinBet @@ -708,8 +711,8 @@ func doBet(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet *database.Po return doNothing } -func handleAutoActionReceived(g *PokerGame, autoCache map[database.Username]AutoAction, roomID RoomID, evt PlayerEvent) int { - roomUserTopic := roomID.UserTopic(evt.Player) +func handleAutoActionReceived(g *PokerGame, autoCache map[database.Username]AutoAction, evt PlayerEvent) int { + roomUserTopic := g.RoomID.UserTopic(evt.Player) autoAction := autoCache[evt.Player] if evt.Fold && autoAction.action == FoldAction || evt.Call && autoAction.action == CallAction || @@ -849,7 +852,7 @@ RoundIsSettledLoop: } if evt.Player != pUsername { - actionResult = handleAutoActionReceived(g, autoCache, roomID, evt) + actionResult = handleAutoActionReceived(g, autoCache, evt) goto checkActionResult }