1
0
mirror of https://github.com/thib8956/tic-tac-toe-ws.git synced 2025-02-21 16:28:15 +00:00

fix: send game reset message to the spectators

This commit is contained in:
Thibaud Gasser 2025-01-30 00:00:55 +01:00
parent 29a587c115
commit 2aea53ce63

View File

@ -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) {