From a84fe0577d503468636af913198d9d3bb12921f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Thu, 14 May 2015 14:26:41 +0200 Subject: [PATCH] Fixed variable error --- server/server.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server/server.js b/server/server.js index b73bc52a..704e932f 100755 --- a/server/server.js +++ b/server/server.js @@ -48,14 +48,14 @@ io.on('connection', function(socket){ }); socket.on('chat', function (data) { - check_inlist(coll, guid, socket); + check_inlist(coll, guid, socket, name); if(data != "" && data !== undefined && data !== null && data.length < 151 && data.replace(/\s/g, '').length) io.sockets.emit('chat,'+coll, name + ": " + data); }); socket.on("all,chat", function(data) { - check_inlist(coll, guid, socket); + check_inlist(coll, guid, socket, name); if(data != "" && data !== undefined && data !== null && data.length < 151 && data.replace(/\s/g, '').length) io.sockets.emit('chat.all', [name + ": " + data, coll]); }); @@ -114,7 +114,7 @@ io.on('connection', function(socket){ console.log(name + " joined list " + coll); - check_inlist(coll, guid, socket); + check_inlist(coll, guid, socket, name); io.sockets.emit(coll+",viewers", lists[coll].length); @@ -144,7 +144,7 @@ io.on('connection', function(socket){ { if(id !== undefined && id !== null && id != "") { - check_inlist(coll, guid, socket); + check_inlist(coll, guid, socket, name); db.collection(coll).find({now_playing:true}, function(err, np){ //console.log(docs); @@ -209,7 +209,7 @@ io.on('connection', function(socket){ { if(arr !== undefined && arr !== null && arr != "") { - check_inlist(coll, guid, socket); + check_inlist(coll, guid, socket, name); var id = arr[0]; var title = arr[1]; @@ -250,7 +250,7 @@ io.on('connection', function(socket){ { if(msg !== undefined && msg !== null) { - check_inlist(coll, guid, socket); + check_inlist(coll, guid, socket, name); if(msg[2] == "del") del(msg, socket); @@ -280,7 +280,7 @@ io.on('connection', function(socket){ pw = inp[0]; coll = inp[1]; //guid = inp[2]; - check_inlist(coll, guid, socket); + check_inlist(coll, guid, socket, name); //console.log(coll); db.collection(coll).find({views:{$exists:true}}, function(err, docs){ @@ -305,7 +305,7 @@ io.on('connection', function(socket){ { if(list !== undefined && list !== null && list != "") { - check_inlist(coll, guid, socket); + check_inlist(coll, guid, socket, name); adminpass = ""; @@ -360,7 +360,7 @@ io.on('connection', function(socket){ { if(params !== undefined && params !== null && params != "") { - check_inlist(coll, guid, socket); + check_inlist(coll, guid, socket,name); var voting = params[0]; var addsongs = params[1]; @@ -410,7 +410,7 @@ io.on('connection', function(socket){ { if(pass !== undefined && pass !== null && pass != "") { - check_inlist(coll, guid, socket); + check_inlist(coll, guid, socket, name); var hash = hash_pass(pass); db.collection(coll).find({views:{$exists:true}}, function(err, docs){ @@ -460,7 +460,7 @@ io.on('connection', function(socket){ socket.on('pos', function() { - check_inlist(coll, guid, socket); + check_inlist(coll, guid, socket, name); send_play(coll, socket); }); }); @@ -479,7 +479,7 @@ function del(params, socket) }); } -function check_inlist(coll, guid, socket) +function check_inlist(coll, guid, socket, name) { if(lists[coll] == undefined) {