dkforest

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

commit 6c8520cff34e29d38820f6a16841aa14704173af
parent 34bfc7ac505dce236d73f96cf7b0a5a31437dc00
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue, 19 Dec 2023 02:00:21 -0500

cleanup

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

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -538,7 +538,12 @@ func newOngoing(g *PokerGame) *Ongoing { } } }) - return &Ongoing{deck: generateDeck(), players: players, waitTurnEvent: utils.NewRWMtx(PokerWaitTurnEvent{Idx: -1}), createdAt: time.Now()} + return &Ongoing{ + deck: generateDeck(), + players: players, + waitTurnEvent: utils.NewRWMtx(PokerWaitTurnEvent{Idx: -1}), + createdAt: time.Now(), + } } func (g *PokerGame) newLogEvent(msg string) { @@ -1092,6 +1097,8 @@ func computeAllInMaxGain(ongoing *Ongoing, newlyAllInPlayers []*pokerPlayer, mai } func dealerThread(g *PokerGame) { + g.Ongoing = newOngoing(g) + roomID := g.roomID roomTopic := roomID.Topic() bigBlindBet := g.PokerTableMinBet @@ -1437,8 +1444,6 @@ func (g *PokerGame) Deal(roomID RoomID, userID database.UserID) { PokerPubSub.Pub(roomTopic, ResetCardsEvent{}) time.Sleep(time.Second) - g.Ongoing = newOngoing(g) - go dealerThread(g) }