ws-events-and-middlewares
Advanced tools
Comparing version 1.0.16 to 1.0.17
13
index.js
@@ -17,2 +17,3 @@ const Emitter = require('component-emitter') | ||
var onopenHandlers = [] | ||
let mySocketId = null | ||
@@ -80,3 +81,3 @@ async function onmessage (event) { | ||
function onclose (event) { | ||
delete clients[sock.id] | ||
delete clients[events.id] | ||
listeners.emit('close', event) | ||
@@ -121,3 +122,3 @@ } | ||
} | ||
rooms[room].push(sock.id) | ||
rooms[room].push(events.id) | ||
} | ||
@@ -130,3 +131,3 @@ | ||
const index = rooms[room].indexOf(sock.id) | ||
const index = rooms[room].indexOf(events.id) | ||
if (index > -1) { | ||
@@ -139,3 +140,3 @@ rooms[room].splice(index, 1) | ||
Object.keys(rooms).map(room => { | ||
const index = rooms[room].indexOf(sock.id) | ||
const index = rooms[room].indexOf(events.id) | ||
if (index > -1) { | ||
@@ -186,2 +187,4 @@ rooms[room].splice(index, 1) | ||
console.log('[ws-events] Se ha conectado un nuevo usuario') | ||
let found = false | ||
@@ -194,4 +197,6 @@ while (!found) { | ||
clients[id] = events | ||
mySocketId = id | ||
} | ||
} | ||
} | ||
@@ -198,0 +203,0 @@ |
{ | ||
"name": "ws-events-and-middlewares", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "ws module wrapper to provide events", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9699
169