aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/game/http.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-05 03:07:30 +0900
committernsfisis <nsfisis@gmail.com>2024-08-05 03:07:30 +0900
commit9ff9c151e5defd9eed5cba3c88bc341b4360d09c (patch)
treebf5b9e721274ffa58df66823d39f9ceadebc9f98 /backend/game/http.go
parentff959dadb1f990173b9df3105ccfc96b1c6c092e (diff)
parent498ad23eaaae1e856c71f44ad0bf3912a6d7e5b7 (diff)
downloadphperkaigi-2025-albatross-9ff9c151e5defd9eed5cba3c88bc341b4360d09c.tar.gz
phperkaigi-2025-albatross-9ff9c151e5defd9eed5cba3c88bc341b4360d09c.tar.zst
phperkaigi-2025-albatross-9ff9c151e5defd9eed5cba3c88bc341b4360d09c.zip
Merge branch 'feat/multiplayer-mode'
Diffstat (limited to 'backend/game/http.go')
-rw-r--r--backend/game/http.go5
1 files changed, 5 insertions, 0 deletions
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())
}