diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/OAuthTokenGet.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/OAuthTokenGet.java index e38bfdef..b06c5b13 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/OAuthTokenGet.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/OAuthTokenGet.java @@ -51,11 +51,11 @@ public static UserAuthResponse mToken(String code, VkApiClient vk) { LaunchServer.server.config.OAuthAppSecret, LaunchServer.server.config.getOAuthBackURL(), code).execute(); - return authResponse; } catch (ApiException e) { e.printStackTrace(); } catch (ClientException e) { e.printStackTrace(); } + return authResponse; } } diff --git a/Launcher/runtime/dialog/dialog.js b/Launcher/runtime/dialog/dialog.js index 0cfa2fd1..5da8e28d 100644 --- a/Launcher/runtime/dialog/dialog.js +++ b/Launcher/runtime/dialog/dialog.js @@ -314,6 +314,16 @@ function doOAuth() { makeOAuthRequest(function (result) { openURL(new java.net.URL(result.URL)); overlay.hide(600000, function () { + setCurrentScene(loginScene); + }); + return result; + }) + makeWaitAuth(function (result) { + FunctionalBridge.setAuthParams(result); + loginData = { pp: result.playerProfile , accessToken: result.accessToken, permissions: result.permissions, + auth_type: settings.auth}; + + overlay.hide(0, function () { setCurrentScene(menuScene); }); return result; diff --git a/Launcher/runtime/dialog/overlay/processing/processing.js b/Launcher/runtime/dialog/overlay/processing/processing.js index 8b89334a..f13d3a8b 100644 --- a/Launcher/runtime/dialog/overlay/processing/processing.js +++ b/Launcher/runtime/dialog/overlay/processing/processing.js @@ -127,6 +127,11 @@ function makeOAuthRequest(callback) { task.updateMessage("Ожидание авторизация на сервере"); startTask(task); } +function makeOAuthRequest(callback) { + var task = newRequestTask(new OAuthRequest(FunctionalBridge.getHWID())); + processing.setTaskProperties(task, callback, null, true); + startTask(task); +} function launchClient(assetHDir, clientHDir, profile, params, callback) { diff --git a/Launcher/runtime/dialog/styles.css b/Launcher/runtime/dialog/styles.css index f382a466..3ec129fc 100644 --- a/Launcher/runtime/dialog/styles.css +++ b/Launcher/runtime/dialog/styles.css @@ -157,10 +157,26 @@ .auth { -fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15, 0, 0, 3); } +.vkauth { + -jfx-button-type: FLAT; + -fx-background-radius: 0; + -fx-font-size: 0pt; + -fx-background-image: url('images/icons/vk.png'); + -fx-background-repeat: no-repeat; + -fx-pref-width: 62px; + -fx-pref-height: 62px; + -fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15, 0, 0, 3); +} + + .auth:hover, .auth:pressed { -fx-background-color: #75e18c; } +.vkauth:hover, +.vkauth:pressed { + -fx-background-color: #75e18c; +} #password, #login { diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/OAuthRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/OAuthRequest.java index 1cab5f6d..a83a4345 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/OAuthRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/auth/OAuthRequest.java @@ -15,7 +15,6 @@ public final class OAuthRequest extends Request implements Req public OAuthRequest(HWID hwid) { - LogHelper.info("Requesting"); this.hwid = hwid; }