send playerCount in payload directly instead of nesting into legacy data structure
This commit is contained in:
@ -70,9 +70,7 @@ class ServerRegistration {
|
||||
|
||||
// Append a result object
|
||||
// This filters out unwanted data from resp
|
||||
update.result = {
|
||||
players: resp.players
|
||||
}
|
||||
update.playerCount = resp.players.online
|
||||
|
||||
if (config.logToDatabase) {
|
||||
// Update calculated graph peak regardless if the graph is being updated
|
||||
@ -115,11 +113,7 @@ class ServerRegistration {
|
||||
// Assume the ping was a success and define result
|
||||
// pingHistory does not keep error references, so its impossible to detect if this is an error
|
||||
// It is also pointless to store that data since it will be short lived
|
||||
payload.result = {
|
||||
players: {
|
||||
online: this._pingHistory[this._pingHistory.length - 1]
|
||||
}
|
||||
}
|
||||
payload.playerCount = this._pingHistory[this._pingHistory.length - 1]
|
||||
|
||||
// Send a copy of pingHistory
|
||||
// Include the last value even though it is contained within payload
|
||||
|
Reference in New Issue
Block a user