commit f03b652ab4ebc9a05a5e312c64b256929a6732d8
parent 83085f48a8e513f54c242d0f73c9e7ab7b79a0e3
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Fri, 8 Dec 2023 15:56:05 -0500
fix all-in
Diffstat:
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -515,6 +515,10 @@ OUTER:
} else if evt.AllIn {
bet := p.Cash
+ if (p.Bet + bet) > minBet {
+ lastRaisePlayerIdx = p.SeatIdx
+ }
+ minBet = p.Bet + bet
p.doBet(bet)
PokerPubSub.Pub(roomTopic, PlayerBetEvent{PlayerIdx: p.SeatIdx, Player: p.Username, Bet: bet, TotalBet: p.Bet, Cash: p.Cash})
logMsg := fmt.Sprintf("%s all-in (%d)", p.Username, bet)
@@ -1207,6 +1211,7 @@ func buildSeatsHtml(g *PokerGame) string {
for i, p := range g.Players {
seats += `<div id="seat` + itoa(i+1) + `"></div>`
seats += `<div id="seat` + itoa(i+1) + `_cash"></div>`
+ seats += `<div id="seat` + itoa(i+1) + `Pot"></div>`
if p != nil {
seats += `<style>#seat` + itoa(i+1) + `:before { content: "` + p.Username + `"; }</style>`
seats += `<style>#seat` + itoa(i+1) + `_cash:before { content: "` + itoa(p.Cash) + `"; }</style>`
@@ -1634,12 +1639,6 @@ func PokerHandler(c echo.Context) error {
send(buildYourCardsHtml(authUser, g))
send(`<iframe src="/poker/` + roomID + `/logs" id="eventLogs"></iframe>`)
send(`<div id="errorMsg"></div>`)
- send(`<div id="seat1Pot"></div>`) // TODO
- send(`<div id="seat2Pot"></div>`) // TODO
- send(`<div id="seat3Pot"></div>`) // TODO
- send(`<div id="seat4Pot"></div>`) // TODO
- send(`<div id="seat5Pot"></div>`) // TODO
- send(`<div id="seat6Pot"></div>`) // TODO
send(buildMainPotHtml(g))
send(buildWinnerHtml())
send(buildCountdownsHtml())