From db6207a42296867d73ce5e960ee8542f84be3ebe Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 5 Aug 2024 02:36:50 +0900 Subject: feat(backend): disallow to connect to watch page in multiplayer mode --- backend/game/http.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'backend/game/http.go') diff --git a/backend/game/http.go b/backend/game/http.go index f9036c5..865c724 100644 --- a/backend/game/http.go +++ b/backend/game/http.go @@ -56,5 +56,10 @@ func (h *sockHandler) HandleSockGolfWatch(c echo.Context) error { if hub == nil { return echo.NewHTTPError(http.StatusNotFound, "Game not found") } + + if hub.game.gameType != gameType1v1 { + return echo.NewHTTPError(http.StatusBadRequest, "Only 1v1 game is supported") + } + return serveWatcherWs(hub, c.Response(), c.Request()) } -- cgit v1.2.3-70-g09d2