mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Trying fix for dead listeners
This commit is contained in:
2
server/public/assets/dist/embed.min.js
vendored
2
server/public/assets/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
2
server/public/assets/dist/main.min.js
vendored
2
server/public/assets/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -151,6 +151,12 @@ $().ready(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
socket.on("self_ping", function() {
|
||||||
|
if(chan != undefined && chan.toLowerCase() != "") {
|
||||||
|
socket.emit("self_ping", {channel: chan.toLowerCase()});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
setup_no_connection_listener();
|
setup_no_connection_listener();
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|||||||
@@ -141,7 +141,6 @@ io.on('connection', function(socket){
|
|||||||
|
|
||||||
var socketid = socket.id;
|
var socketid = socket.id;
|
||||||
var coll;
|
var coll;
|
||||||
var tot_lists = [];
|
|
||||||
var in_list = false;
|
var in_list = false;
|
||||||
var short_id = uniqueID(socketid,4);
|
var short_id = uniqueID(socketid,4);
|
||||||
var offline = false;
|
var offline = false;
|
||||||
@@ -157,6 +156,19 @@ io.on('connection', function(socket){
|
|||||||
|
|
||||||
socket.emit("guid", guid);
|
socket.emit("guid", guid);
|
||||||
|
|
||||||
|
socket.on('self_ping', function(msg) {
|
||||||
|
var channel = msg.channel;
|
||||||
|
if(offline) {
|
||||||
|
offline_users.push(guid);
|
||||||
|
} else {
|
||||||
|
if(lists[channel] == undefined) {
|
||||||
|
lists[channel] = [];
|
||||||
|
}
|
||||||
|
lists[channel].push(guid);
|
||||||
|
}
|
||||||
|
tot_view += 1
|
||||||
|
});
|
||||||
|
|
||||||
socket.on('chromecast', function(msg) {
|
socket.on('chromecast', function(msg) {
|
||||||
try {
|
try {
|
||||||
if(typeof(msg) == "object" && msg.hasOwnProperty("guid") && msg.hasOwnProperty("socket_id") && msg.hasOwnProperty("channel")) {
|
if(typeof(msg) == "object" && msg.hasOwnProperty("guid") && msg.hasOwnProperty("socket_id") && msg.hasOwnProperty("channel")) {
|
||||||
@@ -1155,9 +1167,10 @@ io.on('connection', function(socket){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
send_ping();
|
||||||
|
|
||||||
function decrypt_string(socket_id, pw){
|
function decrypt_string(socket_id, pw){
|
||||||
try {
|
try {
|
||||||
/*
|
/*
|
||||||
@@ -1196,6 +1209,14 @@ function decrypt_string(socket_id, pw){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function send_ping() {
|
||||||
|
lists = {};
|
||||||
|
offline_users = [];
|
||||||
|
tot_view = 0;
|
||||||
|
io.emit("self_ping");
|
||||||
|
setTimeout(send_ping, 25000);
|
||||||
|
}
|
||||||
|
|
||||||
function left_channel(coll, guid, name, short_id, in_list, socket, change)
|
function left_channel(coll, guid, name, short_id, in_list, socket, change)
|
||||||
{
|
{
|
||||||
if(lists[coll] !== undefined && contains(lists[coll], guid))
|
if(lists[coll] !== undefined && contains(lists[coll], guid))
|
||||||
|
|||||||
Reference in New Issue
Block a user