Updated Distribution Index spec and impl.

Added distromanager.js to represent distro elements.
Moved all distro refresh code to distromanager.js.
Overhauled assetexec.js.
Overhauled handling of assetexec.js output in landing.js.
Overhauled events emitted by assetguard.js.
Improved doenload processing in assetguard.
Updated discord-rpc to v3.0.0.
Replaced westeroscraft.json with distribution.json.
Use npm in travis for windows + linux.
Remove file extension from imports.
Added liteloader + macromod + shaders to distribution.json.
This commit is contained in:
Daniel Scalzi
2018-07-22 11:40:15 -04:00
parent 5b0b1924cf
commit 7dcce68455
19 changed files with 1611 additions and 1207 deletions

View File

@@ -1,10 +1,11 @@
const {AssetGuard} = require('./assetguard.js')
const ConfigManager = require('./configmanager.js')
const {ipcRenderer} = require('electron')
const os = require('os')
const path = require('path')
const rimraf = require('rimraf')
const ConfigManager = require('./configmanager')
const DistroManager = require('./distromanager')
console.log('%c[Preloader]', 'color: #a02d2a; font-weight: bold', 'Loading..')
// Load ConfigManager
@@ -14,17 +15,17 @@ function onDistroLoad(data){
if(data != null){
// Resolve the selected server if its value has yet to be set.
if(ConfigManager.getSelectedServer() == null || AssetGuard.getServerById(ConfigManager.getSelectedServer()) == null){
if(ConfigManager.getSelectedServer() == null || data.getServer(ConfigManager.getSelectedServer()) == null){
console.log('%c[Preloader]', 'color: #a02d2a; font-weight: bold', 'Determining default selected server..')
ConfigManager.setSelectedServer(AssetGuard.resolveSelectedServer().id)
ConfigManager.setSelectedServer(data.getMainServer().getID())
ConfigManager.save()
}
}
ipcRenderer.send('distributionIndexDone', data)
ipcRenderer.send('distributionIndexDone', data != null)
}
// Ensure Distribution is downloaded and cached.
AssetGuard.refreshDistributionDataRemote(ConfigManager.getLauncherDirectory()).then((data) => {
DistroManager.pullRemote().then((data) => {
console.log('%c[Preloader]', 'color: #a02d2a; font-weight: bold', 'Loaded distribution index.')
onDistroLoad(data)
@@ -35,7 +36,7 @@ AssetGuard.refreshDistributionDataRemote(ConfigManager.getLauncherDirectory()).t
console.log('%c[Preloader]', 'color: #a02d2a; font-weight: bold', 'Attempting to load an older version of the distribution index.')
// Try getting a local copy, better than nothing.
AssetGuard.refreshDistributionDataLocal(ConfigManager.getLauncherDirectory()).then((data) => {
DistroManager.pullLocal().then((data) => {
console.log('%c[Preloader]', 'color: #a02d2a; font-weight: bold', 'Successfully loaded an older version of the distribution index.')
onDistroLoad(data)