Preliminary Java 9+ Support (#20).

We will still not allow these versions to be used until they have been fully verified on our far-future 1.13 test server.
This commit is contained in:
Daniel Scalzi
2018-12-31 10:39:27 -05:00
parent be533af38b
commit d7fe519923
4 changed files with 146 additions and 43 deletions

View File

@@ -86,21 +86,22 @@ function setLaunchEnabled(val){
// Bind launch button
document.getElementById('launch_button').addEventListener('click', function(e){
loggerLanding.log('Launching game..')
const mcVersion = DistroManager.getDistribution().getServer(ConfigManager.getSelectedServer()).getMinecraftVersion()
const jExe = ConfigManager.getJavaExecutable()
if(jExe == null){
asyncSystemScan()
asyncSystemScan(mcVersion)
} else {
setLaunchDetails('Please wait..')
toggleLaunchArea(true)
setLaunchPercentage(0, 100)
AssetGuard._validateJavaBinary(jExe).then((v) => {
AssetGuard._validateJavaBinary(jExe, mcVersion).then((v) => {
loggerLanding.log('Java version meta', v)
if(v.valid){
dlAsync()
} else {
asyncSystemScan()
asyncSystemScan(mcVersion)
}
})
}
@@ -260,7 +261,13 @@ let scanAt
let extractListener
function asyncSystemScan(launchAfter = true){
/**
* Asynchronously scan the system for valid Java installations.
*
* @param {string} mcVersion The Minecraft version we are scanning for.
* @param {boolean} launchAfter Whether we should begin to launch after scanning.
*/
function asyncSystemScan(mcVersion, launchAfter = true){
setLaunchDetails('Please wait..')
toggleLaunchArea(true)
@@ -424,7 +431,7 @@ function asyncSystemScan(launchAfter = true){
// Begin system Java scan.
setLaunchDetails('Checking system info..')
sysAEx.send({task: 'execute', function: 'validateJava', argsArr: [ConfigManager.getLauncherDirectory()]})
sysAEx.send({task: 'execute', function: 'validateJava', argsArr: [ConfigManager.getLauncherDirectory(), mcVersion]})
}