"Quick Jump" feature along with some European servers

This commit is contained in:
Cryptkeeper
2015-11-25 16:40:13 -06:00
parent 1daa20d5ab
commit f516bc9f15
5 changed files with 78 additions and 14 deletions

8
app.js
View File

@ -42,11 +42,11 @@ function pingAll() {
server.io.sockets.emit('update', networkSnapshot);
// Log our response.
if (!networkHistory[network.ip]) {
networkHistory[network.ip] = [];
if (!networkHistory[network.name]) {
networkHistory[network.name] = [];
}
var _networkHistory = networkHistory[network.ip];
var _networkHistory = networkHistory[network.name];
// Remove our previous data that we don't need anymore.
for (var i = 0; i < _networkHistory.length; i++) {
@ -111,6 +111,8 @@ server.start(function() {
// Remap our associative array into just an array.
var networkHistoryKeys = Object.keys(networkHistory);
networkHistoryKeys.sort();
// Send each individually, this should look cleaner than waiting for one big array to transfer.
for (var i = 0; i < networkHistoryKeys.length; i++) {
client.emit('add', [networkHistory[networkHistoryKeys[i]]]);