From 6d8ab212e01f78d40f43d4245b585fedeb0e1daf Mon Sep 17 00:00:00 2001 From: Cryptkeeper Date: Mon, 1 Feb 2016 04:58:05 -0600 Subject: [PATCH] Fix incorrect IP references --- app.js | 1 + assets/js/site.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 8114766..7b235c1 100644 --- a/app.js +++ b/app.js @@ -113,6 +113,7 @@ function handlePing(network, res, err) { // Send the update. server.io.sockets.emit('updateHistoryGraph', { ip: network.ip, + name: network.name, players: (res ? res.players.online : 0), timestamp: timeMs }); diff --git a/assets/js/site.js b/assets/js/site.js index 11d9e8f..12093b6 100644 --- a/assets/js/site.js +++ b/assets/js/site.js @@ -308,14 +308,14 @@ $(document).ready(function() { } // If it's not in our display group, use the hidden group instead. - var targetGraphData = displayedGraphData[rawData.ip] ? displayedGraphData : hiddenGraphData; + var targetGraphData = displayedGraphData[rawData.name] ? displayedGraphData : hiddenGraphData; trimOldPings(targetGraphData, graphDuration); - targetGraphData[rawData.ip].push([rawData.timestamp, rawData.players]); + targetGraphData[rawData.name].push([rawData.timestamp, rawData.players]); // Redraw if we need to. - if (displayedGraphData[rawData.ip]) { + if (displayedGraphData[rawData.name]) { historyPlot.setData(convertGraphData(displayedGraphData)); historyPlot.setupGrid();