From e0b3f3d6a51672fbc1301c94c8c468aba419505f Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Wed, 29 Mar 2023 23:46:26 +0700 Subject: [PATCH] [FEATURE] Launcher build number --- .../pro/gravit/launchserver/binary/tasks/MainBuildTask.java | 3 ++- .../gravit/launchserver/config/LaunchServerRuntimeConfig.java | 2 ++ .../src/main/java/pro/gravit/launcher/LauncherConfig.java | 2 ++ modules | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) 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 0b3a87bf..478217ec 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 @@ -124,7 +124,8 @@ protected void initProps() { properties.put("runtimeconfig.secureCheckSalt", launcherSalt); if (server.runtime.unlockSecret == null) server.runtime.unlockSecret = SecurityHelper.randomStringToken(); properties.put("runtimeconfig.unlockSecret", server.runtime.unlockSecret); - + server.runtime.buildNumber++; + properties.put("runtimeconfig.buildNumber", server.runtime.buildNumber); } public byte[] transformClass(byte[] bytes, String classname, BuildContext context) { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerRuntimeConfig.java b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerRuntimeConfig.java index 0f9c9c53..756fa2cf 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerRuntimeConfig.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerRuntimeConfig.java @@ -11,6 +11,7 @@ public class LaunchServerRuntimeConfig { public String unlockSecret; public String registerApiKey; public String clientCheckSecret; + public long buildNumber; public void verify() { if (passwordEncryptKey == null) logger.error("[RuntimeConfig] passwordEncryptKey must not be null"); @@ -25,5 +26,6 @@ public void reset() { runtimeEncryptKey = SecurityHelper.randomStringAESKey(); registerApiKey = SecurityHelper.randomStringToken(); clientCheckSecret = SecurityHelper.randomStringToken(); + buildNumber = 0; } } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java b/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java index 0d90c99d..0e57587d 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java @@ -48,6 +48,8 @@ public final class LauncherConfig extends StreamObject { public String unlockSecret; @LauncherInject("launchercore.env") public LauncherEnvironment environment; + @LauncherInject("runtimeconfig.buildNumber") + public long buildNumber; @LauncherInjectionConstructor diff --git a/modules b/modules index ed433be2..b9ec7706 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit ed433be234a5d6b4336a6af48194add97b0f2874 +Subproject commit b9ec7706081097211c4fa9cd7a6669a4dadac6aa