From 8329823f7ac1a4c8502109cb905c4763de32ba6a Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 22 Mar 2019 11:08:21 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=A4=D0=B8=D0=BA=D1=81=20=D0=B0=D0=B2?= =?UTF-8?q?=D1=82=D0=BE=D0=B3=D0=B5=D0=BD=D0=B5=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/ru/gravit/launchserver/LaunchServer.java | 4 +--- .../ru/gravit/launchserver/auth/AuthProviderPair.java | 8 +++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index 8a1b6e5a..6a353e9a 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -617,9 +617,7 @@ private void generateConfigIfNotExists() throws IOException { newConfig.env = LauncherConfig.LauncherEnvironment.STD; newConfig.startScript = JVMHelper.OS_TYPE.equals(JVMHelper.OS.MUSTDIE) ? "." + File.separator + "start.bat" : "." + File.separator + "start.sh"; newConfig.hwidHandler = new AcceptHWIDHandler(); - newConfig.auth = new AuthProviderPair[]{ new AuthProviderPair() }; - newConfig.auth[0].provider = new RejectAuthProvider("Настройте authProvider"); - newConfig.auth[0].handler = new MemoryAuthHandler(); + newConfig.auth = new AuthProviderPair[]{ new AuthProviderPair(new RejectAuthProvider("Настройте authProvider"), new MemoryAuthHandler(), "std") }; newConfig.textureProvider = new RequestTextureProvider("http://example.com/skins/%username%.png", "http://example.com/cloaks/%username%.png"); newConfig.permissionsHandler = new JsonFilePermissionsHandler(); newConfig.port = 7240; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/AuthProviderPair.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/AuthProviderPair.java index 3403e1a6..38e45f4e 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/AuthProviderPair.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/AuthProviderPair.java @@ -9,7 +9,13 @@ public class AuthProviderPair { public AuthProvider provider; public AuthHandler handler; public String name; - public boolean isDefault; + public boolean isDefault = true; + + public AuthProviderPair(AuthProvider provider, AuthHandler handler, String name) { + this.provider = provider; + this.handler = handler; + this.name = name; + } public void init() {