2017-12-01 23:59:25 -08:00
|
|
|
const {AssetGuard} = require('./assetguard.js')
|
2017-12-02 19:41:47 -08:00
|
|
|
const ConfigManager = require('./configmanager.js')
|
|
|
|
const path = require('path')
|
2017-12-01 23:59:25 -08:00
|
|
|
|
|
|
|
console.log('Preloading')
|
|
|
|
|
2017-12-02 21:38:22 -08:00
|
|
|
// Load ConfigManager
|
|
|
|
ConfigManager.load()
|
2017-12-02 19:41:47 -08:00
|
|
|
|
2017-12-02 21:38:22 -08:00
|
|
|
// Ensure Distribution is downloaded and cached.
|
|
|
|
AssetGuard.retrieveDistributionDataSync(ConfigManager.getGameDirectory(), false)
|
2017-12-02 19:41:47 -08:00
|
|
|
|
2017-12-02 21:38:22 -08:00
|
|
|
// Resolve the selected server if its value has yet to be set.
|
|
|
|
if(ConfigManager.getSelectedServer() == null){
|
2017-12-02 19:41:47 -08:00
|
|
|
console.log('Determining default selected server..')
|
2017-12-02 21:38:22 -08:00
|
|
|
ConfigManager.setSelectedServer(AssetGuard.resolveSelectedServer(ConfigManager.getGameDirectory()))
|
|
|
|
ConfigManager.save()
|
|
|
|
}
|