From e12f2ef897c51787164e930bcb1728752d7e7d93 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Thu, 21 Sep 2023 22:08:03 +0700 Subject: [PATCH] [FEATURE] Support properties in ServerWrapper --- .../java/pro/gravit/launcher/server/ServerWrapper.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java index c17064d5..0e07b07d 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java @@ -128,6 +128,11 @@ public void run(String... args) throws Throwable { LogHelper.error(e); } }; + if(config.properties != null) { + for(Map.Entry e : config.properties.entrySet()) { + System.setProperty(e.getKey(), e.getValue()); + } + } Request.setRequestService(service); if (config.logFile != null) LogHelper.addOutput(IOHelper.newWriter(Paths.get(config.logFile), true)); { @@ -213,6 +218,7 @@ public Config getDefaultConfig() { newConfig.address = "ws://localhost:9274/api"; newConfig.classLoaderConfig = ClientProfile.ClassLoaderConfig.SYSTEM_ARGS; newConfig.env = LauncherConfig.LauncherEnvironment.STD; + newConfig.properties = new HashMap<>(); return newConfig; } @@ -238,6 +244,8 @@ public static final class Config { public byte[] encodedServerRsaPublicKey; public byte[] encodedServerEcPublicKey; + + public Map properties; } public static final class ModuleConf {