From 18fb6ba18832b4de9b223342481159186ac85133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Sat, 18 Apr 2015 17:21:18 +0200 Subject: [PATCH] Fixed multiplying viewers from same computer --- server/server.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/server.js b/server/server.js index ea20eade..9b02ec5a 100755 --- a/server/server.js +++ b/server/server.js @@ -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){} } });