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:
		@@ -141,7 +141,6 @@ io.on('connection', function(socket){
 | 
			
		||||
 | 
			
		||||
	var socketid = socket.id;
 | 
			
		||||
	var coll;
 | 
			
		||||
	var tot_lists = [];
 | 
			
		||||
	var in_list = false;
 | 
			
		||||
	var short_id = uniqueID(socketid,4);
 | 
			
		||||
	var offline = false;
 | 
			
		||||
@@ -157,6 +156,19 @@ io.on('connection', function(socket){
 | 
			
		||||
 | 
			
		||||
	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) {
 | 
			
		||||
		try {
 | 
			
		||||
			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){
 | 
			
		||||
	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)
 | 
			
		||||
{
 | 
			
		||||
	if(lists[coll] !== undefined && contains(lists[coll], guid))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user