From b545c099eb8da9fe1bb310161aa32421023c62cd Mon Sep 17 00:00:00 2001 From: Gravita Date: Fri, 19 Mar 2021 23:02:03 +0700 Subject: [PATCH] [FEATURE] Grand libraries update --- .../command/handler/CommandHandler.java | 4 --- .../command/install/CheckInstallCommand.java | 28 ------------------- .../command/install/MultiCommand.java | 27 ------------------ .../gravit/launcher/utils/HWIDProvider.java | 12 ++++---- LauncherCore/build.gradle | 2 +- .../pro/gravit/utils/helper/LogHelper.java | 3 +- props.gradle | 28 +++++++++---------- 7 files changed, 23 insertions(+), 81 deletions(-) delete mode 100644 LaunchServer/src/main/java/pro/gravit/launchserver/command/install/CheckInstallCommand.java delete mode 100644 LaunchServer/src/main/java/pro/gravit/launchserver/command/install/MultiCommand.java diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/handler/CommandHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/handler/CommandHandler.java index d001f466..8b0a7507 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/handler/CommandHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/handler/CommandHandler.java @@ -6,8 +6,6 @@ import pro.gravit.launchserver.command.auth.UsernameToUUIDCommand; import pro.gravit.launchserver.command.basic.*; import pro.gravit.launchserver.command.hash.*; -import pro.gravit.launchserver.command.install.CheckInstallCommand; -import pro.gravit.launchserver.command.install.MultiCommand; import pro.gravit.launchserver.command.modules.LoadModuleCommand; import pro.gravit.launchserver.command.modules.ModulesCommand; import pro.gravit.launchserver.command.service.*; @@ -64,8 +62,6 @@ public static void registerCommands(pro.gravit.utils.command.CommandHandler hand BaseCommandCategory service = new BaseCommandCategory(); service.registerCommand("config", new ConfigCommand(server)); service.registerCommand("serverStatus", new ServerStatusCommand(server)); - service.registerCommand("checkInstall", new CheckInstallCommand(server)); - service.registerCommand("multi", new MultiCommand(server)); service.registerCommand("notify", new NotifyCommand(server)); service.registerCommand("component", new ComponentCommand(server)); service.registerCommand("clients", new ClientsCommand(server)); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/install/CheckInstallCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/install/CheckInstallCommand.java deleted file mode 100644 index 44d085a6..00000000 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/install/CheckInstallCommand.java +++ /dev/null @@ -1,28 +0,0 @@ -package pro.gravit.launchserver.command.install; - -import pro.gravit.launchserver.LaunchServer; -import pro.gravit.launchserver.command.Command; -import pro.gravit.utils.helper.JVMHelper; -import pro.gravit.utils.helper.LogHelper; - -public class CheckInstallCommand extends Command { - public CheckInstallCommand(LaunchServer server) { - super(server); - } - - @Override - public String getArgsDescription() { - return null; - } - - @Override - public String getUsageDescription() { - return null; - } - - @Override - public void invoke(String... args) { - LogHelper.info("Check install success"); - JVMHelper.RUNTIME.exit(0); - } -} diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/install/MultiCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/install/MultiCommand.java deleted file mode 100644 index 396cbc8c..00000000 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/install/MultiCommand.java +++ /dev/null @@ -1,27 +0,0 @@ -package pro.gravit.launchserver.command.install; - -import pro.gravit.launchserver.LaunchServer; -import pro.gravit.launchserver.command.Command; - -public class MultiCommand extends Command { - public MultiCommand(LaunchServer server) { - super(server); - } - - @Override - public String getArgsDescription() { - return null; - } - - @Override - public String getUsageDescription() { - return null; - } - - @Override - public void invoke(String... args) { - for (String arg : args) { - server.commandHandler.eval(arg, false); - } - } -} diff --git a/Launcher/src/main/java/pro/gravit/launcher/utils/HWIDProvider.java b/Launcher/src/main/java/pro/gravit/launcher/utils/HWIDProvider.java index e316c999..40bccc9f 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/utils/HWIDProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/utils/HWIDProvider.java @@ -8,6 +8,8 @@ import oshi.software.os.OperatingSystem; import pro.gravit.launcher.request.secure.HardwareReportRequest; +import java.util.List; + public class HWIDProvider { public final SystemInfo systemInfo; public final OperatingSystem system; @@ -41,13 +43,13 @@ public int getProcessorLogicalCount() { } public boolean isBattery() { - PowerSource[] powerSources = hardware.getPowerSources(); - return powerSources != null && powerSources.length != 0; + List powerSources = hardware.getPowerSources(); + return powerSources != null && powerSources.size() != 0; } //Hardware Information public String getHWDiskID() { - HWDiskStore[] hwDiskStore = hardware.getDiskStores(); + List hwDiskStore = hardware.getDiskStores(); long size = 0; HWDiskStore maxStore = null; for (HWDiskStore store : hwDiskStore) { @@ -63,8 +65,8 @@ public String getHWDiskID() { } public byte[] getDisplayID() { - Display[] displays = hardware.getDisplays(); - if (displays == null || displays.length == 0) return null; + List displays = hardware.getDisplays(); + if (displays == null || displays.size() == 0) return null; for (Display display : displays) { return display.getEdid(); } diff --git a/LauncherCore/build.gradle b/LauncherCore/build.gradle index 50eda309..37494b9c 100644 --- a/LauncherCore/build.gradle +++ b/LauncherCore/build.gradle @@ -6,7 +6,7 @@ compileOnly group: 'org.jline', name: 'jline', version: rootProject['verJline'] compileOnly group: 'org.jline', name: 'jline-reader', version: rootProject['verJline'] compileOnly group: 'org.jline', name: 'jline-terminal', version: rootProject['verJline'] - compileOnly group: 'org.bouncycastle', name: 'bcprov-jdk15', version: rootProject['verBcprov'] + compileOnly group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: rootProject['verBcprov'] api group: 'com.google.code.gson', name: 'gson', version: rootProject['verGson'] testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit'] testImplementation group: 'org.jline', name: 'jline', version: rootProject['verJline'] diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/LogHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/LogHelper.java index 00369289..f10154b0 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/LogHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/LogHelper.java @@ -2,7 +2,6 @@ import org.fusesource.jansi.Ansi; import org.fusesource.jansi.AnsiConsole; -import org.fusesource.jansi.AnsiOutputStream; import pro.gravit.launcher.LauncherNetworkAPI; import java.io.*; @@ -409,7 +408,7 @@ public OutputEnity(Output output, OutputTypes type) { private static final class JAnsiOutput extends WriterOutput { private JAnsiOutput(OutputStream output) { - super(IOHelper.newWriter(new AnsiOutputStream(output))); + super(IOHelper.newWriter(output)); } } diff --git a/props.gradle b/props.gradle index 955bc0e9..2c647b25 100644 --- a/props.gradle +++ b/props.gradle @@ -1,18 +1,18 @@ project.ext { - verAsm = '7.3.1' - verNetty = '4.1.48.Final' - verOshiCore = '4.5.2' - verJunit = '5.6.1' - verGuavaC = '28.2-jre' - verJansi = '1.18' - verJline = '3.14.0' - verBcprov = '1.46' + verAsm = '9.1' + verNetty = '4.1.60.Final' + verOshiCore = '5.6.0' + verJunit = '5.7.1' + verGuavaC = '30.1-jre' + verJansi = '2.3.2' + verJline = '3.19.0' + verBcprov = '1.68' verGson = '2.8.6' - verBcpkix = '1.61' - verSlf4j = '1.7.25' - verMySQLConn = '8.0.19' - verPostgreSQLConn = '42.2.11' + verBcpkix = '1.68' + verSlf4j = '1.7.30' + verMySQLConn = '8.0.23' + verPostgreSQLConn = '42.2.19' verProguard = '6.2.2' - verLaunch4j = '3.12' - verHibernate = '5.4.21.Final' + verLaunch4j = '3.14' + verHibernate = '5.4.29.Final' }