This commit is contained in:
Arne van Iterson 2020-11-27 19:08:58 +01:00
commit 44b3a6ff60
2 changed files with 3050 additions and 1 deletions

3044
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -139,6 +139,13 @@ io.on("connection", (socket) => {
});
}
});
socket.on("spectate", (data) => {
if (io.sockets.adapter.rooms.has(data)) {
console.log(traffic.in + colours.connect(`User ${String(socket.id)} is spectating room ${data}`));
socket.join(data);
}
});
});
http.listen(port, () => {