From 2aea53ce630f8a672c77a9e87f020da5137c5e91 Mon Sep 17 00:00:00 2001 From: Thibaud Date: Thu, 30 Jan 2025 00:00:55 +0100 Subject: [PATCH] fix: send game reset message to the spectators --- server.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.ts b/server.ts index d25a758..9484b08 100644 --- a/server.ts +++ b/server.ts @@ -81,6 +81,12 @@ wss.on("connection", (ws, req) => { kind: "reset" } as Message)); } + + for (const s of spectators) { + s.send(JSON.stringify({ + kind: "reset" + } as Message)); + } } if (clients.length < 2 || player.id != currentPlayer?.id || endGame) {