From 6fac47f99deb8c34734c45b881f5efceec6d8eb9 Mon Sep 17 00:00:00 2001 From: Gravita Date: Tue, 31 May 2022 17:23:52 +0700 Subject: [PATCH 1/9] [ANY] 5.2.13 dev --- LauncherCore/src/main/java/pro/gravit/utils/Version.java | 4 ++-- build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/Version.java b/LauncherCore/src/main/java/pro/gravit/utils/Version.java index 161178b2..ef7c6a15 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/Version.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/Version.java @@ -6,9 +6,9 @@ public final class Version implements Comparable { public static final int MAJOR = 5; public static final int MINOR = 2; - public static final int PATCH = 12; + public static final int PATCH = 13; public static final int BUILD = 1; - public static final Version.Type RELEASE = Type.STABLE; + public static final Version.Type RELEASE = Type.DEV; public final int major; public final int minor; public final int patch; diff --git a/build.gradle b/build.gradle index 0ed3c02f..67521b87 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ id 'org.openjfx.javafxplugin' version '0.0.10' apply false } group = 'pro.gravit.launcher' -version = '5.2.12' +version = '5.2.13-SNAPSHOT' apply from: 'props.gradle' From 0b387818580dc10ecd252ac5f991536c970d433d Mon Sep 17 00:00:00 2001 From: Gravita Date: Wed, 8 Jun 2022 23:17:35 +0700 Subject: [PATCH 2/9] [FIX] HttpAuthCoreProvider small fixes --- .../src/main/java/pro/gravit/launchserver/HttpRequester.java | 3 +++ .../gravit/launchserver/auth/core/HttpAuthCoreProvider.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java b/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java index fae7b1c4..0545b615 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java @@ -29,6 +29,9 @@ public HttpHelper.HttpOptional applyJson(JsonElement response, i if(statusCode < 200 || statusCode >= 300) { return new HttpHelper.HttpOptional<>(null, Launcher.gsonManager.gson.fromJson(response, SimpleError.class), statusCode); } + if(type == Void.class) { + return new HttpHelper.HttpOptional<>(null, null, statusCode); + } return new HttpHelper.HttpOptional<>(Launcher.gsonManager.gson.fromJson(response, type), null, statusCode); } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java index c2ca5844..21b5b6b0 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java @@ -150,12 +150,12 @@ protected boolean updateServerID(User user, String serverID) throws IOException @Override public User checkServer(Client client, String username, String serverID) throws IOException { - return requester.send(requester.post(checkServerUrl, new CheckServerRequest(username, serverID), null), HttpUser.class).getOrThrow(); + return requester.send(requester.post(checkServerUrl, new CheckServerRequest(username, serverID), bearerToken), HttpUser.class).getOrThrow(); } @Override public boolean joinServer(Client client, String username, String accessToken, String serverID) throws IOException { - var result = requester.send(requester.post(joinServerUrl, new JoinServerRequest(username, accessToken, serverID), null), Void.class); + var result = requester.send(requester.post(joinServerUrl, new JoinServerRequest(username, accessToken, serverID), bearerToken), Void.class); return result.isSuccessful(); } From e8d3232dba3fb78b0f75b035878a10ba6379f03b Mon Sep 17 00:00:00 2001 From: Gravita Date: Thu, 9 Jun 2022 17:00:35 +0700 Subject: [PATCH 3/9] [ANY] 1.19 support --- .../main/java/pro/gravit/launcher/profiles/ClientProfile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java index 1190994a..1a01038b 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java @@ -483,7 +483,8 @@ public enum Version { MC1171("1.17.1", 756), MC118("1.18", 757), MC1181("1.18.1", 757), - MC1182("1.18.2", 758); + MC1182("1.18.2", 758), + MC119("1.19", 759); private static final Map VERSIONS; static { From bc3c7ba171b2d284975346e0d88491f4c9bdb8b4 Mon Sep 17 00:00:00 2001 From: Gravita Date: Mon, 13 Jun 2022 19:37:40 +0700 Subject: [PATCH 4/9] [FEATURE] InstallAuthlib command --- .../gravit/launcher/server/ServerWrapper.java | 16 +- .../server/authlib/InstallAuthlib.java | 251 ++++++++++++++++++ .../authlib/LibrariesHashFileModifier.java | 8 + .../server/authlib/LibrariesLstModifier.java | 22 ++ .../authlib/PatchPropertiesModifier.java | 55 ++++ 5 files changed, 344 insertions(+), 8 deletions(-) create mode 100644 ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/InstallAuthlib.java create mode 100644 ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/LibrariesHashFileModifier.java create mode 100644 ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/LibrariesLstModifier.java create mode 100644 ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/PatchPropertiesModifier.java 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 97eddf74..45c9aeeb 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java @@ -6,8 +6,6 @@ import pro.gravit.launcher.config.JsonConfigurable; import pro.gravit.launcher.events.request.AuthRequestEvent; import pro.gravit.launcher.events.request.ProfilesRequestEvent; -import pro.gravit.launcher.modules.events.PostInitPhase; -import pro.gravit.launcher.modules.events.PreConfigPhase; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.profiles.PlayerProfile; import pro.gravit.launcher.profiles.optional.actions.OptionalAction; @@ -15,9 +13,9 @@ import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.auth.AuthRequest; import pro.gravit.launcher.request.auth.GetAvailabilityAuthRequest; -import pro.gravit.launcher.request.auth.RestoreRequest; import pro.gravit.launcher.request.update.ProfilesRequest; import pro.gravit.launcher.request.websockets.StdWebSocketService; +import pro.gravit.launcher.server.authlib.InstallAuthlib; import pro.gravit.launcher.server.launch.ClasspathLaunch; import pro.gravit.launcher.server.launch.Launch; import pro.gravit.launcher.server.launch.ModuleLaunch; @@ -27,12 +25,7 @@ import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; -import java.io.IOException; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; import java.lang.reflect.Type; -import java.net.URL; import java.nio.file.Path; import java.nio.file.Paths; import java.util.*; @@ -112,6 +105,13 @@ public void run(String... args) throws Throwable { setup.run(); System.exit(0); } + if (args.length > 1 && args[0].equals("installAuthlib") && !disableSetup) { + LogHelper.debug("Read ServerWrapperConfig.json"); + loadConfig(); + InstallAuthlib command = new InstallAuthlib(); + command. run(args[1]); + System.exit(0); + } LogHelper.debug("Read ServerWrapperConfig.json"); loadConfig(); updateLauncherConfig(); diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/InstallAuthlib.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/InstallAuthlib.java new file mode 100644 index 00000000..32f4c470 --- /dev/null +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/InstallAuthlib.java @@ -0,0 +1,251 @@ +package pro.gravit.launcher.server.authlib; + +import pro.gravit.utils.helper.IOHelper; +import pro.gravit.utils.helper.LogHelper; + +import java.io.*; +import java.net.URL; +import java.nio.file.*; +import java.nio.file.attribute.BasicFileAttributes; +import java.time.LocalDateTime; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +public class InstallAuthlib { + private static Map modifierMap; + static { + modifierMap = new HashMap<>(); + modifierMap.put("META-INF/libraries.list", new LibrariesLstModifier()); + modifierMap.put("patch.properties", new PatchPropertiesModifier()); + } + public void run(String... args) throws Exception { + boolean deleteAuthlibAfterInstall = false; + InstallAuthlibContext context = new InstallAuthlibContext(); + if(args[0].startsWith("http://") || args[0].startsWith("https://")) { + Path tempAuthlib = Paths.get("authlib.jar"); + LogHelper.info("Download %s to %s", args[0], tempAuthlib); + try(InputStream input = IOHelper.newInput(new URL(args[0]))) { + IOHelper.transfer(input, tempAuthlib); + } + context.pathToAuthlib = tempAuthlib; + deleteAuthlibAfterInstall = true; + } else { + context.pathToAuthlib = Paths.get(args[0]); + } + if(Files.notExists(context.pathToAuthlib)) { + throw new FileNotFoundException(context.pathToAuthlib.toString()); + } + context.workdir = IOHelper.WORKING_DIR; + LogHelper.info("Search .jar files in %s", context.workdir.toAbsolutePath()); + IOHelper.walk(context.workdir, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + if(file.getFileName().toString().endsWith(".jar")) { + context.files.add(file); + } + return FileVisitResult.CONTINUE; + } + }, true); + LogHelper.info("Search authlib in %d files", context.files.size()); + for(Path path : context.files) { + boolean foundAuthlib = false; + try(ZipInputStream input = IOHelper.newZipInput(path)) { + ZipEntry e = input.getNextEntry(); + while(e != null) { + String name = e.getName(); + if(!e.isDirectory() && name.contains("com/mojang/authlib") && !foundAuthlib) { + boolean isJarFile = name.endsWith(".jar"); + String prefix = isJarFile ? name : name.substring(0, name.indexOf("com/mojang/authlib")); + context.repack.add(new RepackInfo(path, prefix, isJarFile)); + foundAuthlib = true; + } + if(!e.isDirectory() && modifierMap.containsKey(name)) { + context.hashes.add(new HashFile(path, name, modifierMap.get(name))); + } + e = input.getNextEntry(); + } + } + } + Path tmpFile = Paths.get("repack.tmp"); + for(RepackInfo ri : context.repack) { + LogHelper.info("Found authlib in %s (prefix '%s' jar %s)", ri.path, ri.prefix, ri.isJarFile ? "true" : "false"); + try(ZipInputStream input = IOHelper.newZipInput(ri.path)) { + try(ZipOutputStream output = new ZipOutputStream(IOHelper.newOutput(tmpFile))) { + ZipEntry e; + e = input.getNextEntry(); + while(e != null) { + if(!e.getName().equals("META-INF") && !e.getName().equals("META-INF/") && !e.getName().equals("META-INF/MANIFEST.MF")) { + break; + } + ZipEntry newEntry = IOHelper.newZipEntry(e); + output.putNextEntry(newEntry); + IOHelper.transfer(input, output); + e = input.getNextEntry(); + } + if(!ri.isJarFile) { + try(ZipInputStream input2 = new ZipInputStream(IOHelper.newInput(context.pathToAuthlib))) { + ZipEntry e2 = input2.getNextEntry(); + while(e2 != null) { + if(e2.getName().startsWith("META-INF")) { + e2 = input2.getNextEntry(); + continue; + } + String newName = !ri.prefix.endsWith("/") && !e2.getName().startsWith("/") && !ri.prefix.isEmpty() ? + ri.prefix.concat("/").concat(e2.getName()) : ri.prefix.concat(e2.getName()); + ZipEntry newEntry = IOHelper.newZipEntry(newName); + output.putNextEntry(newEntry); + IOHelper.transfer(input2, output); + e2 = input2.getNextEntry(); + } + } + } + while(e != null) { + if(e.getName().startsWith(ri.prefix)) { + if(ri.isJarFile) { + if(context.repackedAuthlibBytes == null) { + byte[] orig = IOHelper.read(input); + context.repackedAuthlibBytes = repackAuthlibJar(orig, context.pathToAuthlib); + } + ZipEntry newEntry = IOHelper.newZipEntry(e); + output.putNextEntry(newEntry); + output.write(context.repackedAuthlibBytes); + e = input.getNextEntry(); + continue; + } else { + if(context.repackedAuthlibFiles == null) { + context.repackedAuthlibFiles = getNames(context.pathToAuthlib); + } + if(context.repackedAuthlibFiles.contains(e.getName().substring(ri.prefix.length()))) { + e = input.getNextEntry(); + continue; + } + } + } + ZipEntry newEntry = IOHelper.newZipEntry(e); + output.putNextEntry(newEntry); + IOHelper.transfer(input, output); + e = input.getNextEntry(); + } + } + } + Files.delete(ri.path); + Files.move(tmpFile, ri.path); + } + LogHelper.info("%d authlib files repacked", context.repack.size()); + for(HashFile hf : context.hashes) { + LogHelper.info("Found hash file %s in %s", hf.prefix, hf.path); + try(ZipInputStream input = IOHelper.newZipInput(hf.path)) { + try (ZipOutputStream output = new ZipOutputStream(IOHelper.newOutput(tmpFile))) { + ZipEntry e = input.getNextEntry(); + while(e != null) { + ZipEntry newEntry = IOHelper.newZipEntry(e); + output.putNextEntry(newEntry); + if(e.getName().equals(hf.prefix)) { + byte[] orig = IOHelper.read(input); + byte[] bytes = hf.modifier.apply(orig, context); + output.write(bytes); + } else { + IOHelper.transfer(input, output); + } + e = input.getNextEntry(); + } + } + } + Files.delete(hf.path); + Files.move(tmpFile, hf.path); + } + LogHelper.info("%d hash files repacked", context.hashes.size()); + if(deleteAuthlibAfterInstall) { + LogHelper.info("Delete %s", context.pathToAuthlib); + Files.delete(context.pathToAuthlib); + } + LogHelper.info("Completed"); + } + + private Set getNames(Path path) throws IOException { + Set set = new HashSet<>(); + try(ZipInputStream input = IOHelper.newZipInput(path)) { + ZipEntry e = input.getNextEntry(); + while(e != null) { + if(!e.getName().startsWith("META-INF")) { + set.add(e.getName()); + } + e = input.getNextEntry(); + } + } + return set; + } + + private byte[] repackAuthlibJar(byte[] data, Path path) throws IOException { + try(ZipInputStream input = new ZipInputStream(new ByteArrayInputStream(data))) { + ByteArrayOutputStream result = new ByteArrayOutputStream(); + try(ZipOutputStream output = new ZipOutputStream(result)) { + Set blacklist = new HashSet<>(); + try(ZipInputStream input2 = IOHelper.newZipInput(path)) { + ZipEntry e = input2.getNextEntry(); + while(e != null) { + if(e.getName().startsWith("META-INF")) { + e = input2.getNextEntry(); + continue; + } + ZipEntry newEntry = IOHelper.newZipEntry(e); + output.putNextEntry(newEntry); + IOHelper.transfer(input2, output); + blacklist.add(e.getName()); + e = input2.getNextEntry(); + } + } + ZipEntry e = input.getNextEntry(); + while(e != null) { + if(blacklist.contains(e.getName())) { + e = input.getNextEntry(); + continue; + } + ZipEntry newEntry = IOHelper.newZipEntry(e); + output.putNextEntry(newEntry); + IOHelper.transfer(input, output); + e = input.getNextEntry(); + } + } + return result.toByteArray(); + } + } + + public static class RepackInfo { + public Path path; + public String prefix; + public boolean isJarFile; + + public RepackInfo(Path path, String prefix, boolean isJarFile) { + this.path = path; + this.prefix = prefix; + this.isJarFile = isJarFile; + } + } + + public static class HashFile { + public Path path; + public String prefix; + public LibrariesHashFileModifier modifier; + + public HashFile(Path path, String prefix, LibrariesHashFileModifier modifier) { + this.path = path; + this.prefix = prefix; + this.modifier = modifier; + } + } + + public static class InstallAuthlibContext { + public Path pathToAuthlib; + public Path workdir = IOHelper.WORKING_DIR; + public List files = new ArrayList<>(); + public List repack = new ArrayList<>(); + public List hashes = new ArrayList<>(); + public byte[] repackedAuthlibBytes = null; + public Set repackedAuthlibFiles = null; + + public LocalDateTime timestamp = LocalDateTime.now(); + } +} diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/LibrariesHashFileModifier.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/LibrariesHashFileModifier.java new file mode 100644 index 00000000..4d842081 --- /dev/null +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/LibrariesHashFileModifier.java @@ -0,0 +1,8 @@ +package pro.gravit.launcher.server.authlib; + +import java.io.IOException; + +@FunctionalInterface +public interface LibrariesHashFileModifier { + byte[] apply(byte[] data, InstallAuthlib.InstallAuthlibContext context) throws IOException; +} diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/LibrariesLstModifier.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/LibrariesLstModifier.java new file mode 100644 index 00000000..b65f375c --- /dev/null +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/LibrariesLstModifier.java @@ -0,0 +1,22 @@ +package pro.gravit.launcher.server.authlib; + +import pro.gravit.utils.helper.SecurityHelper; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public class LibrariesLstModifier implements LibrariesHashFileModifier { + + @Override + public byte[] apply(byte[] data, InstallAuthlib.InstallAuthlibContext context) throws IOException { + String[] lines = new String(data).split("\n"); + for(int i=0;i Date: Sun, 19 Jun 2022 17:04:44 +0700 Subject: [PATCH 5/9] [FEATURE] InstallAuthlib support 'download-context' --- .../authlib/DownloadContextModifier.java | 30 +++++++++++++++++++ .../server/authlib/InstallAuthlib.java | 1 + 2 files changed, 31 insertions(+) create mode 100644 ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/DownloadContextModifier.java diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/DownloadContextModifier.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/DownloadContextModifier.java new file mode 100644 index 00000000..7ad939ed --- /dev/null +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/DownloadContextModifier.java @@ -0,0 +1,30 @@ +package pro.gravit.launcher.server.authlib; + +import pro.gravit.utils.helper.LogHelper; +import pro.gravit.utils.helper.SecurityHelper; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +public class DownloadContextModifier implements LibrariesHashFileModifier { + @Override + public byte[] apply(byte[] data, InstallAuthlib.InstallAuthlibContext context) throws IOException { + String[] lines = new String(data).split("\n"); + for(int i=0;i(); modifierMap.put("META-INF/libraries.list", new LibrariesLstModifier()); modifierMap.put("patch.properties", new PatchPropertiesModifier()); + modifierMap.put("META-INF/download-context", new DownloadContextModifier()); } public void run(String... args) throws Exception { boolean deleteAuthlibAfterInstall = false; From afd147f92ebff384a023346ef828615d6bfdf822 Mon Sep 17 00:00:00 2001 From: Gravita Date: Wed, 29 Jun 2022 17:36:45 +0700 Subject: [PATCH 6/9] [FIX] Small fixes --- .../launchserver/manangers/AuthManager.java | 3 +-- .../pro/gravit/launchserver/socket/Client.java | 16 ++++++++-------- .../socket/response/auth/ExitResponse.java | 5 +++++ .../client/ClientLauncherEntryPoint.java | 2 +- props.gradle | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java index e751e2d4..ca066ed1 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java @@ -8,7 +8,6 @@ import pro.gravit.launcher.events.request.AuthRequestEvent; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.profiles.PlayerProfile; -import pro.gravit.launcher.profiles.Texture; import pro.gravit.launcher.request.auth.AuthRequest; import pro.gravit.launcher.request.auth.password.*; import pro.gravit.launchserver.LaunchServer; @@ -84,7 +83,7 @@ public boolean accept(Client client, AuthProviderPair pair, String extendedToken if(client.permissions == null) client.permissions = new ClientPermissions(); client.permissions.addPerm("launchserver.checkserver"); client.permissions.addPerm(String.format("launchserver.profile.%s.show", info.serverName)); - client.setSerializableProperty("launchserver.serverName", info.serverName); + client.setProperty("launchserver.serverName", info.serverName); return true; } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java index de6fb8dc..123d359f 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java @@ -10,7 +10,6 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; -import java.util.concurrent.atomic.AtomicInteger; public class Client { public String auth_id; @@ -32,7 +31,7 @@ public class Client { public transient Map properties; - public Map serializableProperties; + public Map staticProperties; public Client() { timestamp = System.currentTimeMillis(); @@ -65,14 +64,15 @@ public void setProperty(String name, T object) { properties.put(name, object); } - public String getSerializableProperty(String name) { - if (serializableProperties == null) serializableProperties = new HashMap<>(); - return serializableProperties.get(name); + @SuppressWarnings("unchecked") + public T getStaticProperty(String name) { + if (staticProperties == null) staticProperties = new HashMap<>(); + return (T) staticProperties.get(name); } - public void setSerializableProperty(String name, String value) { - if (serializableProperties == null) serializableProperties = new HashMap<>(); - serializableProperties.put(name, value); + public void setStaticProperty(String name, T value) { + if (staticProperties == null) staticProperties = new HashMap<>(); + staticProperties.put(name, value); } public pro.gravit.launchserver.auth.core.User getUser() { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java index 3e7bc176..029bfa50 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ExitResponse.java @@ -11,6 +11,8 @@ import pro.gravit.launchserver.socket.handlers.WebSocketFrameHandler; import pro.gravit.launchserver.socket.response.SimpleResponse; +import java.util.HashMap; + public class ExitResponse extends SimpleResponse { public boolean exitAll; public String username; @@ -20,6 +22,9 @@ public static void exit(LaunchServer server, WebSocketFrameHandler wsHandler, Ch Client chClient = wsHandler.getClient(); Client newCusClient = new Client(); newCusClient.checkSign = chClient.checkSign; + if(chClient.staticProperties != null) { + newCusClient.staticProperties = new HashMap<>(chClient.staticProperties); + } wsHandler.setClient(newCusClient); ExitRequestEvent event = new ExitRequestEvent(reason); event.requestUUID = RequestEvent.eventUUID; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java index af76d9f9..06fe6b91 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java @@ -200,7 +200,7 @@ public static void main(String[] args) throws Throwable { CommonHelper.newThread("Asset Directory Watcher", true, assetWatcher).start(); CommonHelper.newThread("Client Directory Watcher", true, clientWatcher).start(); if (javaWatcher != null) - CommonHelper.newThread("Java Directory Watcher", true, clientWatcher).start(); + CommonHelper.newThread("Java Directory Watcher", true, javaWatcher).start(); verifyHDir(assetDir, params.assetHDir, assetMatcher, digest); verifyHDir(clientDir, params.clientHDir, clientMatcher, digest); if (javaWatcher != null) diff --git a/props.gradle b/props.gradle index df4cfa2f..f86ed882 100644 --- a/props.gradle +++ b/props.gradle @@ -1,7 +1,7 @@ project.ext { verAsm = '9.2' verNetty = '4.1.75.Final' - verOshiCore = '6.1.5' + verOshiCore = '6.2.0' verJunit = '5.8.2' verGuavaC = '30.1.1-jre' verJansi = '2.4.0' From ab7e5ce2f7a34f692b6cc1ac9d7595eb80d1c170 Mon Sep 17 00:00:00 2001 From: Gravita Date: Wed, 29 Jun 2022 17:37:00 +0700 Subject: [PATCH 7/9] [ANY] Update modules --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 48dad65b..d3722bf1 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 48dad65be0f613fa1a6ae544ec892592d537bcc1 +Subproject commit d3722bf136b8c8c8da3dea879d5d2015e84b0f8c From 1d349746d3fca72c5f40f03f338ddc439797f78a Mon Sep 17 00:00:00 2001 From: Gravita Date: Tue, 12 Jul 2022 15:39:44 +0700 Subject: [PATCH 8/9] [ANY] Update dependencies --- props.gradle | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/props.gradle b/props.gradle index f86ed882..0a84797d 100644 --- a/props.gradle +++ b/props.gradle @@ -1,20 +1,20 @@ project.ext { - verAsm = '9.2' - verNetty = '4.1.75.Final' - verOshiCore = '6.2.0' + verAsm = '9.3' + verNetty = '4.1.78.Final' + verOshiCore = '6.2.1' verJunit = '5.8.2' verGuavaC = '30.1.1-jre' verJansi = '2.4.0' verJline = '3.21.0' - verJwt = '0.11.2' + verJwt = '0.11.5' verBcprov = '1.70' verGson = '2.9.0' verBcpkix = '1.70' verSlf4j = '1.7.36' verLog4j = '2.17.2' - verMySQLConn = '8.0.28' - verPostgreSQLConn = '42.3.3' - verProguard = '7.2.1' + verMySQLConn = '8.0.29' + verPostgreSQLConn = '42.4.0' + verProguard = '7.2.2' verLaunch4j = '3.14' verHibernate = '5.5.6.Final' } From 349cec3e40bdedf9b4eae65a5c849e857faaae94 Mon Sep 17 00:00:00 2001 From: Gravita Date: Tue, 12 Jul 2022 15:47:31 +0700 Subject: [PATCH 9/9] [ANY] 5.2.13 stable --- LauncherCore/src/main/java/pro/gravit/utils/Version.java | 2 +- build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/Version.java b/LauncherCore/src/main/java/pro/gravit/utils/Version.java index ef7c6a15..6ca27f26 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/Version.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/Version.java @@ -8,7 +8,7 @@ public final class Version implements Comparable { public static final int MINOR = 2; public static final int PATCH = 13; public static final int BUILD = 1; - public static final Version.Type RELEASE = Type.DEV; + public static final Version.Type RELEASE = Type.STABLE; public final int major; public final int minor; public final int patch; diff --git a/build.gradle b/build.gradle index 67521b87..893b7811 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ id 'org.openjfx.javafxplugin' version '0.0.10' apply false } group = 'pro.gravit.launcher' -version = '5.2.13-SNAPSHOT' +version = '5.2.13' apply from: 'props.gradle'