Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mute-server

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mute-server - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

32

lib/socket-io-adapter.js

@@ -79,8 +79,23 @@ /*

socket.on('disconnect', function () {
network.connected[socket.room][socket.replicaNumber]--;
console.log('Il reste que : ', network.connected);
if(network.connected[socket.room][socket.replicaNumber] === 0) {
var i = 0;
var key;
// Remove the socket for this replica number
if(network.connected[socket.room] !== null && network.connected[socket.room] !== undefined
&& network.connected[socket.room][socket.replicaNumber] !== null
&& network.connected[socket.room][socket.replicaNumber] !== undefined
&& network.connected[socket.room][socket.replicaNumber][socket.id] !== null
&& network.connected[socket.room][socket.replicaNumber][socket.id] !== undefined) {
delete network.connected[socket.room][socket.replicaNumber][socket.id];
}
for(key in network.connected[socket.room][socket.replicaNumber]) {
i++;
}
// If the replica number references no socketID
// Delete it
if(i === 0) {
network.emit('disconnect', { replicaNumber: socket.replicaNumber, docID: socket.room });
network.io.sockets.in(socket.room).emit('userLeft', { replicaNumber: socket.replicaNumber });
delete network.connected[socket.room][socket.replicaNumber];
console.log('Il reste que : ', network.connected);
}

@@ -101,9 +116,8 @@ });

if(network.connected[args.socket.room][args.replicaNumber] !== null
&& network.connected[args.socket.room][args.replicaNumber] !== undefined) {
network.connected[args.socket.room][args.replicaNumber]++;
if(network.connected[socket.room] === null || network.connected[socket.room] === undefined
|| network.connected[socket.room][socket.replicaNumber] === null
|| network.connected[socket.room][socket.replicaNumber] === undefined) {
network.connected[socket.room][socket.replicaNumber] = {};
}
else {
network.connected[args.socket.room][args.replicaNumber] = 1;
}
network.connected[socket.room][socket.replicaNumber][socket.id] = true;

@@ -110,0 +124,0 @@ infosUsersModule.addUser(args.socket.room, args.replicaNumber, args.username);

{
"name": "mute-server",
"version": "0.1.3",
"version": "0.1.4",
"description": "Server-side application creating a data-structure representing a text and initializing a network to allow clients to edit the text and broadcast theirs changes in real-time",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc