From 88a5c8fea0fdc9fd3650f8e80709c336358ccf1c Mon Sep 17 00:00:00 2001 From: Mark Nadal Date: Mon, 30 Dec 2019 11:57:28 -0800 Subject: [PATCH] .open / .load opt meta , axe mob , music -> wave --- axe.js | 4 +- examples/docs.html | 6 +-- lib/open.js | 5 +- lib/server.js | 2 +- lib/{music.js => wave.js} | 107 +++++++++++++++++++++++++++++++------- test/panic/4dht.js | 16 ++++-- 6 files changed, 109 insertions(+), 31 deletions(-) rename lib/{music.js => wave.js} (93%) diff --git a/axe.js b/axe.js index b9939c03..825e5e90 100644 --- a/axe.js +++ b/axe.js @@ -287,7 +287,9 @@ if(peer.url){ return } // I am assuming that if we are wanting to make an outbound connection to them, that we don't ever want to drop them unless our actual config settings change. var count = Object.keys(opt.peers).length; if(opt.mob >= count){ return } // TODO: Make dynamic based on RAM/CPU also. Or possibly even weird stuff like opt.mob / axe.up length? - mesh.say({dam: 'mob', mob: count, peers: Object.keys(axe.up)}, peer); + var peers = Object.keys(axe.up); + if(!peers.length){ return } + mesh.say({dam: 'mob', mob: count, peers: peers}, peer); //setTimeout(function(){ mesh.bye(peer) }, 9); // something with better perf? // UNCOMMENT WHEN WE ACTIVATE THIS FEATURE }); at.on('bye', function(peer){ diff --git a/examples/docs.html b/examples/docs.html index f0d734e2..1d23ae98 100644 --- a/examples/docs.html +++ b/examples/docs.html @@ -33,7 +33,7 @@ - +