dkforest

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

commit bcafacbf029e7ab00549f5f665060d0f12aaa812
parent 57bc06413e84c5621edd286b7f6904ed3c93f8c5
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Mon, 18 Dec 2023 22:23:31 -0500

cleanup

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

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -619,22 +619,22 @@ func doUnsit(g *PokerGame, p *PokerPlayer, playerAlive *int) int { return continueGetPlayerEventLoop } -func doFold(g *PokerGame, p *PokerPlayer, playerAlive *int, roomUserTopic string) int { +func doFold(g *PokerGame, p *PokerPlayer, playerAlive *int) int { foldPlayer(g, p) g.newLogEvent(fmt.Sprintf("%s fold", p.Username)) *playerAlive-- if *playerAlive == 1 { - PokerPubSub.Pub(roomUserTopic, ErrorMsgEvent{Message: ""}) + PokerPubSub.Pub(g.RoomID.UserTopic(p.Username), ErrorMsgEvent{Message: ""}) return breakRoundIsSettledLoop } return doNothing } -func doCheck(g *PokerGame, p *PokerPlayer, minBet database.PokerChip, roomUserTopic string) int { +func doCheck(g *PokerGame, p *PokerPlayer, minBet database.PokerChip) int { if p.GetBet() < minBet { msg := fmt.Sprintf("Need to bet %d", minBet-p.GetBet()) - PokerPubSub.Pub(roomUserTopic, ErrorMsgEvent{Message: msg}) + PokerPubSub.Pub(g.RoomID.UserTopic(p.Username), ErrorMsgEvent{Message: msg}) return continueGetPlayerEventLoop } g.newLogEvent(fmt.Sprintf("%s check", p.Username)) @@ -739,9 +739,9 @@ func applyAutoAction(g *PokerGame, p *PokerPlayer, db *database.DkfDB, minBet da switch autoAction.action { case NoAction: case FoldAction: - actionResult = doFold(g, p, playerAlive, roomUserTopic) + actionResult = doFold(g, p, playerAlive) case CheckAction: - actionResult = doCheck(g, p, minBet, roomUserTopic) + actionResult = doCheck(g, p, minBet) case CallAction: actionResult = doCall(g, p, db, minBet, newlyAllInPlayers, pokerTableID) case BetAction: