|
@@ -48,7 +48,7 @@ io.on("connection", (socket) => {
|
48
|
48
|
}
|
49
|
49
|
io.in(roomID).emit(
|
50
|
50
|
"room-user-change",
|
51
|
|
- Object.keys(io.sockets.adapter.rooms[roomID].sockets)
|
|
51
|
+ Object.keys(io.sockets.adapter.rooms[roomID].sockets),
|
52
|
52
|
);
|
53
|
53
|
});
|
54
|
54
|
|
|
@@ -57,7 +57,7 @@ io.on("connection", (socket) => {
|
57
|
57
|
(roomID: string, encryptedData: ArrayBuffer, iv: Uint8Array) => {
|
58
|
58
|
socketDebug(`${socket.id} sends update to ${roomID}`);
|
59
|
59
|
socket.broadcast.to(roomID).emit("client-broadcast", encryptedData, iv);
|
60
|
|
- }
|
|
60
|
+ },
|
61
|
61
|
);
|
62
|
62
|
|
63
|
63
|
socket.on(
|
|
@@ -67,14 +67,14 @@ io.on("connection", (socket) => {
|
67
|
67
|
socket.volatile.broadcast
|
68
|
68
|
.to(roomID)
|
69
|
69
|
.emit("client-broadcast", encryptedData, iv);
|
70
|
|
- }
|
|
70
|
+ },
|
71
|
71
|
);
|
72
|
72
|
|
73
|
73
|
socket.on("disconnecting", () => {
|
74
|
74
|
const rooms = io.sockets.adapter.rooms;
|
75
|
75
|
for (const roomID in socket.rooms) {
|
76
|
76
|
const clients = Object.keys(rooms[roomID].sockets).filter(
|
77
|
|
- (id) => id !== socket.id
|
|
77
|
+ (id) => id !== socket.id,
|
78
|
78
|
);
|
79
|
79
|
if (clients.length > 0) {
|
80
|
80
|
socket.broadcast.to(roomID).emit("room-user-change", clients);
|