Fixed multiplying viewers from same computer

This commit is contained in:
Kasper Rynning-Tønnesen
2015-04-18 17:21:18 +02:00
parent 591ec4e028
commit 18fb6ba188

View File

@@ -335,9 +335,12 @@ io.on('connection', function(socket){
{
try
{
var index = lists[coll].indexOf(guid);
lists[coll].splice(index, 1);
io.sockets.emit(coll+",viewers", lists[coll].length);
if(contains(lists[coll], guid))
{
var index = lists[coll].indexOf(guid);
lists[coll].splice(index, 1);
io.sockets.emit(coll+",viewers", lists[coll].length);
}
}catch(err){}
}
});