commit b3a50f6eb49e50001c6db77d441ff7710351ec27
parent 4426c979bf001cf5d39f9297b587e71da10dbd50
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 4 Dec 2023 17:57:10 -0500
cleanup
Diffstat:
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/pkg/web/handlers/poker.go b/pkg/web/handlers/poker.go
@@ -347,12 +347,6 @@ func buildSeatsHtml(g *PokerGame) string {
}
func PokerHandler(c echo.Context) error {
- // players 2-10
- // $5 -> 1000 chips
- // generate deck
- // hash the deck and show hash
- //return c.Render(http.StatusOK, "poker", nil)
-
roomID := c.Param("roomID")
g := PokerInstance.GetOrCreateGame(roomID)
@@ -369,9 +363,10 @@ func PokerHandler(c echo.Context) error {
deckSha256 := utils.Sha256([]byte(deckStr))
quit := hutils.CloseSignalChan(c)
- myTopic := "room_" + roomID
+ roomTopic := "room_" + roomID
+ roomUserTopic := "room_" + roomID + "_" + authUser.ID.String()
- sub := PokerPubSub.Subscribe([]string{myTopic})
+ sub := PokerPubSub.Subscribe([]string{roomTopic, roomUserTopic})
defer sub.Close()
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTMLCharsetUTF8)
@@ -553,6 +548,7 @@ Loop:
#` + payload.ID + ` .card .inner:before { content: "` + payload.Name + `"; color: ` + color + `; }
</style>`)
c.Response().Flush()
+ continue
}
}
return nil