From 67662dfdac80b85c523fb15c2d3619c302e5e8d9 Mon Sep 17 00:00:00 2001 From: LoomeL <44950511+LoomeL@users.noreply.github.com> Date: Wed, 3 Jul 2019 19:31:35 +0600 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=81=D0=B2=D0=BE=D0=B5=D0=B9=20jvm=20?= =?UTF-8?q?=D0=B2=20runtime=20(#302)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Signed-off-by: LoomeL * Загрузка своей JVM * Поправка настройки по умолчанию --- Launcher/runtime/config.js | 6 +++ Launcher/runtime/dialog/dialog.js | 61 ++++++++++++++++++++++--------- Launcher/runtime/init.js | 12 ++++++ 3 files changed, 61 insertions(+), 18 deletions(-) diff --git a/Launcher/runtime/config.js b/Launcher/runtime/config.js index 992277a5..7966e1ee 100644 --- a/Launcher/runtime/config.js +++ b/Launcher/runtime/config.js @@ -16,6 +16,12 @@ var config = { autoEnterDefault: false, // Should autoEnter be enabled by default? fullScreenDefault: false, // Should fullScreen be enabled by default? ramDefault: 1024, // Default RAM amount (0 for auto) + + jvm: { + enable: false, + jvmMustdie32Dir: "jre-8u202-win32", + jvmMustdie64Dir: "jre-8u202-win64", + } }; DirBridge.dir = DirBridge.getLauncherDir(config.dir); diff --git a/Launcher/runtime/dialog/dialog.js b/Launcher/runtime/dialog/dialog.js index 631d3744..1c23beb4 100644 --- a/Launcher/runtime/dialog/dialog.js +++ b/Launcher/runtime/dialog/dialog.js @@ -305,26 +305,51 @@ function doAuth(login, rsaPassword, auth_type) { function doUpdate(profile, pp, accessToken) { var digest = profile.isUpdateFastCheck(); overlay.swap(0, update.overlay, function(event) { - - update.resetOverlay("Обновление файлов ресурсов"); - var assetDirName = profile.getAssetDir(); - var assetDir = settings.updatesDir.resolve(assetDirName); - var assetMatcher = profile.getAssetUpdateMatcher(); - makeSetProfileRequest(profile, function() { - ClientLauncher.setProfile(profile); - makeUpdateRequest(assetDirName, assetDir, assetMatcher, digest, function(assetHDir) { - settings.putHDir(assetDirName, assetDir, assetHDir.hdir); - - update.resetOverlay("Обновление файлов клиента"); - var clientDirName = profile.getDir(); - var clientDir = settings.updatesDir.resolve(clientDirName); - var clientMatcher = profile.getClientUpdateMatcher(); - makeUpdateRequest(clientDirName, clientDir, clientMatcher, digest, function(clientHDir) { - settings.putHDir(clientDirName, clientDir, clientHDir.hdir); - doLaunchClient(assetDir, assetHDir.hdir, clientDir, clientHDir.hdir, profile, pp, accessToken); + if (config.jvm.enable) { + makeSetProfileRequest(profile, function() { + ClientLauncher.setProfile(profile); + var jvmDir = settings.updatesDir.resolve(jvmDirName); + update.resetOverlay("Обновление файлов JVM"); + makeUpdateRequest(jvmDirName, jvmDir, null, digest, function(jvmHDir) { + ClientLauncher.setJavaBinPath(jvmDir); + update.resetOverlay("Обновление файлов ресурсов"); + var assetDirName = profile.getAssetDir(); + var assetDir = settings.updatesDir.resolve(assetDirName); + var assetMatcher = profile.getAssetUpdateMatcher(); + makeUpdateRequest(assetDirName, assetDir, assetMatcher, digest, function(assetHDir) { + settings.putHDir(assetDirName, assetDir, assetHDir.hdir); + update.resetOverlay("Обновление файлов клиента"); + var clientDirName = profile.getDir(); + var clientDir = settings.updatesDir.resolve(clientDirName); + var clientMatcher = profile.getClientUpdateMatcher(); + makeUpdateRequest(clientDirName, clientDir, clientMatcher, digest, function(clientHDir) { + settings.putHDir(clientDirName, clientDir, clientHDir.hdir); + doLaunchClient(assetDir, assetHDir.hdir, clientDir, clientHDir.hdir, profile, pp, accessToken); + }); + }); }); }); - }); + } else { + update.resetOverlay("Обновление файлов ресурсов"); + var assetDirName = profile.getAssetDir(); + var assetDir = settings.updatesDir.resolve(assetDirName); + var assetMatcher = profile.getAssetUpdateMatcher(); + makeSetProfileRequest(profile, function() { + ClientLauncher.setProfile(profile); + makeUpdateRequest(assetDirName, assetDir, assetMatcher, digest, function(assetHDir) { + settings.putHDir(assetDirName, assetDir, assetHDir.hdir); + + update.resetOverlay("Обновление файлов клиента"); + var clientDirName = profile.getDir(); + var clientDir = settings.updatesDir.resolve(clientDirName); + var clientMatcher = profile.getClientUpdateMatcher(); + makeUpdateRequest(clientDirName, clientDir, clientMatcher, digest, function(clientHDir) { + settings.putHDir(clientDirName, clientDir, clientHDir.hdir); + doLaunchClient(assetDir, assetHDir.hdir, clientDir, clientHDir.hdir, profile, pp, accessToken); + }); + }); + }); + } }); } diff --git a/Launcher/runtime/init.js b/Launcher/runtime/init.js index 1db04f3b..9b1ccb43 100644 --- a/Launcher/runtime/init.js +++ b/Launcher/runtime/init.js @@ -79,6 +79,18 @@ function setRootParent(parent) { function start(args) { + if (config.jvm.enable) { + switch (JVMHelper.OS_TYPE) { + case JVMHelperOS.MUSTDIE: + jvmDirName = JVMHelper.OS_BITS === 32 ? config.jvm.jvmMustdie32Dir : + jvmDirName = JVMHelper.OS_BITS === 64 ? config.jvm.jvmMustdie64Dir : config.jvm.enable = false; + break; + default: + config.jvm.enable = false; + break; + } + } + LogHelper.debug("Setting FX properties"); java.lang.System.setProperty("prism.lcdtext", "false");