mirror of
https://github.com/thib8956/tic-tac-toe-ws.git
synced 2025-02-22 16:58:14 +00:00
fix: send game reset message to the spectators
This commit is contained in:
parent
29a587c115
commit
2aea53ce63
@ -81,6 +81,12 @@ wss.on("connection", (ws, req) => {
|
|||||||
kind: "reset"
|
kind: "reset"
|
||||||
} as Message));
|
} as Message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const s of spectators) {
|
||||||
|
s.send(JSON.stringify({
|
||||||
|
kind: "reset"
|
||||||
|
} as Message));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clients.length < 2 || player.id != currentPlayer?.id || endGame) {
|
if (clients.length < 2 || player.id != currentPlayer?.id || endGame) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user