explicitly set serverRegistration.playerCount when firing #addServer
This commit is contained in:
parent
4104c4144a
commit
96acf3614b
@ -115,6 +115,11 @@ export class App {
|
||||
// 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.playerCountHistory, timestampPoints)
|
||||
|
||||
// Set initial playerCount to the payload's value
|
||||
// This will always exist since it is explicitly generated by the backend
|
||||
// This is used for any post-add rendering of things like the percentageBar
|
||||
serverRegistration.playerCount = payload.result.players.online
|
||||
}
|
||||
|
||||
// Create the plot instance internally with the restructured and cleaned data
|
||||
|
@ -108,6 +108,7 @@ class PingController {
|
||||
// Log to database if enabled
|
||||
if (config.logToDatabase) {
|
||||
const playerCount = result.resp ? result.resp.players.online : 0
|
||||
|
||||
this._app.database.insertPing(serverRegistration.data.ip, timestamp, playerCount)
|
||||
}
|
||||
|
||||
@ -115,6 +116,7 @@ class PingController {
|
||||
// This includes any modified fields and flags used by the frontend
|
||||
// This will not be cached and can contain live metadata
|
||||
const update = serverRegistration.handlePing(timestamp, result.resp, result.err, result.version)
|
||||
|
||||
updates[serverRegistration.serverId] = update
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user