From bde9fd55f9e21cea2db7ac0fb8bfd3c509cf82bc Mon Sep 17 00:00:00 2001 From: Zaxar163 Date: Thu, 6 Feb 2020 17:27:39 +0100 Subject: [PATCH] =?UTF-8?q?[FIX]=20UOE=20=D0=B2=20=D1=81=D0=B5=D1=80=D0=B8?= =?UTF-8?q?=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B8=20LauncherEnvi?= =?UTF-8?q?ronment.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../binary/tasks/MainBuildTask.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java index f54d5f57..2a4dd068 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java @@ -8,6 +8,7 @@ import org.objectweb.asm.tree.FieldNode; import pro.gravit.launcher.Launcher; import pro.gravit.launcher.LauncherConfig; +import pro.gravit.launcher.LauncherConfig.LauncherEnvironment; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.asm.ClassMetadataReader; import pro.gravit.launchserver.asm.InjectClassAcceptor; @@ -191,7 +192,22 @@ protected void initProps() { properties.put("launcher.port", 32148 + SecurityHelper.newRandom().nextInt(512)); properties.put("launcher.guardType", server.config.launcher.guardType); properties.put("launcher.isWarningMissArchJava", server.config.launcher.warningMissArchJava); - properties.put("launchercore.env" ,server.config.env); + int cenv = -1; + switch (server.config.env) { + case DEV: + cenv = 0; + break; + case DEBUG: + cenv = 1; + break; + case STD: + cenv = 2; + break; + case PROD: + cenv = 3; + break; + } + properties.put("launchercore.env", cenv); properties.put("runtimeconfig.passwordEncryptKey", server.runtime.passwordEncryptKey); String launcherSalt = SecurityHelper.randomStringToken(); byte[] launcherSecureHash = SecurityHelper.digest(SecurityHelper.DigestAlgorithm.SHA256,