mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed variable error
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user