aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/game/http.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-05 02:36:50 +0900
committernsfisis <nsfisis@gmail.com>2024-08-05 03:02:18 +0900
commitdb6207a42296867d73ce5e960ee8542f84be3ebe (patch)
tree55db1c345c6e195017f370c0c399d5cc3d42b66e /backend/game/http.go
parent968b835d0e6fe960c3d7ab915ef6d9cecec4ab7f (diff)
downloadiosdc-japan-2024-albatross-db6207a42296867d73ce5e960ee8542f84be3ebe.tar.gz
iosdc-japan-2024-albatross-db6207a42296867d73ce5e960ee8542f84be3ebe.tar.zst
iosdc-japan-2024-albatross-db6207a42296867d73ce5e960ee8542f84be3ebe.zip
feat(backend): disallow to connect to watch page in 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())
}