Fixed multiplying viewers from same computer

This commit is contained in:
Kasper Rynning-Tønnesen
2015-04-18 17:19:56 +02:00
parent b43d9f4ab0
commit 591ec4e028
2 changed files with 3 additions and 3 deletions

View File

@@ -78,11 +78,11 @@ io.on('connection', function(socket){
coll = list[0].toLowerCase();
guid = list[1];
if(lists[coll] == undefined)
if(lists[coll] == undefined && !contains(lists[coll], guid))
{
lists[coll] = [];
lists[coll].push(guid);
}else lists[coll].push(guid);
}else if(!contains(lists[coll], guid)) lists[coll].push(guid);
io.sockets.emit(coll+",viewers", lists[coll].length);