dkforest

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

commit 69bf027af0e821e5d2674760a92bd69bbc392d4d
parent 70542a9b850a8eb2edcfe59771617bd1d71b58a8
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat,  9 Dec 2023 05:53:10 -0500

cleanup

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

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -305,7 +305,6 @@ func (g *PokerGame) UnSitPlayer(db *database.DkfDB, authUser *database.User, roo for i, p := range g.Players { if p != nil && p.Username == authUser.Username.String() { - fmt.Println("UNSIT ????", p.Cash) authUser.ChipsTest += p.Cash authUser.DoSave(db) @@ -353,7 +352,6 @@ func (g *PokerGame) SitPlayer(db *database.DkfDB, authUser *database.User, pos i chips := utils.MinInt(authUser.ChipsTest, 2000) authUser.ChipsTest -= chips authUser.DoSave(db) - fmt.Println("SIT ???", chips) g.Players[pos] = &PokerStandingPlayer{Username: authUser.Username.String(), Cash: chips} return nil } @@ -1311,6 +1309,8 @@ func buildSeatsHtml(g *PokerGame, authUser *database.User, roomID string) (html } } else { html += `#seat` + itoa(i+1) + ` { border: 1px solid #333; }` + html += `#seat` + itoa(i+1) + ` .inner:before { content: ""; }` + html += `#seat` + itoa(i+1) + `_cash:before { content: ""; }` } } html += `</style>` @@ -1334,6 +1334,11 @@ func drawSeatsHtml(authUser *database.User, g *PokerGame) string { } html += `#seat` + itoa(i+1) + ` .inner:before { content: "` + p.Username + `"; }` html += `#seat` + itoa(i+1) + `_cash:before { content: "` + itoa(p.getDisplayCash(g)) + `"; }` + if g.Ongoing != nil { + if op := g.Ongoing.GetPlayer(p.Username); op != nil && op.Bet > 0 { + html += `#seat` + itoa(i+1) + `Pot:before { content: "` + itoa(op.Bet) + `"; }` + } + } } else { html += `#seat` + itoa(i+1) + ` { border: 1px solid #333; }` html += `#seat` + itoa(i+1) + ` .inner:before { content: ""; }`