From 695e70f4c75945edd39d4898d903a74c5da8832d Mon Sep 17 00:00:00 2001 From: Cryptkeeper Date: Tue, 24 Nov 2015 00:24:10 -0600 Subject: [PATCH] Improve loading --- app.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 88e15bc..d3dd4b6 100644 --- a/app.js +++ b/app.js @@ -101,15 +101,14 @@ server.start(function() { logger.log('info', 'Accepted connection: %s, total clients: %d', client.request.connection.remoteAddress, connectedClients); // Remap our associative array into just an array. - var networkHistoryList = []; var networkHistoryKeys = Object.keys(networkHistory); + // Send each individually, this should look cleaner than waiting for one big array to transfer. for (var i = 0; i < networkHistoryKeys.length; i++) { - networkHistoryList.push(networkHistory[networkHistoryKeys[i]]); + client.emit('add', [networkHistory[networkHistoryKeys[i]]]); } // Send them our previous data, so they have somewhere to start. - client.emit('add', networkHistoryList); client.emit('updateMojangServices', mojang.toMessage()); // Attach our listeners.