Backend cleanup (#146)

* Add ServerRegistration, begin refactoring to match frontend

* move graphData logic into ServerRegistration

* move ping updates/history into ServerRegistration

* start updating main app entry methods

* fix default rates.updateMojangStatus

* fix record loading delays on freshly booted instances

* move database loading logic to method + callback

* use data in frontend for type lookup instead of ping

* cleanup app.js

* reorganize methods to improve flow

* avoid useless mojang updates, remove legacy fields

* rename legacy fields for consistency

* finish restructure around App model

* ensure versions are sorted by release order

* filter errors sent to frontend to avoid data leaks

* fix version listing behavior on frontend

* 5.1.0
This commit is contained in:
Nick Krecklow
2020-04-21 17:59:53 -05:00
committed by GitHub
parent 9eda8d6bdb
commit 4d13965e6b
19 changed files with 822 additions and 823 deletions

View File

@ -64,16 +64,14 @@ export function formatMinecraftVersions (versions, knownVersions) {
const versionGroups = []
for (let i = 0; i < versions.length; i++) {
const versionIndex = versions[i]
// Look for value mismatch between the previous index
// Require i > 0 since lastVersionIndex is undefined for i === 0
if (i > 0 && versions[i] - 1 !== versionIndex - 1) {
if (i > 0 && versions[i] - versions[i - 1] !== 1) {
versionGroups.push(currentVersionGroup)
currentVersionGroup = []
}
currentVersionGroup.push(versionIndex)
currentVersionGroup.push(versions[i])
}
// Ensure the last versionGroup is always pushed