use serverId in protocol instead of legacy info object
This commit is contained in:
18
lib/ping.js
18
lib/ping.js
@ -107,8 +107,6 @@ class PingController {
|
||||
handlePing (serverRegistration, resp, err, version) {
|
||||
const timestamp = new Date().getTime()
|
||||
|
||||
this._app.server.broadcast('update', serverRegistration.getUpdate(timestamp, resp, err, version))
|
||||
|
||||
serverRegistration.addPing(timestamp, resp)
|
||||
|
||||
if (config.logToDatabase) {
|
||||
@ -119,24 +117,14 @@ class PingController {
|
||||
|
||||
if (serverRegistration.addGraphPoint(resp !== undefined, playerCount, timestamp)) {
|
||||
this._app.server.broadcast('updateHistoryGraph', {
|
||||
name: serverRegistration.data.name,
|
||||
serverId: serverRegistration.serverId,
|
||||
playerCount: playerCount,
|
||||
timestamp: timestamp
|
||||
})
|
||||
}
|
||||
|
||||
// Update calculated graph peak regardless if the graph is being updated
|
||||
// This can cause a (harmless) desync between live and stored data, but it allows it to be more accurate for long surviving processes
|
||||
if (serverRegistration.findNewGraphPeak()) {
|
||||
const graphPeak = serverRegistration.getGraphPeak()
|
||||
|
||||
this._app.server.broadcast('updatePeak', {
|
||||
name: serverRegistration.data.name,
|
||||
playerCount: graphPeak.playerCount,
|
||||
timestamp: graphPeak.timestamp
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
this._app.server.broadcast('update', serverRegistration.getUpdate(timestamp, resp, err, version))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user