diff --git a/server/index.ts b/server/index.ts index aadcb4f..e5e8b35 100644 --- a/server/index.ts +++ b/server/index.ts @@ -23,12 +23,12 @@ const server = Bun.serve({ open(ws) { // register newly connected client and tell them how many other people are there console.log('Connection opened', ws.data.clientId) - clients.set(ws.data.clientId, ws) const enterNotice = JSON.stringify({ type: 'presence-information', others: clients.size, }) - for (const [uuid, client] of clients.entries()) { + clients.set(ws.data.clientId, ws) + for (const client of clients.values()) { client.send(enterNotice, true) } },