Fix incorrect IP references

This commit is contained in:
Cryptkeeper 2016-02-01 04:58:05 -06:00
parent 3dc10f571f
commit 6d8ab212e0
2 changed files with 4 additions and 3 deletions

1
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
});

@ -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();