commit 481410afaf3f3b4a0d8c158d1362ca30d0fa1e36
parent a71b1f1e38df7f74137a0543440dbc0d224b79c2
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 18 Dec 2023 14:22:28 -0500
cleanup
Diffstat:
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -1613,11 +1613,11 @@ func buildPayloadHtml(g *PokerGame, authUser *database.User, payload any) (html
return
}
-func buildGameDiv(g *PokerGame, authUser *database.User, playerBuyIn database.PokerChip) (html string) {
+func buildGameDiv(g *PokerGame, authUser *database.User) (html string) {
roomID := g.RoomID
html += `<div id="game">`
html += `<div id="table"></div>`
- html += buildSeatsHtml(g, authUser, playerBuyIn)
+ html += buildSeatsHtml(g, authUser)
html += buildCardsHtml()
html += buildActionsDiv(roomID)
html += buildDealerTokenHtml(g)
@@ -1628,14 +1628,14 @@ func buildGameDiv(g *PokerGame, authUser *database.User, playerBuyIn database.Po
return
}
-func buildBaseHtml(g *PokerGame, authUser *database.User, playerBuyIn database.PokerChip) (html string) {
+func buildBaseHtml(g *PokerGame, authUser *database.User) (html string) {
ongoing := g.Ongoing
roomID := g.RoomID
html += hutils.HtmlCssReset
html += pokerCss
//html += `<script>document.onclick = function(e) { console.log(e.x, e.y); };</script>` // TODO: dev only
//html += buildDevHtml()
- html += buildGameDiv(g, authUser, playerBuyIn)
+ html += buildGameDiv(g, authUser)
html += buildSoundsHtml(authUser)
html += buildHelpHtml()
html += `<iframe src="/poker/` + roomID.String() + `/logs" id="eventLogs"></iframe>`
@@ -1815,7 +1815,7 @@ func buildActionsDiv(roomID RoomID) (html string) {
return
}
-func buildSeatsHtml(g *PokerGame, authUser *database.User, playerBuyIn database.PokerChip) (html string) {
+func buildSeatsHtml(g *PokerGame, authUser *database.User) (html string) {
g.Players.RWith(func(gPlayers *[]*SeatedPlayer) {
for i := range *gPlayers {
html += `<div id="seat` + itoa(i+1) + `Pot" class="seatPot"></div>`
@@ -1823,7 +1823,7 @@ func buildSeatsHtml(g *PokerGame, authUser *database.User, playerBuyIn database.
html += `<div>`
for i := range *gPlayers {
html += `<div class="seat" id="seat` + itoa(i+1) + `">
-<iframe src="/poker/` + g.RoomID.String() + `/sit/` + itoa(i+1) + `?buy-in=` + itoa2(playerBuyIn) + `" class="takeSeat takeSeat` + itoa(i+1) + `"></iframe>`
+<iframe src="/poker/` + g.RoomID.String() + `/sit/` + itoa(i+1) + `" class="takeSeat takeSeat` + itoa(i+1) + `"></iframe>`
html += ` <div class="inner"></div>`
html += ` <div id="seat` + itoa(i+1) + `_cash" class="cash"></div>`
html += `</div>`
@@ -2325,9 +2325,7 @@ func PokerHandler(c echo.Context) error {
sub := PokerPubSub.Subscribe([]string{roomTopic, roomUserTopic})
defer sub.Close()
- playerBuyIn := database.PokerChip(utils.DoParseUint64(c.QueryParam("buy-in")))
-
- send(buildBaseHtml(g, authUser, playerBuyIn))
+ send(buildBaseHtml(g, authUser))
c.Response().Flush()
Loop: