Properly handle pushing graph data for new networks
This commit is contained in:
parent
047f9306bb
commit
7d2814156e
6
app.js
6
app.js
@ -105,7 +105,11 @@ function handlePing(network, res, err) {
|
|||||||
// Don't have too much data!
|
// Don't have too much data!
|
||||||
util.trimOldPings(graphData);
|
util.trimOldPings(graphData);
|
||||||
|
|
||||||
graphData[network.ip].push([timeMs, res ? res.players.online : 0]);
|
if (!graphData[network.ip]) {
|
||||||
|
graphData[network.ip] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
graphData[network.ip].push([timeMs, res ? res.players.online : 0]);
|
||||||
|
|
||||||
// Send the update.
|
// Send the update.
|
||||||
server.io.sockets.emit('updateHistoryGraph', {
|
server.io.sockets.emit('updateHistoryGraph', {
|
||||||
|
Loading…
Reference in New Issue
Block a user