Merge branch 'master' of gitea.moe:lamp/piano
This commit is contained in:
commit
3e5296ac25
@ -33,9 +33,10 @@ wss.on("connection", (ws, req) => {
|
||||
}
|
||||
let t = Array.from(wss.clients).map(ws => ws.user.id);
|
||||
for (let i = 0; i < 256; i++) if (!t.includes(i)) { ws.user.id = i; break; }
|
||||
if (!ws.user.id) return ws.close();
|
||||
|
||||
console.log("join", ws.user);
|
||||
|
||||
|
||||
ws.send(JSON.stringify({
|
||||
type: "load",
|
||||
id: ws.user.id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user