From 96e9cabc6be2d02958878b19698188595fdbd763 Mon Sep 17 00:00:00 2001 From: zaxar163 Date: Wed, 9 Jan 2019 16:10:17 +0400 Subject: [PATCH] Last fixes. --- Launcher/runtime/dialog/dialog.js | 3 ++- Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java | 3 ++- .../main/java/ru/gravit/launcher/client/FunctionalBridge.java | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Launcher/runtime/dialog/dialog.js b/Launcher/runtime/dialog/dialog.js index f6c568d4..b193e69f 100644 --- a/Launcher/runtime/dialog/dialog.js +++ b/Launcher/runtime/dialog/dialog.js @@ -149,7 +149,7 @@ function goAuth(event) { var rsaPassword = null; if (!passwordField.isDisable()) { var password = passwordField.getText(); - if (password !== null) { + if (password !== null && !password.isEmpty()) { rsaPassword = settings.setPassword(password); } else if (settings.rsaPassword !== null) { rsaPassword = settings.rsaPassword; @@ -213,6 +213,7 @@ function verifyLauncher(e) { function doAuth(login, rsaPassword) { processing.resetOverlay(); overlay.show(processing.overlay, function (event) { + FunctionalBridge.getHWID.join(); makeAuthRequest(login, rsaPassword, function (result) { loginData = { pp: result.pp , accessToken: result.accessToken, permissions: result.permissions}; diff --git a/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java index efa612fd..9061e389 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java @@ -67,7 +67,8 @@ public void start(String... args) throws Throwable { runtimeProvider.preLoad(); FunctionalBridge.worker = new RequestWorker(); CommonHelper.newThread("FX Task Worker", true, FunctionalBridge.worker).start(); - CommonHelper.newThread("GetHWID Thread",true, FunctionalBridge::getHWID).start(); + FunctionalBridge.getHWID = CommonHelper.newThread("GetHWID Thread",true, FunctionalBridge::getHWID); + FunctionalBridge.getHWID.start(); LogHelper.debug("Dir: %s", DirBridge.dir); runtimeProvider.run(args); } diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java b/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java index 6d9cf772..8b94f5fe 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java @@ -29,6 +29,8 @@ public class FunctionalBridge { public static OshiHWIDProvider hwidProvider = new OshiHWIDProvider(); @LauncherAPI public static AtomicReference hwid = new AtomicReference<>(); + @LauncherAPI + public static Thread getHWID = null; @LauncherAPI public static HashedDirRunnable offlineUpdateRequest(String dirName, Path dir, SignedObjectHolder hdir, FileNameMatcher matcher, boolean digest) throws Exception {