Explorar el Código

enable volatile broadcasts

master
idlewinn hace 5 años
padre
commit
bac40c1c04
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5
    0
      src/index.ts

+ 5
- 0
src/index.ts Ver fichero

@@ -48,6 +48,11 @@ io.on("connection", socket => {
48 48
     }
49 49
   );
50 50
 
51
+  socket.on("server-volatile-broadcast", (roomID: string, encryptedData: ArrayBuffer, iv: Uint8Array) => {
52
+    console.log(`${socket.id} sends volatile update to ${roomID}`);
53
+    socket.volatile.broadcast.to(roomID).emit("client-broadcast", encryptedData, iv);
54
+  });
55
+
51 56
   socket.on("disconnecting", () => {
52 57
     const rooms = io.sockets.adapter.rooms;
53 58
     for (const roomID in socket.rooms) {

Loading…
Cancelar
Guardar