store pingHistory as player count directly

This commit is contained in:
Nick Krecklow
2020-05-08 02:52:48 -05:00
parent 37a88677cf
commit 3491c73b89
4 changed files with 25 additions and 42 deletions

View File

@ -111,12 +111,12 @@ export class App {
serverRegistration.initServerStatus(payload)
// pingHistory is only defined when the backend has previous ping data
// undefined pingHistory means this is a placeholder ping generated by the backend
if (typeof payload.pingHistory !== 'undefined') {
// playerCountHistory is only defined when the backend has previous ping data
// undefined playerCountHistory means this is a placeholder ping generated by the backend
if (typeof payload.playerCountHistory !== 'undefined') {
// Push the historical data into the graph
// This will trim and format the data so it is ready for the graph to render once init
serverRegistration.addGraphPoints(payload.pingHistory, timestampPoints)
serverRegistration.addGraphPoints(payload.playerCountHistory, timestampPoints)
}
// Create the plot instance internally with the restructured and cleaned data