Skip to content

Commit

Permalink
Merge pull request #186 from Cryptkeeper/release-552
Browse files Browse the repository at this point in the history
5.5.2 release preview
  • Loading branch information
Cryptkeeper authored Jun 13, 2020
2 parents 5b6d65e + 7313971 commit 57fbd99
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions assets/js/scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class RelativeScale {
}

static scaleMatrix (data, tickCount, maxFactor) {
const max = Math.max(...data.flat())
const max = Math.max(...data.flat().filter(val => val !== null))

return RelativeScale.scale([0, RelativeScale.isFiniteOrZero(max)], tickCount, maxFactor)
}
Expand All @@ -46,8 +46,8 @@ export class RelativeScale {
max: 0
}
} else {
const min = Math.min(...data)
const max = Math.max(...data)
const min = Math.min(...data.filter(val => val !== null))
const max = Math.max(...data.filter(val => val !== null))

return {
min: RelativeScale.isFiniteOrZero(min),
Expand Down
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
**5.5.2** *(June 12 2020)*
- Fixed ping errors causing server graphs (or the historical graph) to sometimes disappear.
- Fixed ping errors causing server graphs to reset their Y scale minimum to 0.
- Improved zoomed detection and updating of the historical graph with recommendations by [@leeoniya](https://github.com/leeoniya).

**5.5.1** *(June 10 2020)*
- New tooltip hover design on the historical graph. It will highlight the server closest to your cursor.
- Historical graph is now limited to 10,000 increments on the Y axis. This prevents servers with over 100,000 players forcing the graph into 100,000 increments.
Expand Down
8 changes: 4 additions & 4 deletions lib/servers.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ class ServerRegistration {
getUpdate (timestamp, resp, err, version) {
const update = {}

// Always append a playerCount value
// When resp is undefined (due to an error), playerCount will be null
update.playerCount = getPlayerCountOrNull(resp)

if (resp) {
if (resp.version && this.updateProtocolVersionCompat(resp.version, version.protocolId, version.protocolIndex)) {
// Append an updated version listing
Expand All @@ -65,10 +69,6 @@ class ServerRegistration {
update.favicon = this.getFaviconUrl()
}

// Append a result object
// This filters out unwanted data from resp
update.playerCount = resp.players.online

if (config.logToDatabase) {
// 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
Expand Down

0 comments on commit 57fbd99

Please sign in to comment.