commit ff69691e3718498a1ff5e782f9a5f2b23229ad4b
parent 2bce00c0697157f4712e9ffd862f67ae2f5b0a5b
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 11 Dec 2023 03:23:01 -0500
cleanup
Diffstat:
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -736,8 +736,7 @@ func dealerThread(db *database.DkfDB, g *PokerGame, roomID string) {
burnIdx++
}
- dealCardIdx := 0
- dealCard := func() {
+ dealCard := func(dealCardIdx int) {
card := g.Ongoing.Deck[idx]
idx++
evt := PokerEvent{
@@ -751,7 +750,6 @@ func dealerThread(db *database.DkfDB, g *PokerGame, roomID string) {
PokerPubSub.Pub(roomTopic, evt)
g.Ongoing.AddEvent(evt)
g.Ongoing.CommunityCards = append(g.Ongoing.CommunityCards, card)
- dealCardIdx++
}
PokerPubSub.Pub(roomTopic, GameStartedEvent{DealerIdx: int(g.DealerIdx.Load())})
@@ -787,7 +785,7 @@ func dealerThread(db *database.DkfDB, g *PokerGame, roomID string) {
burnCard()
for i := 1; i <= 3; i++ {
time.Sleep(time.Second)
- dealCard()
+ dealCard(i)
}
// Wait for players to bet/call/check/fold...
@@ -800,7 +798,7 @@ func dealerThread(db *database.DkfDB, g *PokerGame, roomID string) {
time.Sleep(time.Second)
burnCard()
time.Sleep(time.Second)
- dealCard()
+ dealCard(4)
// Wait for players to bet/call/check/fold...
time.Sleep(time.Second)
@@ -812,7 +810,7 @@ func dealerThread(db *database.DkfDB, g *PokerGame, roomID string) {
time.Sleep(time.Second)
burnCard()
time.Sleep(time.Second)
- dealCard()
+ dealCard(5)
// Wait for players to bet/call/check/fold...
time.Sleep(time.Second)