From f6f6ea13ad958fc6cc5555001b7ce56f725dd81a Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Fri, 8 Dec 2023 20:24:31 +0700 Subject: [PATCH 01/23] [ANY] Experimental branch --- LaunchServer/src/main/resources/experimental-build.json | 4 ++-- LauncherCore/src/main/java/pro/gravit/utils/Version.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LaunchServer/src/main/resources/experimental-build.json b/LaunchServer/src/main/resources/experimental-build.json index ab148d00..19dc64d9 100644 --- a/LaunchServer/src/main/resources/experimental-build.json +++ b/LaunchServer/src/main/resources/experimental-build.json @@ -1,4 +1,4 @@ { - "features": [], - "info": [] + "features": ["nojava8support"], + "info": ["Java below 17 not supported"] } \ No newline at end of file diff --git a/LauncherCore/src/main/java/pro/gravit/utils/Version.java b/LauncherCore/src/main/java/pro/gravit/utils/Version.java index d42ebb45..db44d40f 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 = 5; public static final int PATCH = 3; public static final int BUILD = 1; - public static final Version.Type RELEASE = Type.STABLE; + public static final Version.Type RELEASE = Type.EXPERIMENTAL; public final int major; public final int minor; public final int patch; From f8b060422e888c0541088f0f39c7447737da817b Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Wed, 20 Dec 2023 04:45:41 +0700 Subject: [PATCH 02/23] [FEATURE] Improve LaunchServer start --- LaunchServer/build.gradle | 22 ++--- .../launchserver/LaunchServerStarter.java | 10 +-- .../java/pro/gravit/launchserver/Main.java | 53 +++++++++++ .../pro/gravit/launchserver/StarterAgent.java | 43 +-------- .../binary/tasks/exe/Launch4JTask.java | 88 +------------------ .../modules/impl/SimpleModuleManager.java | 2 +- props.gradle | 2 +- 7 files changed, 67 insertions(+), 153 deletions(-) create mode 100644 LaunchServer/src/main/java/pro/gravit/launchserver/Main.java diff --git a/LaunchServer/build.gradle b/LaunchServer/build.gradle index b522f651..57742ddd 100644 --- a/LaunchServer/build.gradle +++ b/LaunchServer/build.gradle @@ -1,4 +1,4 @@ -def mainClassName = "pro.gravit.launchserver.LaunchServerStarter" +def mainClassName = "pro.gravit.launchserver.Main" def mainAgentName = "pro.gravit.launchserver.StarterAgent" evaluationDependsOn(':Launcher') @@ -65,9 +65,7 @@ archiveClassifier.set('clean') manifest.attributes("Main-Class": mainClassName, "Premain-Class": mainAgentName, - "Can-Redefine-Classes": "true", - "Can-Retransform-Classes": "true", - "Can-Set-Native-Method-Prefix": "true" + "Automatic-Module-Name": "launchserver" ) from sourceSets.main.output } @@ -84,13 +82,15 @@ pack project(':LauncherModernCore') bundle group: 'org.jline', name: 'jline-terminal', version: rootProject['verJline'] bundle group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: rootProject['verBcpkix'] bundle group: 'org.ow2.asm', name: 'asm-commons', version: rootProject['verAsm'] - bundle group: 'io.netty', name: 'netty-all', version: rootProject['verNetty'] + bundle group: 'io.netty', name: 'netty-codec-http', version: rootProject['verNetty'] + bundle group: 'io.netty', name: 'netty-transport-classes-epoll', version: rootProject['verNetty'] + bundle group: 'io.netty', name: 'netty-transport-native-epoll', version: rootProject['verNetty'], classifier: 'linux-x86_64' bundle group: 'org.slf4j', name: 'slf4j-api', version: rootProject['verSlf4j'] bundle group: 'com.mysql', name: 'mysql-connector-j', version: rootProject['verMySQLConn'] bundle group: 'org.postgresql', name: 'postgresql', version: rootProject['verPostgreSQLConn'] bundle group: 'com.guardsquare', name: 'proguard-base', version: rootProject['verProguard'] bundle group: 'org.apache.logging.log4j', name: 'log4j-core', version: rootProject['verLog4j'] - bundle group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: rootProject['verLog4j'] + bundle group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: rootProject['verLog4j'] bundle group: 'io.jsonwebtoken', name: 'jjwt-api', version: rootProject['verJwt'] bundle group: 'io.jsonwebtoken', name: 'jjwt-impl', version: rootProject['verJwt'] bundle group: 'io.jsonwebtoken', name: 'jjwt-gson', version: rootProject['verJwt'] @@ -104,16 +104,6 @@ pack project(':LauncherModernCore') exclude group: 'org.slf4j' } - launch4j('net.sf.launch4j:launch4j:' + rootProject['verLaunch4j']) { - exclude group: 'org.apache.ant' - exclude group: 'net.java.abeille' - exclude group: 'foxtrot' - exclude group: 'com.jgoodies' - exclude group: 'org.slf4j' - } - launch4j('net.sf.launch4j:launch4j:' + rootProject['verLaunch4j'] + ':workdir-win32') { transitive = false } - launch4j('net.sf.launch4j:launch4j:' + rootProject['verLaunch4j'] + ':workdir-linux64') { transitive = false } - compileOnlyA group: 'com.google.guava', name: 'guava', version: rootProject['verGuavaC'] // Do not update (laggy deps). compileOnlyA 'log4j:log4j:1.2.17' diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java index 19b7b01d..23ec6593 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java @@ -28,12 +28,15 @@ import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.LogHelper; +import pro.gravit.utils.launch.LaunchOptions; +import pro.gravit.utils.launch.ModuleLaunch; import java.io.*; import java.nio.file.Files; import java.nio.file.Path; import java.security.Security; import java.security.cert.CertificateException; +import java.util.ArrayList; import java.util.List; public class LaunchServerStarter { @@ -42,15 +45,10 @@ public class LaunchServerStarter { private static final Logger logger = LogManager.getLogger(); public static void main(String[] args) throws Exception { - JVMHelper.checkStackTrace(LaunchServerStarter.class); - JVMHelper.verifySystemProperties(LaunchServer.class, true); + JVMHelper.verifySystemProperties(LaunchServer.class, false); //LogHelper.addOutput(IOHelper.WORKING_DIR.resolve("LaunchServer.log")); LogHelper.printVersion("LaunchServer"); LogHelper.printLicense("LaunchServer"); - if (!StarterAgent.isAgentStarted()) { - LogHelper.error("StarterAgent is not started!"); - LogHelper.error("You should add to JVM options this option: `-javaagent:LaunchServer.jar`"); - } Path dir = IOHelper.WORKING_DIR; Path configFile, runtimeConfigFile; try { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/Main.java b/LaunchServer/src/main/java/pro/gravit/launchserver/Main.java new file mode 100644 index 00000000..58f90497 --- /dev/null +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/Main.java @@ -0,0 +1,53 @@ +package pro.gravit.launchserver; + +import pro.gravit.utils.helper.IOHelper; +import pro.gravit.utils.launch.ClassLoaderControl; +import pro.gravit.utils.launch.LaunchOptions; +import pro.gravit.utils.launch.ModuleLaunch; + +import java.nio.file.FileVisitOption; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; + +public class Main { + private static final List classpathOnly = List.of("proguard", "jline", "kotlin", "epoll"); + private static boolean isClasspathOnly(Path path) { + var fileName = path.getFileName().toString(); + for(var e : classpathOnly) { + if(fileName.contains(e)) { + return true; + } + } + return false; + } + + public static void main(String[] args) throws Throwable { + ModuleLaunch launch = new ModuleLaunch(); + LaunchOptions options = new LaunchOptions(); + options.disablePackageDelegateSupport = true; + options.moduleConf = new LaunchOptions.ModuleConf(); + List libraries; + try(Stream files = Files.walk(Path.of("libraries"), FileVisitOption.FOLLOW_LINKS)) { + libraries = new ArrayList<>(files.filter(e -> e.getFileName().toString().endsWith(".jar")).toList()); + } + List classpath = new ArrayList<>(); + List modulepath = new ArrayList<>(); + for(var l : libraries) { + if(isClasspathOnly(l)) { + classpath.add(l); + } else { + modulepath.add(l.toAbsolutePath().toString()); + } + } + classpath.add(IOHelper.getCodeSource(LaunchServerStarter.class)); + options.moduleConf.modulePath.addAll(modulepath); + options.moduleConf.modules.add("ALL-MODULE-PATH"); + ClassLoaderControl control = launch.init(classpath, "natives", options); + ModuleLayer.Controller controller = (ModuleLayer.Controller) control.getJava9ModuleController(); + launch.launch("pro.gravit.launchserver.LaunchServerStarter", null, Arrays.asList(args)); + } +} diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/StarterAgent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/StarterAgent.java index a6edd6b3..2809eac6 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/StarterAgent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/StarterAgent.java @@ -20,47 +20,6 @@ public static boolean isAgentStarted() { } public static void premain(String agentArgument, Instrumentation inst) { - StarterAgent.inst = inst; - libraries = Paths.get(Optional.ofNullable(agentArgument).map(String::trim).filter(e -> !e.isEmpty()).orElse("libraries")); - isStarted = true; - try { - Files.walkFileTree(libraries, Collections.singleton(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new StarterVisitor()); - } catch (IOException e) { - e.printStackTrace(System.err); - } - } - - private static final class StarterVisitor extends SimpleFileVisitor { - private static final Set DPERMS; - - static { - Set perms = new HashSet<>(Arrays.asList(PosixFilePermission.values())); - perms.remove(PosixFilePermission.OTHERS_WRITE); - perms.remove(PosixFilePermission.GROUP_WRITE); - DPERMS = Collections.unmodifiableSet(perms); - } - - private final boolean fixLib; - - private StarterVisitor() { - Path filef = StarterAgent.libraries.resolve(".libraries_chmoded"); - this.fixLib = !Files.exists(filef) && !Boolean.getBoolean("launcher.noLibrariesPosixPermsFix"); - if (fixLib) { - try { - Files.deleteIfExists(filef); - Files.createFile(filef); - } catch (Throwable ignored) { - } - } - } - - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - if (fixLib && Files.getFileAttributeView(file, PosixFileAttributeView.class) != null) - Files.setPosixFilePermissions(file, DPERMS); - if (file.toFile().getName().endsWith(".jar")) - inst.appendToSystemClassLoaderSearch(new JarFile(file.toFile())); - return super.visitFile(file, attrs); - } + throw new UnsupportedOperationException("Please remove -javaagent option from start.sh"); } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java index 400d529c..51197ee1 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java @@ -1,8 +1,5 @@ package pro.gravit.launchserver.binary.tasks.exe; -import net.sf.launch4j.Builder; -import net.sf.launch4j.Log; -import net.sf.launch4j.config.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import pro.gravit.launchserver.LaunchServer; @@ -37,89 +34,6 @@ public String getName() { @Override public Path process(Path inputFile) throws IOException { - logger.info("Building launcher EXE binary file (Using Launch4J)"); - Path output = setConfig(); - - // Set favicon path - Config config = ConfigPersister.getInstance().getConfig(); - if (IOHelper.isFile(faviconFile)) - config.setIcon(faviconFile.toFile()); - else { - config.setIcon(null); - logger.warn("Missing favicon.ico file"); - } - - // Start building - Builder builder = new Builder(Launch4JLog.INSTANCE); - try { - builder.build(); - } catch (Throwable e) { - throw new IOException(e); - } - return output; - } - - private Path setConfig() { - Path path = server.launcherEXEBinary.nextPath(getName()); - Config config = new Config(); - // Set file options - config.setChdir("."); - config.setErrTitle("JVM Error"); - config.setDownloadUrl(server.config.launch4j.downloadUrl); - if (server.config.launch4j.supportURL != null) config.setSupportUrl(server.config.launch4j.supportURL); - // Set boolean options - config.setPriorityIndex(0); - config.setHeaderType(Config.GUI_HEADER); - config.setStayAlive(false); - config.setRestartOnCrash(false); - - // Prepare JRE - Jre jre = new Jre(); - jre.setMinVersion(server.config.launch4j.minVersion); - if (server.config.launch4j.setMaxVersion) - jre.setMaxVersion(server.config.launch4j.maxVersion); - jre.setPath(System.getProperty("java.home")); - config.setJre(jre); - - // Prepare version info (product) - VersionInfo info = new VersionInfo(); - info.setProductName(server.config.launch4j.productName); - info.setProductVersion(formatVars(server.config.launch4j.productVer)); - info.setFileDescription(server.config.launch4j.fileDesc); - info.setFileVersion(formatVars(server.config.launch4j.fileVer)); - info.setCopyright(server.config.launch4j.copyright); - info.setTrademarks(server.config.launch4j.trademarks); - info.setInternalName(formatVars(server.config.launch4j.internalName)); - // Prepare version info (file) - info.setTxtFileVersion(formatVars(server.config.launch4j.txtFileVersion)); - info.setTxtProductVersion(formatVars(server.config.launch4j.txtProductVersion)); - // Prepare version info (misc) - info.setOriginalFilename(path.getFileName().toString()); - info.setLanguage(LanguageID.RUSSIAN); - config.setVersionInfo(info); - - // Set JAR wrapping options - config.setDontWrapJar(false); - config.setJar(server.launcherBinary.syncBinaryFile.toFile()); - config.setOutfile(path.toFile()); - - // Return prepared config - ConfigPersister.getInstance().setAntConfig(config, null); - return path; - } - - private final static class Launch4JLog extends Log { - private static final Launch4JLog INSTANCE = new Launch4JLog(); - private static final Logger logger = LogManager.getLogger(); - - @Override - public void append(String s) { - logger.info(s); - } - - @Override - public void clear() { - // Do nothing - } + throw new UnsupportedOperationException("Launch4j not supported"); } } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java index 773e2f72..db72e805 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java @@ -33,7 +33,7 @@ public class SimpleModuleManager implements LauncherModulesManager { protected final ModulesConfigManager modulesConfigManager; protected final Path modulesDir; protected final LauncherTrustManager trustManager; - protected final PublicURLClassLoader classLoader = new PublicURLClassLoader(new URL[]{}); + protected final PublicURLClassLoader classLoader = new PublicURLClassLoader(new URL[]{}, SimpleModuleManager.class.getClassLoader()); protected LauncherInitContext initContext; public SimpleModuleManager(Path modulesDir, Path configDir) { diff --git a/props.gradle b/props.gradle index d8072da7..5af02d67 100644 --- a/props.gradle +++ b/props.gradle @@ -10,7 +10,7 @@ verBcprov = '1.70' verGson = '2.10.1' verBcpkix = '1.70' - verSlf4j = '1.7.36' + verSlf4j = '2.0.9' verLog4j = '2.20.0' verMySQLConn = '8.1.0' verPostgreSQLConn = '42.6.0' From c9b6b0279a5c5e7ad41bd3bc1ebccf03960e2b22 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sat, 23 Dec 2023 12:05:23 +0700 Subject: [PATCH 03/23] [REFACTOR] Renaming --- .../pro/gravit/launchserver/LaunchServer.java | 2 +- .../launchserver/LaunchServerStarter.java | 2 +- .../launchserver/asm/InjectClassAcceptor.java | 4 +-- .../launchserver/binary/BuildContext.java | 4 +-- .../command/modules/ModulesCommand.java | 2 +- .../launchermodules/LauncherModuleLoader.java | 2 +- .../manangers/CertificateManager.java | 2 +- .../manangers/LaunchServerGsonManager.java | 2 +- .../manangers/UpdatesManager.java | 6 ++-- .../impl/LaunchServerModulesManager.java | 2 +- .../response/update/UpdateResponse.java | 2 +- .../gravit/launchserver/defaults/proguard.cfg | 8 ++--- .../launchserver/ASMTransformersTest.java | 2 +- .../{ => client/runtime}/LauncherEngine.java | 30 +++++++++++-------- .../runtime}/LauncherEngineWrapper.java | 3 +- .../runtime}/NewLauncherSettings.java | 9 ++---- .../client}/ClientLauncherProcess.java | 16 +++++----- .../client}/RuntimeGsonManager.java | 5 ++-- .../client}/RuntimeLauncherCoreModule.java | 2 +- .../{ => runtime/client}/ServerPinger.java | 6 ++-- .../{ => runtime/client}/UserSettings.java | 2 +- .../client}/events/ClientEngineInitPhase.java | 4 +-- .../client}/events/ClientGuiPhase.java | 4 +-- .../client}/events/ClientPreGuiPhase.java | 4 +-- .../events/ClientUnlockConsoleEvent.java | 2 +- .../ClientProcessBuilderCreateEvent.java | 4 +-- .../ClientProcessBuilderLaunchedEvent.java | 4 +-- ...lientProcessBuilderParamsWrittedEvent.java | 4 +-- .../ClientProcessBuilderPreLaunchEvent.java | 4 +-- .../runtime}/console/GetPublicKeyCommand.java | 4 +-- .../runtime}/console/ModulesCommand.java | 8 ++--- .../runtime}/console/SignDataCommand.java | 4 +-- .../runtime}/console/UnlockCommand.java | 6 ++-- .../test/PrintHardwareInfoCommand.java | 4 +-- .../runtime}/debug/ClientRuntimeProvider.java | 10 +++---- .../debug/DebugLauncherTrustManager.java | 4 +-- .../{ => client/runtime}/debug/DebugMain.java | 12 ++++---- .../runtime}/gui/NoRuntimeProvider.java | 2 +- .../runtime}/gui/RuntimeProvider.java | 2 +- .../runtime}/managers/ConsoleManager.java | 10 +++---- .../runtime}/managers/SettingsManager.java | 17 ++--------- .../runtime}/utils/HWIDProvider.java | 2 +- .../runtime}/utils/LauncherUpdater.java | 6 ++-- .../gravit/launcher/ClientPermissions.java | 2 ++ .../java/pro/gravit/launcher/Launcher.java | 4 +-- .../pro/gravit/launcher/LauncherConfig.java | 9 ++++-- .../{ => client}/api/AuthService.java | 2 +- .../{ => client}/api/ClientService.java | 2 +- .../{ => client}/api/ConfigService.java | 2 +- .../launcher/{ => client}/api/KeyService.java | 2 +- .../runtime}/managers/ConfigManager.java | 2 +- .../managers/SimpleModulesConfigManager.java | 2 +- .../launcher/events/NotificationEvent.java | 2 +- .../gravit/launcher/events/RequestEvent.java | 2 +- .../events/request/AuthRequestEvent.java | 2 +- .../BatchProfileByUsernameRequestEvent.java | 2 +- .../request/CheckServerRequestEvent.java | 2 +- .../events/request/ErrorRequestEvent.java | 2 +- .../GetAvailabilityAuthRequestEvent.java | 2 +- .../request/JoinServerRequestEvent.java | 2 +- .../events/request/LauncherRequestEvent.java | 2 +- .../request/ProfileByUUIDRequestEvent.java | 2 +- .../ProfileByUsernameRequestEvent.java | 2 +- .../events/request/ProfilesRequestEvent.java | 2 +- .../request/SetProfileRequestEvent.java | 2 +- .../request/UpdateListRequestEvent.java | 2 +- .../events/request/UpdateRequestEvent.java | 4 +-- .../launcher/modules/LauncherModule.java | 2 +- .../modules/impl/SimpleModuleManager.java | 4 +-- .../launcher/profiles/ClientProfile.java | 4 +-- .../pro/gravit/launcher/profiles/Texture.java | 4 +-- .../profiles/optional/OptionalDepend.java | 2 +- .../profiles/optional/OptionalFile.java | 2 +- .../optional/actions/OptionalActionFile.java | 2 +- .../pro/gravit/launcher/request/Request.java | 2 +- .../launcher/request/auth/AuthRequest.java | 2 +- .../request/auth/CheckServerRequest.java | 2 +- .../request/auth/JoinServerRequest.java | 2 +- .../request/auth/SetProfileRequest.java | 2 +- .../auth/password/AuthAESPassword.java | 2 +- .../auth/password/AuthPlainPassword.java | 2 +- .../request/update/LauncherRequest.java | 2 +- .../request/update/UpdateRequest.java | 2 +- .../uuid/BatchProfileByUsernameRequest.java | 2 +- .../request/uuid/ProfileByUUIDRequest.java | 2 +- .../uuid/ProfileByUsernameRequest.java | 2 +- .../request/websockets/ClientJSONPoint.java | 4 +-- .../websockets/ClientWebSocketService.java | 4 +-- .../BasicLauncherEventHandler.java | 4 +-- .../{ => client}/ClientLauncherMethods.java | 16 +++++----- .../launcher/{ => client}/LauncherAgent.java | 4 +-- .../{ => client}/api/CertificateService.java | 8 ++--- .../{ => client}/api/DialogService.java | 2 +- .../{ => client}/api/SystemService.java | 4 +-- .../client}/ClientGsonManager.java | 4 +-- .../client}/ClientLauncherCoreModule.java | 2 +- .../client}/ClientLauncherEntryPoint.java | 23 +++++++------- .../client}/ClientModuleManager.java | 4 +-- .../{ => runtime/client}/ClientParams.java | 4 +-- .../{ => runtime/client}/DirBridge.java | 2 +- .../client}/events/ClientExitPhase.java | 2 +- .../client/ClientProcessClassLoaderEvent.java | 2 +- .../events/client/ClientProcessInitPhase.java | 4 +-- .../client/ClientProcessLaunchEvent.java | 4 +-- .../ClientProcessPreInvokeMainClassEvent.java | 4 +-- .../client/ClientProcessReadyEvent.java | 4 +-- .../runtime}/utils/ApiBridgeService.java | 4 +-- .../runtime}/utils/DirWatcher.java | 12 ++++---- .../runtime}/utils/NativeJVMHalt.java | 2 +- .../CertificatePinningTrustManager.java | 2 +- .../launcher/{ => core}/LauncherInject.java | 2 +- .../LauncherInjectionConstructor.java | 2 +- .../{ => core}/LauncherNetworkAPI.java | 2 +- .../{ => core}/LauncherTrustManager.java | 2 +- .../{ => core}/hasher/FileNameMatcher.java | 2 +- .../launcher/{ => core}/hasher/HashedDir.java | 10 +++---- .../{ => core}/hasher/HashedEntry.java | 10 +++---- .../{ => core}/hasher/HashedEntryAdapter.java | 2 +- .../{ => core}/hasher/HashedFile.java | 8 ++--- .../{ => core}/managers/GsonManager.java | 6 ++-- .../launcher/{ => core}/serialize/HInput.java | 2 +- .../{ => core}/serialize/HOutput.java | 2 +- .../serialize/signed/DigestBytesHolder.java | 8 ++--- .../serialize/stream/EnumSerializer.java | 8 ++--- .../serialize/stream/StreamObject.java | 6 ++-- .../pro/gravit/utils/helper/LogHelper.java | 2 +- .../gravit/launcher/modern/Downloader.java | 4 +-- .../{ => start}/ClientLauncherWrapper.java | 10 ++++--- .../{ => start}/ClientWrapperModule.java | 4 +-- .../RuntimeModuleManager.java | 6 ++-- .../gravit/launcher/server/ServerWrapper.java | 11 +++---- .../server/ServerWrapperGsonManager.java | 2 +- modules | 2 +- 133 files changed, 287 insertions(+), 288 deletions(-) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/LauncherEngine.java (90%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/LauncherEngineWrapper.java (94%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/NewLauncherSettings.java (54%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/ClientLauncherProcess.java (94%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/RuntimeGsonManager.java (83%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/RuntimeLauncherCoreModule.java (90%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/ServerPinger.java (98%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/UserSettings.java (74%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/ClientEngineInitPhase.java (68%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/ClientGuiPhase.java (69%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/ClientPreGuiPhase.java (69%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/ClientUnlockConsoleEvent.java (84%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/client/ClientProcessBuilderCreateEvent.java (70%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/client/ClientProcessBuilderLaunchedEvent.java (70%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/client/ClientProcessBuilderParamsWrittedEvent.java (69%) rename Launcher/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/client/ClientProcessBuilderPreLaunchEvent.java (70%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/console/GetPublicKeyCommand.java (86%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/console/ModulesCommand.java (88%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/console/SignDataCommand.java (88%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/console/UnlockCommand.java (82%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/console/test/PrintHardwareInfoCommand.java (95%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/debug/ClientRuntimeProvider.java (96%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/debug/DebugLauncherTrustManager.java (89%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/debug/DebugMain.java (92%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/gui/NoRuntimeProvider.java (89%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/gui/RuntimeProvider.java (72%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/managers/ConsoleManager.java (87%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/managers/SettingsManager.java (64%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/utils/HWIDProvider.java (98%) rename Launcher/src/main/java/pro/gravit/launcher/{ => client/runtime}/utils/LauncherUpdater.java (95%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => client}/api/AuthService.java (94%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => client}/api/ClientService.java (93%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => client}/api/ConfigService.java (88%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => client}/api/KeyService.java (84%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => client/runtime}/managers/ConfigManager.java (96%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => client/runtime}/managers/SimpleModulesConfigManager.java (95%) rename LauncherClient/src/main/java/pro/gravit/launcher/{ => client}/BasicLauncherEventHandler.java (94%) rename LauncherClient/src/main/java/pro/gravit/launcher/{ => client}/ClientLauncherMethods.java (92%) rename LauncherClient/src/main/java/pro/gravit/launcher/{ => client}/LauncherAgent.java (94%) rename LauncherClient/src/main/java/pro/gravit/launcher/{ => client}/api/CertificateService.java (94%) rename LauncherClient/src/main/java/pro/gravit/launcher/{ => client}/api/DialogService.java (98%) rename LauncherClient/src/main/java/pro/gravit/launcher/{ => client}/api/SystemService.java (69%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/ClientGsonManager.java (85%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/ClientLauncherCoreModule.java (90%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/ClientLauncherEntryPoint.java (95%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/ClientModuleManager.java (90%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/ClientParams.java (97%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/DirBridge.java (98%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/ClientExitPhase.java (78%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/client/ClientProcessClassLoaderEvent.java (90%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/client/ClientProcessInitPhase.java (65%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/client/ClientProcessLaunchEvent.java (66%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/client/ClientProcessPreInvokeMainClassEvent.java (81%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{ => runtime/client}/events/client/ClientProcessReadyEvent.java (66%) rename LauncherClient/src/main/java/pro/gravit/launcher/{ => client/runtime}/utils/ApiBridgeService.java (86%) rename LauncherClient/src/main/java/pro/gravit/launcher/{ => client/runtime}/utils/DirWatcher.java (93%) rename LauncherClient/src/main/java/pro/gravit/launcher/{ => client/runtime}/utils/NativeJVMHalt.java (94%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/CertificatePinningTrustManager.java (98%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/LauncherInject.java (89%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/LauncherInjectionConstructor.java (89%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/LauncherNetworkAPI.java (94%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/LauncherTrustManager.java (99%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/hasher/FileNameMatcher.java (97%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/hasher/HashedDir.java (98%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/hasher/HashedEntry.java (72%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/hasher/HashedEntryAdapter.java (96%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/hasher/HashedFile.java (92%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/managers/GsonManager.java (86%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/serialize/HInput.java (98%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/serialize/HOutput.java (98%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/serialize/signed/DigestBytesHolder.java (86%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/serialize/stream/EnumSerializer.java (79%) rename LauncherCore/src/main/java/pro/gravit/launcher/{ => core}/serialize/stream/StreamObject.java (81%) rename LauncherStart/src/main/java/pro/gravit/launcher/{ => start}/ClientLauncherWrapper.java (96%) rename LauncherStart/src/main/java/pro/gravit/launcher/{ => start}/ClientWrapperModule.java (60%) rename LauncherStart/src/main/java/pro/gravit/launcher/{client => start}/RuntimeModuleManager.java (88%) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java index d016db56..3482f317 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java @@ -5,7 +5,7 @@ import pro.gravit.launcher.Launcher; import pro.gravit.launcher.events.RequestEvent; import pro.gravit.launcher.events.request.ProfilesRequestEvent; -import pro.gravit.launcher.managers.ConfigManager; +import pro.gravit.launcher.client.runtime.managers.ConfigManager; import pro.gravit.launcher.modules.events.ClosePhase; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launchserver.auth.AuthProviderPair; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java index 19b7b01d..3072b4cb 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java @@ -4,7 +4,7 @@ import org.apache.logging.log4j.Logger; import org.bouncycastle.jce.provider.BouncyCastleProvider; import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherTrustManager; +import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.launcher.modules.events.PreConfigPhase; import pro.gravit.launcher.profiles.optional.actions.OptionalAction; import pro.gravit.launcher.profiles.optional.triggers.OptionalTrigger; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/asm/InjectClassAcceptor.java b/LaunchServer/src/main/java/pro/gravit/launchserver/asm/InjectClassAcceptor.java index c0e6d454..a673bbe0 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/asm/InjectClassAcceptor.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/asm/InjectClassAcceptor.java @@ -4,8 +4,8 @@ import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; import org.objectweb.asm.tree.*; -import pro.gravit.launcher.LauncherInject; -import pro.gravit.launcher.LauncherInjectionConstructor; +import pro.gravit.launcher.core.LauncherInject; +import pro.gravit.launcher.core.LauncherInjectionConstructor; import pro.gravit.launchserver.binary.BuildContext; import pro.gravit.launchserver.binary.tasks.MainBuildTask; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java index 6d00a5cc..069a5e3c 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java @@ -3,8 +3,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.serialize.HOutput; -import pro.gravit.launcher.serialize.stream.StreamObject; +import pro.gravit.launcher.core.serialize.HOutput; +import pro.gravit.launcher.core.serialize.stream.StreamObject; import pro.gravit.launchserver.binary.tasks.MainBuildTask; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.SecurityHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/modules/ModulesCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/modules/ModulesCommand.java index d76c0b59..e535b365 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/modules/ModulesCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/modules/ModulesCommand.java @@ -2,7 +2,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.LauncherTrustManager; +import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.launcher.modules.LauncherModule; import pro.gravit.launcher.modules.LauncherModuleInfo; import pro.gravit.launchserver.LaunchServer; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/launchermodules/LauncherModuleLoader.java b/LaunchServer/src/main/java/pro/gravit/launchserver/launchermodules/LauncherModuleLoader.java index de2555f0..df68ff85 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/launchermodules/LauncherModuleLoader.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/launchermodules/LauncherModuleLoader.java @@ -3,7 +3,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherTrustManager; +import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.asm.InjectClassAcceptor; import pro.gravit.launchserver.binary.tasks.MainBuildTask; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/CertificateManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/CertificateManager.java index 51f63436..fa822fcf 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/CertificateManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/CertificateManager.java @@ -11,7 +11,7 @@ import org.bouncycastle.util.io.pem.PemObject; import org.bouncycastle.util.io.pem.PemReader; import org.bouncycastle.util.io.pem.PemWriter; -import pro.gravit.launcher.LauncherTrustManager; +import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.JVMHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java index 8b5e3c14..c3f4e575 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java @@ -3,7 +3,7 @@ import com.google.gson.GsonBuilder; import marcono1234.gson.recordadapter.RecordTypeAdapterFactory; import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent; -import pro.gravit.launcher.managers.GsonManager; +import pro.gravit.launcher.core.managers.GsonManager; import pro.gravit.launcher.modules.events.PreGsonPhase; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.profiles.optional.actions.OptionalAction; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/UpdatesManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/UpdatesManager.java index 47e9f4f6..848fa27b 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/UpdatesManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/UpdatesManager.java @@ -2,9 +2,9 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.hasher.HashedDir; -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.serialize.HOutput; +import pro.gravit.launcher.core.hasher.HashedDir; +import pro.gravit.launcher.core.serialize.HInput; +import pro.gravit.launcher.core.serialize.HOutput; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.modules.events.LaunchServerUpdatesSyncEvent; import pro.gravit.utils.helper.IOHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java index daa4b592..1149eaa6 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.modules.impl; -import pro.gravit.launcher.LauncherTrustManager; +import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.launcher.modules.LauncherModule; import pro.gravit.launcher.modules.impl.SimpleModuleManager; import pro.gravit.launchserver.LaunchServer; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java index 47f12185..f1a3cd1e 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java @@ -2,7 +2,7 @@ import io.netty.channel.ChannelHandlerContext; import pro.gravit.launcher.events.request.UpdateRequestEvent; -import pro.gravit.launcher.hasher.HashedDir; +import pro.gravit.launcher.core.hasher.HashedDir; import pro.gravit.launchserver.auth.protect.interfaces.ProfilesProtectHandler; import pro.gravit.launchserver.config.LaunchServerConfig; import pro.gravit.launchserver.socket.Client; diff --git a/LaunchServer/src/main/resources/pro/gravit/launchserver/defaults/proguard.cfg b/LaunchServer/src/main/resources/pro/gravit/launchserver/defaults/proguard.cfg index 03507d17..ca10f5fa 100644 --- a/LaunchServer/src/main/resources/pro/gravit/launchserver/defaults/proguard.cfg +++ b/LaunchServer/src/main/resources/pro/gravit/launchserver/defaults/proguard.cfg @@ -16,19 +16,19 @@ -keeppackagenames com.mojang.**,net.minecraftforge.fml.**,cpw.mods.fml.**,com.google.gson.**,pro.gravit.repackage.**,org.fusesource.**, pro.gravit.launcher.api.**, pro.gravit.utils.**, pro.gravit.launcher.request.**, pro.gravit.launcher.events.**, pro.gravit.launcher.profiles.** --keep class com.mojang.**,net.minecraftforge.fml.**,cpw.mods.fml.**,com.google.gson.**,pro.gravit.repackage.**,org.fusesource.**, pro.gravit.launcher.api.**, pro.gravit.utils.**, pro.gravit.launcher.request.**, pro.gravit.launcher.events.**, pro.gravit.launcher.profiles.**, pro.gravit.launcher.LauncherEngineWrapper { +-keep class com.mojang.**,net.minecraftforge.fml.**,cpw.mods.fml.**,com.google.gson.**,pro.gravit.repackage.**,org.fusesource.**, pro.gravit.launcher.client.api.**, pro.gravit.utils.**, pro.gravit.launcher.request.**, pro.gravit.launcher.events.**, pro.gravit.launcher.profiles.**, pro.gravit.launcher.LauncherEngineWrapper { *; } --keepclassmembers @pro.gravit.launcher.LauncherNetworkAPI class ** { +-keepclassmembers @pro.gravit.launcher.core.LauncherNetworkAPI class ** { ; ; } -keepclassmembers class ** { - @pro.gravit.launcher.LauncherNetworkAPI + @pro.gravit.launcher.core.LauncherNetworkAPI ; - @pro.gravit.launcher.LauncherNetworkAPI + @pro.gravit.launcher.core.LauncherNetworkAPI ; } diff --git a/LaunchServer/src/test/java/pro/gravit/launchserver/ASMTransformersTest.java b/LaunchServer/src/test/java/pro/gravit/launchserver/ASMTransformersTest.java index 112fbc13..1d9d8e2d 100644 --- a/LaunchServer/src/test/java/pro/gravit/launchserver/ASMTransformersTest.java +++ b/LaunchServer/src/test/java/pro/gravit/launchserver/ASMTransformersTest.java @@ -6,7 +6,7 @@ import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.ClassNode; -import pro.gravit.launcher.LauncherInject; +import pro.gravit.launcher.core.LauncherInject; import pro.gravit.launchserver.asm.InjectClassAcceptor; import pro.gravit.utils.helper.JarHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngine.java similarity index 90% rename from Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngine.java index 6acaa780..9c4be3e3 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngine.java @@ -1,15 +1,21 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.client.runtime; -import pro.gravit.launcher.client.*; -import pro.gravit.launcher.client.events.ClientEngineInitPhase; -import pro.gravit.launcher.client.events.ClientExitPhase; -import pro.gravit.launcher.client.events.ClientPreGuiPhase; -import pro.gravit.launcher.console.GetPublicKeyCommand; -import pro.gravit.launcher.console.ModulesCommand; -import pro.gravit.launcher.console.SignDataCommand; -import pro.gravit.launcher.gui.NoRuntimeProvider; -import pro.gravit.launcher.gui.RuntimeProvider; -import pro.gravit.launcher.managers.ConsoleManager; +import pro.gravit.launcher.*; +import pro.gravit.launcher.client.BasicLauncherEventHandler; +import pro.gravit.launcher.client.ClientLauncherMethods; +import pro.gravit.launcher.client.LauncherAgent; +import pro.gravit.launcher.client.runtime.client.*; +import pro.gravit.launcher.client.runtime.client.events.ClientEngineInitPhase; +import pro.gravit.launcher.client.runtime.client.events.ClientExitPhase; +import pro.gravit.launcher.client.runtime.client.events.ClientPreGuiPhase; +import pro.gravit.launcher.client.runtime.console.GetPublicKeyCommand; +import pro.gravit.launcher.client.runtime.console.ModulesCommand; +import pro.gravit.launcher.client.runtime.console.SignDataCommand; +import pro.gravit.launcher.client.runtime.gui.NoRuntimeProvider; +import pro.gravit.launcher.client.runtime.gui.RuntimeProvider; +import pro.gravit.launcher.client.runtime.managers.ConsoleManager; +import pro.gravit.launcher.client.runtime.utils.NativeJVMHalt; +import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.launcher.modules.events.OfflineModeEvent; import pro.gravit.launcher.modules.events.PreConfigPhase; import pro.gravit.launcher.profiles.optional.actions.OptionalAction; @@ -20,7 +26,7 @@ import pro.gravit.launcher.request.auth.*; import pro.gravit.launcher.request.websockets.OfflineRequestService; import pro.gravit.launcher.request.websockets.StdWebSocketService; -import pro.gravit.launcher.utils.NativeJVMHalt; +import pro.gravit.launcher.start.RuntimeModuleManager; import pro.gravit.utils.helper.*; import java.io.IOException; diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngineWrapper.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngineWrapper.java similarity index 94% rename from Launcher/src/main/java/pro/gravit/launcher/LauncherEngineWrapper.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngineWrapper.java index a637a571..01d588aa 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngineWrapper.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngineWrapper.java @@ -1,5 +1,6 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.client.runtime; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.launch.LaunchOptions; import pro.gravit.utils.launch.ModuleLaunch; diff --git a/Launcher/src/main/java/pro/gravit/launcher/NewLauncherSettings.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/NewLauncherSettings.java similarity index 54% rename from Launcher/src/main/java/pro/gravit/launcher/NewLauncherSettings.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/NewLauncherSettings.java index e7019d0a..bcb5c355 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/NewLauncherSettings.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/NewLauncherSettings.java @@ -1,12 +1,9 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.client.runtime; -import pro.gravit.launcher.client.UserSettings; -import pro.gravit.launcher.hasher.HashedDir; +import pro.gravit.launcher.client.runtime.client.UserSettings; +import pro.gravit.launcher.core.LauncherNetworkAPI; -import java.nio.file.Path; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; public class NewLauncherSettings { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherProcess.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherProcess.java similarity index 94% rename from Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherProcess.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherProcess.java index a224e176..29b42036 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherProcess.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherProcess.java @@ -1,20 +1,20 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.client.runtime.client; import pro.gravit.launcher.Launcher; import pro.gravit.launcher.LauncherConfig; -import pro.gravit.launcher.LauncherEngine; -import pro.gravit.launcher.client.events.client.ClientProcessBuilderCreateEvent; -import pro.gravit.launcher.client.events.client.ClientProcessBuilderLaunchedEvent; -import pro.gravit.launcher.client.events.client.ClientProcessBuilderParamsWrittedEvent; -import pro.gravit.launcher.client.events.client.ClientProcessBuilderPreLaunchEvent; -import pro.gravit.launcher.hasher.HashedDir; +import pro.gravit.launcher.client.runtime.LauncherEngine; +import pro.gravit.launcher.client.runtime.client.events.client.ClientProcessBuilderCreateEvent; +import pro.gravit.launcher.client.runtime.client.events.client.ClientProcessBuilderLaunchedEvent; +import pro.gravit.launcher.client.runtime.client.events.client.ClientProcessBuilderParamsWrittedEvent; +import pro.gravit.launcher.client.runtime.client.events.client.ClientProcessBuilderPreLaunchEvent; +import pro.gravit.launcher.core.hasher.HashedDir; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.profiles.PlayerProfile; import pro.gravit.launcher.profiles.optional.OptionalView; import pro.gravit.launcher.profiles.optional.actions.OptionalAction; import pro.gravit.launcher.profiles.optional.actions.OptionalActionJvmArgs; import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.serialize.HOutput; +import pro.gravit.launcher.core.serialize.HOutput; import pro.gravit.utils.helper.*; import java.io.File; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/RuntimeGsonManager.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeGsonManager.java similarity index 83% rename from Launcher/src/main/java/pro/gravit/launcher/client/RuntimeGsonManager.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeGsonManager.java index b8789cf4..0ea95006 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/RuntimeGsonManager.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeGsonManager.java @@ -1,7 +1,8 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.client.runtime.client; import com.google.gson.GsonBuilder; -import pro.gravit.launcher.managers.GsonManager; +import pro.gravit.launcher.start.RuntimeModuleManager; +import pro.gravit.launcher.core.managers.GsonManager; import pro.gravit.launcher.modules.events.PreGsonPhase; import pro.gravit.launcher.request.websockets.ClientWebSocketService; import pro.gravit.utils.UniversalJsonAdapter; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/RuntimeLauncherCoreModule.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeLauncherCoreModule.java similarity index 90% rename from Launcher/src/main/java/pro/gravit/launcher/client/RuntimeLauncherCoreModule.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeLauncherCoreModule.java index 76b85182..6b948c01 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/RuntimeLauncherCoreModule.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeLauncherCoreModule.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.client.runtime.client; import pro.gravit.launcher.modules.LauncherInitContext; import pro.gravit.launcher.modules.LauncherModule; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ServerPinger.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ServerPinger.java similarity index 98% rename from Launcher/src/main/java/pro/gravit/launcher/client/ServerPinger.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ServerPinger.java index c798f3d3..f0a83ea1 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ServerPinger.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ServerPinger.java @@ -1,12 +1,12 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.client.runtime.client; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.profiles.ClientProfileVersions; -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.serialize.HOutput; +import pro.gravit.launcher.core.serialize.HInput; +import pro.gravit.launcher.core.serialize.HOutput; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.helper.VerifyHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/UserSettings.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/UserSettings.java similarity index 74% rename from Launcher/src/main/java/pro/gravit/launcher/client/UserSettings.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/UserSettings.java index 1f6fb9b5..6a9b0c9d 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/UserSettings.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/UserSettings.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.client.runtime.client; import pro.gravit.utils.ProviderMap; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/events/ClientEngineInitPhase.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientEngineInitPhase.java similarity index 68% rename from Launcher/src/main/java/pro/gravit/launcher/client/events/ClientEngineInitPhase.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientEngineInitPhase.java index b877971f..1a54cc43 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/events/ClientEngineInitPhase.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientEngineInitPhase.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.events; +package pro.gravit.launcher.client.runtime.client.events; -import pro.gravit.launcher.LauncherEngine; +import pro.gravit.launcher.client.runtime.LauncherEngine; import pro.gravit.launcher.modules.events.InitPhase; public class ClientEngineInitPhase extends InitPhase { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/events/ClientGuiPhase.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientGuiPhase.java similarity index 69% rename from Launcher/src/main/java/pro/gravit/launcher/client/events/ClientGuiPhase.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientGuiPhase.java index 2e70f857..daee9373 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/events/ClientGuiPhase.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientGuiPhase.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.events; +package pro.gravit.launcher.client.runtime.client.events; -import pro.gravit.launcher.gui.RuntimeProvider; +import pro.gravit.launcher.client.runtime.gui.RuntimeProvider; import pro.gravit.launcher.modules.LauncherModule; public class ClientGuiPhase extends LauncherModule.Event { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/events/ClientPreGuiPhase.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientPreGuiPhase.java similarity index 69% rename from Launcher/src/main/java/pro/gravit/launcher/client/events/ClientPreGuiPhase.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientPreGuiPhase.java index ebbad380..e3bce78d 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/events/ClientPreGuiPhase.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientPreGuiPhase.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.events; +package pro.gravit.launcher.client.runtime.client.events; -import pro.gravit.launcher.gui.RuntimeProvider; +import pro.gravit.launcher.client.runtime.gui.RuntimeProvider; import pro.gravit.launcher.modules.LauncherModule; public class ClientPreGuiPhase extends LauncherModule.Event { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/events/ClientUnlockConsoleEvent.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientUnlockConsoleEvent.java similarity index 84% rename from Launcher/src/main/java/pro/gravit/launcher/client/events/ClientUnlockConsoleEvent.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientUnlockConsoleEvent.java index 2bf5ba5b..814b5729 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/events/ClientUnlockConsoleEvent.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientUnlockConsoleEvent.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.events; +package pro.gravit.launcher.client.runtime.client.events; import pro.gravit.launcher.modules.LauncherModule; import pro.gravit.utils.command.CommandHandler; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderCreateEvent.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderCreateEvent.java similarity index 70% rename from Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderCreateEvent.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderCreateEvent.java index 2fe33846..7df12606 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderCreateEvent.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderCreateEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.events.client; +package pro.gravit.launcher.client.runtime.client.events.client; -import pro.gravit.launcher.client.ClientLauncherProcess; +import pro.gravit.launcher.client.runtime.client.ClientLauncherProcess; import pro.gravit.launcher.modules.LauncherModule; public class ClientProcessBuilderCreateEvent extends LauncherModule.Event { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderLaunchedEvent.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderLaunchedEvent.java similarity index 70% rename from Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderLaunchedEvent.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderLaunchedEvent.java index dc5e4ffc..5383f328 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderLaunchedEvent.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderLaunchedEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.events.client; +package pro.gravit.launcher.client.runtime.client.events.client; -import pro.gravit.launcher.client.ClientLauncherProcess; +import pro.gravit.launcher.client.runtime.client.ClientLauncherProcess; import pro.gravit.launcher.modules.LauncherModule; public class ClientProcessBuilderLaunchedEvent extends LauncherModule.Event { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderParamsWrittedEvent.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderParamsWrittedEvent.java similarity index 69% rename from Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderParamsWrittedEvent.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderParamsWrittedEvent.java index bb535568..469d92ad 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderParamsWrittedEvent.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderParamsWrittedEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.events.client; +package pro.gravit.launcher.client.runtime.client.events.client; -import pro.gravit.launcher.client.ClientLauncherProcess; +import pro.gravit.launcher.client.runtime.client.ClientLauncherProcess; import pro.gravit.launcher.modules.LauncherModule; public class ClientProcessBuilderParamsWrittedEvent extends LauncherModule.Event { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderPreLaunchEvent.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderPreLaunchEvent.java similarity index 70% rename from Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderPreLaunchEvent.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderPreLaunchEvent.java index 2b9b1025..188bd42d 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessBuilderPreLaunchEvent.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderPreLaunchEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.events.client; +package pro.gravit.launcher.client.runtime.client.events.client; -import pro.gravit.launcher.client.ClientLauncherProcess; +import pro.gravit.launcher.client.runtime.client.ClientLauncherProcess; import pro.gravit.launcher.modules.LauncherModule; public class ClientProcessBuilderPreLaunchEvent extends LauncherModule.Event { diff --git a/Launcher/src/main/java/pro/gravit/launcher/console/GetPublicKeyCommand.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/GetPublicKeyCommand.java similarity index 86% rename from Launcher/src/main/java/pro/gravit/launcher/console/GetPublicKeyCommand.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/GetPublicKeyCommand.java index e20313fc..7a63a5eb 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/console/GetPublicKeyCommand.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/GetPublicKeyCommand.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.console; +package pro.gravit.launcher.client.runtime.console; -import pro.gravit.launcher.LauncherEngine; +import pro.gravit.launcher.client.runtime.LauncherEngine; import pro.gravit.utils.command.Command; import pro.gravit.utils.helper.LogHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/console/ModulesCommand.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/ModulesCommand.java similarity index 88% rename from Launcher/src/main/java/pro/gravit/launcher/console/ModulesCommand.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/ModulesCommand.java index 94b03799..e4d42437 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/console/ModulesCommand.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/ModulesCommand.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.console; +package pro.gravit.launcher.client.runtime.console; -import pro.gravit.launcher.LauncherEngine; -import pro.gravit.launcher.LauncherTrustManager; -import pro.gravit.launcher.managers.ConsoleManager; +import pro.gravit.launcher.client.runtime.LauncherEngine; +import pro.gravit.launcher.client.runtime.managers.ConsoleManager; +import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.launcher.modules.LauncherModule; import pro.gravit.launcher.modules.LauncherModuleInfo; import pro.gravit.utils.command.Command; diff --git a/Launcher/src/main/java/pro/gravit/launcher/console/SignDataCommand.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/SignDataCommand.java similarity index 88% rename from Launcher/src/main/java/pro/gravit/launcher/console/SignDataCommand.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/SignDataCommand.java index 2757a64a..f74051cb 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/console/SignDataCommand.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/SignDataCommand.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.console; +package pro.gravit.launcher.client.runtime.console; -import pro.gravit.launcher.LauncherEngine; +import pro.gravit.launcher.client.runtime.LauncherEngine; import pro.gravit.utils.command.Command; import pro.gravit.utils.helper.LogHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/console/UnlockCommand.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/UnlockCommand.java similarity index 82% rename from Launcher/src/main/java/pro/gravit/launcher/console/UnlockCommand.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/UnlockCommand.java index 6d678051..4e1677c5 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/console/UnlockCommand.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/UnlockCommand.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.console; +package pro.gravit.launcher.client.runtime.console; -import pro.gravit.launcher.managers.ConsoleManager; -import pro.gravit.launcher.managers.SettingsManager; +import pro.gravit.launcher.client.runtime.managers.ConsoleManager; +import pro.gravit.launcher.client.runtime.managers.SettingsManager; import pro.gravit.utils.command.Command; import pro.gravit.utils.helper.LogHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/console/test/PrintHardwareInfoCommand.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/test/PrintHardwareInfoCommand.java similarity index 95% rename from Launcher/src/main/java/pro/gravit/launcher/console/test/PrintHardwareInfoCommand.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/test/PrintHardwareInfoCommand.java index 93bbe490..3c4a3112 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/console/test/PrintHardwareInfoCommand.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/test/PrintHardwareInfoCommand.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.console.test; +package pro.gravit.launcher.client.runtime.console.test; -import pro.gravit.launcher.utils.HWIDProvider; +import pro.gravit.launcher.client.runtime.utils.HWIDProvider; import pro.gravit.utils.command.Command; import pro.gravit.utils.helper.LogHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/debug/ClientRuntimeProvider.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/ClientRuntimeProvider.java similarity index 96% rename from Launcher/src/main/java/pro/gravit/launcher/debug/ClientRuntimeProvider.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/ClientRuntimeProvider.java index f9a1a682..254bbce9 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/debug/ClientRuntimeProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/ClientRuntimeProvider.java @@ -1,13 +1,13 @@ -package pro.gravit.launcher.debug; +package pro.gravit.launcher.client.runtime.debug; import pro.gravit.launcher.ClientPermissions; import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherEngine; -import pro.gravit.launcher.api.AuthService; -import pro.gravit.launcher.api.ClientService; +import pro.gravit.launcher.client.api.AuthService; +import pro.gravit.launcher.client.api.ClientService; +import pro.gravit.launcher.client.runtime.LauncherEngine; +import pro.gravit.launcher.client.runtime.gui.RuntimeProvider; import pro.gravit.launcher.events.request.AuthRequestEvent; import pro.gravit.launcher.events.request.ProfilesRequestEvent; -import pro.gravit.launcher.gui.RuntimeProvider; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.auth.AuthRequest; diff --git a/Launcher/src/main/java/pro/gravit/launcher/debug/DebugLauncherTrustManager.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugLauncherTrustManager.java similarity index 89% rename from Launcher/src/main/java/pro/gravit/launcher/debug/DebugLauncherTrustManager.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugLauncherTrustManager.java index e49d79d2..3be634d1 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/debug/DebugLauncherTrustManager.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugLauncherTrustManager.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.debug; +package pro.gravit.launcher.client.runtime.debug; -import pro.gravit.launcher.LauncherTrustManager; +import pro.gravit.launcher.core.LauncherTrustManager; import java.security.cert.X509Certificate; diff --git a/Launcher/src/main/java/pro/gravit/launcher/debug/DebugMain.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugMain.java similarity index 92% rename from Launcher/src/main/java/pro/gravit/launcher/debug/DebugMain.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugMain.java index e3529e76..39b33d2f 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/debug/DebugMain.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugMain.java @@ -1,12 +1,12 @@ -package pro.gravit.launcher.debug; +package pro.gravit.launcher.client.runtime.debug; -import pro.gravit.launcher.ClientLauncherMethods; import pro.gravit.launcher.Launcher; import pro.gravit.launcher.LauncherConfig; -import pro.gravit.launcher.LauncherEngine; -import pro.gravit.launcher.client.RuntimeLauncherCoreModule; -import pro.gravit.launcher.client.RuntimeModuleManager; -import pro.gravit.launcher.managers.ConsoleManager; +import pro.gravit.launcher.client.ClientLauncherMethods; +import pro.gravit.launcher.client.runtime.LauncherEngine; +import pro.gravit.launcher.client.runtime.client.RuntimeLauncherCoreModule; +import pro.gravit.launcher.client.runtime.managers.ConsoleManager; +import pro.gravit.launcher.start.RuntimeModuleManager; import pro.gravit.launcher.modules.LauncherModule; import pro.gravit.launcher.modules.events.OfflineModeEvent; import pro.gravit.launcher.modules.events.PreConfigPhase; diff --git a/Launcher/src/main/java/pro/gravit/launcher/gui/NoRuntimeProvider.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/NoRuntimeProvider.java similarity index 89% rename from Launcher/src/main/java/pro/gravit/launcher/gui/NoRuntimeProvider.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/NoRuntimeProvider.java index 14e75afb..46ea445c 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/gui/NoRuntimeProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/NoRuntimeProvider.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.gui; +package pro.gravit.launcher.client.runtime.gui; import javax.swing.*; diff --git a/Launcher/src/main/java/pro/gravit/launcher/gui/RuntimeProvider.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/RuntimeProvider.java similarity index 72% rename from Launcher/src/main/java/pro/gravit/launcher/gui/RuntimeProvider.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/RuntimeProvider.java index bee04f48..08f12cb2 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/gui/RuntimeProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/RuntimeProvider.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.gui; +package pro.gravit.launcher.client.runtime.gui; public interface RuntimeProvider { void run(String[] args); diff --git a/Launcher/src/main/java/pro/gravit/launcher/managers/ConsoleManager.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/ConsoleManager.java similarity index 87% rename from Launcher/src/main/java/pro/gravit/launcher/managers/ConsoleManager.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/ConsoleManager.java index bffca63e..0a13e180 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/managers/ConsoleManager.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/ConsoleManager.java @@ -1,10 +1,10 @@ -package pro.gravit.launcher.managers; +package pro.gravit.launcher.client.runtime.managers; import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherEngine; -import pro.gravit.launcher.client.events.ClientUnlockConsoleEvent; -import pro.gravit.launcher.console.UnlockCommand; -import pro.gravit.launcher.console.test.PrintHardwareInfoCommand; +import pro.gravit.launcher.client.runtime.LauncherEngine; +import pro.gravit.launcher.client.runtime.client.events.ClientUnlockConsoleEvent; +import pro.gravit.launcher.client.runtime.console.UnlockCommand; +import pro.gravit.launcher.client.runtime.console.test.PrintHardwareInfoCommand; import pro.gravit.utils.command.CommandHandler; import pro.gravit.utils.command.JLineCommandHandler; import pro.gravit.utils.command.StdCommandHandler; diff --git a/Launcher/src/main/java/pro/gravit/launcher/managers/SettingsManager.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/SettingsManager.java similarity index 64% rename from Launcher/src/main/java/pro/gravit/launcher/managers/SettingsManager.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/SettingsManager.java index 54185d6f..bff7307b 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/managers/SettingsManager.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/SettingsManager.java @@ -1,21 +1,10 @@ -package pro.gravit.launcher.managers; +package pro.gravit.launcher.client.runtime.managers; -import pro.gravit.launcher.NewLauncherSettings; -import pro.gravit.launcher.client.DirBridge; +import pro.gravit.launcher.client.runtime.NewLauncherSettings; +import pro.gravit.launcher.client.runtime.client.DirBridge; import pro.gravit.launcher.config.JsonConfigurable; -import pro.gravit.launcher.hasher.HashedDir; -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.serialize.HOutput; -import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; -import java.io.IOException; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; - public class SettingsManager extends JsonConfigurable { public static NewLauncherSettings settings; diff --git a/Launcher/src/main/java/pro/gravit/launcher/utils/HWIDProvider.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/HWIDProvider.java similarity index 98% rename from Launcher/src/main/java/pro/gravit/launcher/utils/HWIDProvider.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/HWIDProvider.java index 2cc8dd06..31e7b261 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/utils/HWIDProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/HWIDProvider.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.utils; +package pro.gravit.launcher.client.runtime.utils; import oshi.SystemInfo; import oshi.hardware.*; diff --git a/Launcher/src/main/java/pro/gravit/launcher/utils/LauncherUpdater.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/LauncherUpdater.java similarity index 95% rename from Launcher/src/main/java/pro/gravit/launcher/utils/LauncherUpdater.java rename to Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/LauncherUpdater.java index f2712a0e..f4998402 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/utils/LauncherUpdater.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/LauncherUpdater.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.utils; +package pro.gravit.launcher.client.runtime.utils; -import pro.gravit.launcher.LauncherEngine; -import pro.gravit.launcher.LauncherInject; +import pro.gravit.launcher.client.runtime.LauncherEngine; +import pro.gravit.launcher.core.LauncherInject; import pro.gravit.launcher.request.update.LauncherRequest; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/ClientPermissions.java b/LauncherAPI/src/main/java/pro/gravit/launcher/ClientPermissions.java index e42164cc..6edb6178 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/ClientPermissions.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/ClientPermissions.java @@ -1,5 +1,7 @@ package pro.gravit.launcher; +import pro.gravit.launcher.core.LauncherNetworkAPI; + import java.util.*; public class ClientPermissions { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/Launcher.java b/LauncherAPI/src/main/java/pro/gravit/launcher/Launcher.java index 165f2bfb..261053be 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/Launcher.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/Launcher.java @@ -1,8 +1,8 @@ package pro.gravit.launcher; -import pro.gravit.launcher.managers.GsonManager; +import pro.gravit.launcher.core.managers.GsonManager; import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.serialize.HInput; +import pro.gravit.launcher.core.serialize.HInput; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java b/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java index 10fbcea4..19e26ccd 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java @@ -1,10 +1,13 @@ package pro.gravit.launcher; +import pro.gravit.launcher.core.LauncherInject; +import pro.gravit.launcher.core.LauncherInjectionConstructor; +import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.launcher.modules.LauncherModule; import pro.gravit.launcher.modules.LauncherModulesManager; -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.serialize.HOutput; -import pro.gravit.launcher.serialize.stream.StreamObject; +import pro.gravit.launcher.core.serialize.HInput; +import pro.gravit.launcher.core.serialize.HOutput; +import pro.gravit.launcher.core.serialize.stream.StreamObject; import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.helper.SecurityHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/api/AuthService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/AuthService.java similarity index 94% rename from LauncherAPI/src/main/java/pro/gravit/launcher/api/AuthService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/client/api/AuthService.java index 0020d954..529c3b5b 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/api/AuthService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/AuthService.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.api; +package pro.gravit.launcher.client.api; import pro.gravit.launcher.ClientPermissions; import pro.gravit.launcher.profiles.ClientProfile; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/api/ClientService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ClientService.java similarity index 93% rename from LauncherAPI/src/main/java/pro/gravit/launcher/api/ClientService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ClientService.java index 50c3a8da..f7964574 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/api/ClientService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ClientService.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.api; +package pro.gravit.launcher.client.api; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.JVMHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/api/ConfigService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ConfigService.java similarity index 88% rename from LauncherAPI/src/main/java/pro/gravit/launcher/api/ConfigService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ConfigService.java index 01bafb3d..afa438f7 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/api/ConfigService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ConfigService.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.api; +package pro.gravit.launcher.client.api; public class ConfigService { public static boolean disableLogging; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/api/KeyService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/KeyService.java similarity index 84% rename from LauncherAPI/src/main/java/pro/gravit/launcher/api/KeyService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/client/api/KeyService.java index 5976d4f8..4b3eac7e 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/api/KeyService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/KeyService.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.api; +package pro.gravit.launcher.client.api; import java.security.interfaces.ECPublicKey; import java.security.interfaces.RSAPublicKey; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/managers/ConfigManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/ConfigManager.java similarity index 96% rename from LauncherAPI/src/main/java/pro/gravit/launcher/managers/ConfigManager.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/ConfigManager.java index cda96970..a1843aaf 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/managers/ConfigManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/ConfigManager.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.managers; +package pro.gravit.launcher.client.runtime.managers; import pro.gravit.launcher.config.JsonConfigurable; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/managers/SimpleModulesConfigManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/SimpleModulesConfigManager.java similarity index 95% rename from LauncherAPI/src/main/java/pro/gravit/launcher/managers/SimpleModulesConfigManager.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/SimpleModulesConfigManager.java index 4e954886..3a57e209 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/managers/SimpleModulesConfigManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/SimpleModulesConfigManager.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.managers; +package pro.gravit.launcher.client.runtime.managers; import pro.gravit.launcher.config.SimpleConfigurable; import pro.gravit.launcher.modules.ModulesConfigManager; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/NotificationEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/NotificationEvent.java index a5fef64b..3b492876 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/NotificationEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/NotificationEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.request.WebSocketEvent; public class NotificationEvent implements WebSocketEvent { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/RequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/RequestEvent.java index 60323f61..627ec74b 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/RequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/RequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.request.WebSocketEvent; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AuthRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AuthRequestEvent.java index 3881ebe7..0a614634 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AuthRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AuthRequestEvent.java @@ -1,7 +1,7 @@ package pro.gravit.launcher.events.request; import pro.gravit.launcher.ClientPermissions; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; import pro.gravit.launcher.profiles.PlayerProfile; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java index c6d57f94..1bf0aad0 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; import pro.gravit.launcher.profiles.PlayerProfile; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/CheckServerRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/CheckServerRequestEvent.java index 47a78f93..c66ee020 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/CheckServerRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/CheckServerRequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; import pro.gravit.launcher.profiles.PlayerProfile; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ErrorRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ErrorRequestEvent.java index e8c3b822..9bb510d8 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ErrorRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ErrorRequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java index c0768207..629c82a4 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; import pro.gravit.utils.TypeSerializeInterface; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/JoinServerRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/JoinServerRequestEvent.java index dc13f759..519c2c8d 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/JoinServerRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/JoinServerRequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/LauncherRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/LauncherRequestEvent.java index 17d94488..9802973b 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/LauncherRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/LauncherRequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.ExtendedTokenRequestEvent; import pro.gravit.launcher.events.RequestEvent; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java index b2bad307..33c9aa43 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; import pro.gravit.launcher.profiles.PlayerProfile; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java index 6c3c532c..6675cdc7 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; import pro.gravit.launcher.profiles.PlayerProfile; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfilesRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfilesRequestEvent.java index 383becab..626f282e 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfilesRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfilesRequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; import pro.gravit.launcher.profiles.ClientProfile; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/SetProfileRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/SetProfileRequestEvent.java index 6596ac9a..7dd5cbe1 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/SetProfileRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/SetProfileRequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; import pro.gravit.launcher.profiles.ClientProfile; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateListRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateListRequestEvent.java index 5f54432c..7cfbc2ba 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateListRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateListRequestEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; import java.util.HashSet; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateRequestEvent.java index e5f357f8..8c98b284 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateRequestEvent.java @@ -1,8 +1,8 @@ package pro.gravit.launcher.events.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.hasher.HashedDir; +import pro.gravit.launcher.core.hasher.HashedDir; public class UpdateRequestEvent extends RequestEvent { @LauncherNetworkAPI diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModule.java b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModule.java index 65ed59a4..26eee8be 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModule.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModule.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.modules; -import pro.gravit.launcher.LauncherTrustManager; +import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.utils.Version; import java.util.ArrayList; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java index 773e2f72..f754e6c8 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java @@ -1,7 +1,7 @@ package pro.gravit.launcher.modules.impl; -import pro.gravit.launcher.LauncherTrustManager; -import pro.gravit.launcher.managers.SimpleModulesConfigManager; +import pro.gravit.launcher.core.LauncherTrustManager; +import pro.gravit.launcher.client.runtime.managers.SimpleModulesConfigManager; import pro.gravit.launcher.modules.*; import pro.gravit.utils.PublicURLClassLoader; import pro.gravit.utils.Version; 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 70d9dd2a..dd789dbc 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java @@ -1,8 +1,8 @@ package pro.gravit.launcher.profiles; import com.google.gson.*; -import pro.gravit.launcher.LauncherNetworkAPI; -import pro.gravit.launcher.hasher.FileNameMatcher; +import pro.gravit.launcher.core.LauncherNetworkAPI; +import pro.gravit.launcher.core.hasher.FileNameMatcher; import pro.gravit.launcher.profiles.optional.OptionalDepend; import pro.gravit.launcher.profiles.optional.OptionalFile; import pro.gravit.launcher.profiles.optional.triggers.OptionalTrigger; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/Texture.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/Texture.java index f4a070d9..1e4a637e 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/Texture.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/Texture.java @@ -1,7 +1,7 @@ package pro.gravit.launcher.profiles; -import pro.gravit.launcher.serialize.HOutput; -import pro.gravit.launcher.serialize.stream.StreamObject; +import pro.gravit.launcher.core.serialize.HOutput; +import pro.gravit.launcher.core.serialize.stream.StreamObject; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.SecurityHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalDepend.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalDepend.java index c5acde22..55c7c0a5 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalDepend.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalDepend.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.profiles.optional; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; public class OptionalDepend { @LauncherNetworkAPI diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java index 36b57c83..1884e443 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.profiles.optional; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.profiles.optional.actions.OptionalAction; import java.util.List; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionFile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionFile.java index e2999b22..9f831635 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionFile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionFile.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.profiles.optional.actions; -import pro.gravit.launcher.hasher.HashedDir; +import pro.gravit.launcher.core.hasher.HashedDir; import pro.gravit.utils.helper.LogHelper; import java.util.Map; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java index 47de5f3a..991a638d 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.request.AuthRequestEvent; import pro.gravit.launcher.events.request.CurrentUserRequestEvent; import pro.gravit.launcher.events.request.RefreshTokenRequestEvent; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java index 679ae5bb..da3081c2 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request.auth; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.request.AuthRequestEvent; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.auth.password.*; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/CheckServerRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/CheckServerRequest.java index 9e3ff5f6..998fb903 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/CheckServerRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/CheckServerRequest.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request.auth; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.request.CheckServerRequestEvent; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.websockets.WebSocketRequest; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/JoinServerRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/JoinServerRequest.java index 54c8df02..685c171d 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/JoinServerRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/JoinServerRequest.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request.auth; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.request.JoinServerRequestEvent; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.websockets.WebSocketRequest; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/SetProfileRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/SetProfileRequest.java index 3c72b502..9948243c 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/SetProfileRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/SetProfileRequest.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request.auth; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.request.SetProfileRequestEvent; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.request.Request; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthAESPassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthAESPassword.java index 974afbec..545cd5a3 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthAESPassword.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthAESPassword.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request.auth.password; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.request.auth.AuthRequest; public class AuthAESPassword implements AuthRequest.AuthPasswordInterface { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthPlainPassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthPlainPassword.java index 9e83e6a2..1f0714b1 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthPlainPassword.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthPlainPassword.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request.auth.password; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.request.auth.AuthRequest; public class AuthPlainPassword implements AuthRequest.AuthPasswordInterface { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/LauncherRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/LauncherRequest.java index b2345410..4e8d0be7 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/LauncherRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/LauncherRequest.java @@ -1,7 +1,7 @@ package pro.gravit.launcher.request.update; import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.request.LauncherRequestEvent; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.RequestService; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/UpdateRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/UpdateRequest.java index 9f82311b..b851b55c 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/UpdateRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/UpdateRequest.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request.update; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.request.UpdateRequestEvent; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.websockets.WebSocketRequest; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java index a3f1ab2e..8f4f3c4f 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request.uuid; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.request.BatchProfileByUsernameRequestEvent; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.websockets.WebSocketRequest; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUUIDRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUUIDRequest.java index 4531f85c..ea95fa98 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUUIDRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUUIDRequest.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request.uuid; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.request.ProfileByUUIDRequestEvent; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.websockets.WebSocketRequest; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUsernameRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUsernameRequest.java index d164b28e..784f710f 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUsernameRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUsernameRequest.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.request.uuid; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.events.request.ProfileByUsernameRequestEvent; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.websockets.WebSocketRequest; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java index 255c3267..0afe1267 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java @@ -14,8 +14,8 @@ import io.netty.handler.codec.http.websocketx.WebSocketVersion; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; -import pro.gravit.launcher.CertificatePinningTrustManager; -import pro.gravit.launcher.LauncherInject; +import pro.gravit.launcher.core.CertificatePinningTrustManager; +import pro.gravit.launcher.core.LauncherInject; import pro.gravit.utils.helper.LogHelper; import javax.net.ssl.SSLException; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java index c7c269fa..5d18b124 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java @@ -5,8 +5,8 @@ import pro.gravit.launcher.Launcher; import pro.gravit.launcher.events.NotificationEvent; import pro.gravit.launcher.events.request.*; -import pro.gravit.launcher.hasher.HashedEntry; -import pro.gravit.launcher.hasher.HashedEntryAdapter; +import pro.gravit.launcher.core.hasher.HashedEntry; +import pro.gravit.launcher.core.hasher.HashedEntryAdapter; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.profiles.optional.actions.OptionalAction; import pro.gravit.launcher.profiles.optional.triggers.OptionalTrigger; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/BasicLauncherEventHandler.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/BasicLauncherEventHandler.java similarity index 94% rename from LauncherClient/src/main/java/pro/gravit/launcher/BasicLauncherEventHandler.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/BasicLauncherEventHandler.java index 3e5e5cd2..aea92c9d 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/BasicLauncherEventHandler.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/BasicLauncherEventHandler.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.client; -import pro.gravit.launcher.api.DialogService; +import pro.gravit.launcher.client.api.DialogService; import pro.gravit.launcher.events.ExtendedTokenRequestEvent; import pro.gravit.launcher.events.NotificationEvent; import pro.gravit.launcher.events.request.SecurityReportRequestEvent; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/ClientLauncherMethods.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherMethods.java similarity index 92% rename from LauncherClient/src/main/java/pro/gravit/launcher/ClientLauncherMethods.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherMethods.java index 3715b1e5..2774a122 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/ClientLauncherMethods.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherMethods.java @@ -1,10 +1,12 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.client; -import pro.gravit.launcher.client.ClientGsonManager; -import pro.gravit.launcher.client.ClientLauncherEntryPoint; -import pro.gravit.launcher.client.ClientModuleManager; -import pro.gravit.launcher.client.ClientParams; -import pro.gravit.launcher.client.events.ClientExitPhase; +import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.core.LauncherTrustManager; +import pro.gravit.launcher.client.runtime.client.ClientGsonManager; +import pro.gravit.launcher.client.runtime.client.ClientLauncherEntryPoint; +import pro.gravit.launcher.client.runtime.client.ClientModuleManager; +import pro.gravit.launcher.client.runtime.client.ClientParams; +import pro.gravit.launcher.client.runtime.client.events.ClientExitPhase; import pro.gravit.launcher.events.request.*; import pro.gravit.launcher.modules.LauncherModulesManager; import pro.gravit.launcher.modules.events.OfflineModeEvent; @@ -21,7 +23,7 @@ import pro.gravit.launcher.request.uuid.ProfileByUUIDRequest; import pro.gravit.launcher.request.uuid.ProfileByUsernameRequest; import pro.gravit.launcher.request.websockets.OfflineRequestService; -import pro.gravit.launcher.utils.NativeJVMHalt; +import pro.gravit.launcher.client.runtime.utils.NativeJVMHalt; import pro.gravit.utils.helper.JVMHelper; import java.security.cert.X509Certificate; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/LauncherAgent.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/LauncherAgent.java similarity index 94% rename from LauncherClient/src/main/java/pro/gravit/launcher/LauncherAgent.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/LauncherAgent.java index 63d96485..27924bba 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/LauncherAgent.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/LauncherAgent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.client; -import pro.gravit.launcher.utils.NativeJVMHalt; +import pro.gravit.launcher.client.runtime.utils.NativeJVMHalt; import pro.gravit.utils.helper.LogHelper; import java.io.File; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/api/CertificateService.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/CertificateService.java similarity index 94% rename from LauncherClient/src/main/java/pro/gravit/launcher/api/CertificateService.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/api/CertificateService.java index b21cb0b5..1bfbe960 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/api/CertificateService.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/CertificateService.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.api; +package pro.gravit.launcher.client.api; -import pro.gravit.launcher.ClientLauncherMethods; -import pro.gravit.launcher.LauncherTrustManager; -import pro.gravit.launcher.utils.ApiBridgeService; +import pro.gravit.launcher.client.ClientLauncherMethods; +import pro.gravit.launcher.core.LauncherTrustManager; +import pro.gravit.launcher.client.runtime.utils.ApiBridgeService; import java.security.cert.X509Certificate; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/api/DialogService.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/DialogService.java similarity index 98% rename from LauncherClient/src/main/java/pro/gravit/launcher/api/DialogService.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/api/DialogService.java index 7180c757..0132ef3d 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/api/DialogService.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/DialogService.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.api; +package pro.gravit.launcher.client.api; import pro.gravit.launcher.events.NotificationEvent; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/api/SystemService.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/SystemService.java similarity index 69% rename from LauncherClient/src/main/java/pro/gravit/launcher/api/SystemService.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/api/SystemService.java index 9d8aed49..4b7f2674 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/api/SystemService.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/SystemService.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.api; +package pro.gravit.launcher.client.api; -import pro.gravit.launcher.ClientLauncherMethods; +import pro.gravit.launcher.client.ClientLauncherMethods; public class SystemService { private SystemService() { diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientGsonManager.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientGsonManager.java similarity index 85% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/ClientGsonManager.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientGsonManager.java index bcd99ccc..9a503091 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientGsonManager.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientGsonManager.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.client.runtime.client; import com.google.gson.GsonBuilder; -import pro.gravit.launcher.managers.GsonManager; +import pro.gravit.launcher.core.managers.GsonManager; import pro.gravit.launcher.modules.events.PreGsonPhase; import pro.gravit.launcher.request.websockets.ClientWebSocketService; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherCoreModule.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherCoreModule.java similarity index 90% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherCoreModule.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherCoreModule.java index 21e3c8af..5dd32863 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherCoreModule.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherCoreModule.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.client.runtime.client; import pro.gravit.launcher.modules.LauncherInitContext; import pro.gravit.launcher.modules.LauncherModule; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherEntryPoint.java similarity index 95% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherEntryPoint.java index 15436bd5..e73b31cb 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherEntryPoint.java @@ -1,13 +1,16 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.client.runtime.client; import pro.gravit.launcher.*; -import pro.gravit.launcher.api.AuthService; -import pro.gravit.launcher.api.ClientService; -import pro.gravit.launcher.api.KeyService; -import pro.gravit.launcher.client.events.client.*; -import pro.gravit.launcher.hasher.FileNameMatcher; -import pro.gravit.launcher.hasher.HashedDir; -import pro.gravit.launcher.hasher.HashedEntry; +import pro.gravit.launcher.client.BasicLauncherEventHandler; +import pro.gravit.launcher.client.ClientLauncherMethods; +import pro.gravit.launcher.client.LauncherAgent; +import pro.gravit.launcher.client.api.AuthService; +import pro.gravit.launcher.client.api.ClientService; +import pro.gravit.launcher.client.api.KeyService; +import pro.gravit.launcher.client.runtime.client.events.client.*; +import pro.gravit.launcher.core.hasher.FileNameMatcher; +import pro.gravit.launcher.core.hasher.HashedDir; +import pro.gravit.launcher.core.hasher.HashedEntry; import pro.gravit.launcher.modules.events.PreConfigPhase; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.profiles.ClientProfileVersions; @@ -18,8 +21,8 @@ import pro.gravit.launcher.request.RequestException; import pro.gravit.launcher.request.RequestService; import pro.gravit.launcher.request.websockets.StdWebSocketService; -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.utils.DirWatcher; +import pro.gravit.launcher.core.serialize.HInput; +import pro.gravit.launcher.client.runtime.utils.DirWatcher; import pro.gravit.utils.helper.*; import pro.gravit.utils.launch.*; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientModuleManager.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientModuleManager.java similarity index 90% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/ClientModuleManager.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientModuleManager.java index 648685e7..046cbc33 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientModuleManager.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientModuleManager.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.client.runtime.client; import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherTrustManager; +import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.launcher.modules.LauncherModule; import pro.gravit.launcher.modules.impl.SimpleModuleManager; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientParams.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientParams.java similarity index 97% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/ClientParams.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientParams.java index da72aba6..e8047887 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientParams.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientParams.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.client.runtime.client; import pro.gravit.launcher.Launcher; import pro.gravit.launcher.events.request.AuthRequestEvent; -import pro.gravit.launcher.hasher.HashedDir; +import pro.gravit.launcher.core.hasher.HashedDir; import pro.gravit.launcher.profiles.ClientProfile; import pro.gravit.launcher.profiles.ClientProfileVersions; import pro.gravit.launcher.profiles.PlayerProfile; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/DirBridge.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/DirBridge.java similarity index 98% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/DirBridge.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/DirBridge.java index 397c056d..3167bfef 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/DirBridge.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/DirBridge.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.client.runtime.client; import pro.gravit.launcher.Launcher; import pro.gravit.utils.helper.IOHelper; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientExitPhase.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientExitPhase.java similarity index 78% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientExitPhase.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientExitPhase.java index 230ea6d8..199bf0e4 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientExitPhase.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientExitPhase.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.events; +package pro.gravit.launcher.client.runtime.client.events; import pro.gravit.launcher.modules.events.ClosePhase; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessClassLoaderEvent.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessClassLoaderEvent.java similarity index 90% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessClassLoaderEvent.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessClassLoaderEvent.java index e42c17a9..7d193807 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessClassLoaderEvent.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessClassLoaderEvent.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.events.client; +package pro.gravit.launcher.client.runtime.client.events.client; import pro.gravit.launcher.modules.LauncherModule; import pro.gravit.launcher.profiles.ClientProfile; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessInitPhase.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessInitPhase.java similarity index 65% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessInitPhase.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessInitPhase.java index 613d696f..a7f27384 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessInitPhase.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessInitPhase.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.events.client; +package pro.gravit.launcher.client.runtime.client.events.client; -import pro.gravit.launcher.client.ClientParams; +import pro.gravit.launcher.client.runtime.client.ClientParams; import pro.gravit.launcher.modules.events.InitPhase; public class ClientProcessInitPhase extends InitPhase { diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessLaunchEvent.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessLaunchEvent.java similarity index 66% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessLaunchEvent.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessLaunchEvent.java index c43a9c5c..5954e801 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessLaunchEvent.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessLaunchEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.events.client; +package pro.gravit.launcher.client.runtime.client.events.client; -import pro.gravit.launcher.client.ClientParams; +import pro.gravit.launcher.client.runtime.client.ClientParams; import pro.gravit.launcher.modules.LauncherModule; public class ClientProcessLaunchEvent extends LauncherModule.Event { diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessPreInvokeMainClassEvent.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessPreInvokeMainClassEvent.java similarity index 81% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessPreInvokeMainClassEvent.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessPreInvokeMainClassEvent.java index 731f2c84..c84e7904 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessPreInvokeMainClassEvent.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessPreInvokeMainClassEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.events.client; +package pro.gravit.launcher.client.runtime.client.events.client; -import pro.gravit.launcher.client.ClientParams; +import pro.gravit.launcher.client.runtime.client.ClientParams; import pro.gravit.launcher.modules.LauncherModule; import pro.gravit.launcher.profiles.ClientProfile; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessReadyEvent.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessReadyEvent.java similarity index 66% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessReadyEvent.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessReadyEvent.java index 574814a6..87399ece 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/events/client/ClientProcessReadyEvent.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessReadyEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.events.client; +package pro.gravit.launcher.client.runtime.client.events.client; -import pro.gravit.launcher.client.ClientParams; +import pro.gravit.launcher.client.runtime.client.ClientParams; import pro.gravit.launcher.modules.events.PostInitPhase; public class ClientProcessReadyEvent extends PostInitPhase { diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/utils/ApiBridgeService.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/ApiBridgeService.java similarity index 86% rename from LauncherClient/src/main/java/pro/gravit/launcher/utils/ApiBridgeService.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/ApiBridgeService.java index 8e0dcab9..ce675a57 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/utils/ApiBridgeService.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/ApiBridgeService.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.utils; +package pro.gravit.launcher.client.runtime.utils; import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherTrustManager; +import pro.gravit.launcher.core.LauncherTrustManager; import java.security.cert.X509Certificate; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/utils/DirWatcher.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/DirWatcher.java similarity index 93% rename from LauncherClient/src/main/java/pro/gravit/launcher/utils/DirWatcher.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/DirWatcher.java index 1ee0949b..a3ab7053 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/utils/DirWatcher.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/DirWatcher.java @@ -1,10 +1,10 @@ -package pro.gravit.launcher.utils; +package pro.gravit.launcher.client.runtime.utils; -import pro.gravit.launcher.ClientLauncherMethods; -import pro.gravit.launcher.hasher.FileNameMatcher; -import pro.gravit.launcher.hasher.HashedDir; -import pro.gravit.launcher.hasher.HashedEntry; -import pro.gravit.launcher.hasher.HashedFile; +import pro.gravit.launcher.client.ClientLauncherMethods; +import pro.gravit.launcher.core.hasher.FileNameMatcher; +import pro.gravit.launcher.core.hasher.HashedDir; +import pro.gravit.launcher.core.hasher.HashedEntry; +import pro.gravit.launcher.core.hasher.HashedFile; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.JVMHelper.OS; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/utils/NativeJVMHalt.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/NativeJVMHalt.java similarity index 94% rename from LauncherClient/src/main/java/pro/gravit/launcher/utils/NativeJVMHalt.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/NativeJVMHalt.java index 34eea24c..c442c264 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/utils/NativeJVMHalt.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/NativeJVMHalt.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.utils; +package pro.gravit.launcher.client.runtime.utils; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/CertificatePinningTrustManager.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/CertificatePinningTrustManager.java similarity index 98% rename from LauncherCore/src/main/java/pro/gravit/launcher/CertificatePinningTrustManager.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/CertificatePinningTrustManager.java index e60311eb..854c9422 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/CertificatePinningTrustManager.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/CertificatePinningTrustManager.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.core; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/LauncherInject.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherInject.java similarity index 89% rename from LauncherCore/src/main/java/pro/gravit/launcher/LauncherInject.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherInject.java index b76203ad..8d9d43ff 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/LauncherInject.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherInject.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.core; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/LauncherInjectionConstructor.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherInjectionConstructor.java similarity index 89% rename from LauncherCore/src/main/java/pro/gravit/launcher/LauncherInjectionConstructor.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherInjectionConstructor.java index 9c2359df..27dc6dfe 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/LauncherInjectionConstructor.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherInjectionConstructor.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.core; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/LauncherNetworkAPI.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherNetworkAPI.java similarity index 94% rename from LauncherCore/src/main/java/pro/gravit/launcher/LauncherNetworkAPI.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherNetworkAPI.java index 9c2fad06..b767adbd 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/LauncherNetworkAPI.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherNetworkAPI.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.core; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/LauncherTrustManager.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherTrustManager.java similarity index 99% rename from LauncherCore/src/main/java/pro/gravit/launcher/LauncherTrustManager.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherTrustManager.java index 52a4f894..b5d0a268 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/LauncherTrustManager.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/LauncherTrustManager.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.core; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/FileNameMatcher.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/FileNameMatcher.java similarity index 97% rename from LauncherCore/src/main/java/pro/gravit/launcher/hasher/FileNameMatcher.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/FileNameMatcher.java index de19d4a9..c1698d0e 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/FileNameMatcher.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/FileNameMatcher.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.hasher; +package pro.gravit.launcher.core.hasher; import java.util.Collection; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedDir.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedDir.java similarity index 98% rename from LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedDir.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedDir.java index 71b28e17..14ed4211 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedDir.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedDir.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.hasher; +package pro.gravit.launcher.core.hasher; -import pro.gravit.launcher.LauncherNetworkAPI; -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.serialize.HOutput; -import pro.gravit.launcher.serialize.stream.EnumSerializer; +import pro.gravit.launcher.core.LauncherNetworkAPI; +import pro.gravit.launcher.core.serialize.HInput; +import pro.gravit.launcher.core.serialize.HOutput; +import pro.gravit.launcher.core.serialize.stream.EnumSerializer; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.VerifyHelper; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedEntry.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedEntry.java similarity index 72% rename from LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedEntry.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedEntry.java index d8e491c9..af21ce9f 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedEntry.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedEntry.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.hasher; +package pro.gravit.launcher.core.hasher; -import pro.gravit.launcher.LauncherNetworkAPI; -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.serialize.stream.EnumSerializer; -import pro.gravit.launcher.serialize.stream.StreamObject; +import pro.gravit.launcher.core.LauncherNetworkAPI; +import pro.gravit.launcher.core.serialize.HInput; +import pro.gravit.launcher.core.serialize.stream.EnumSerializer; +import pro.gravit.launcher.core.serialize.stream.StreamObject; import java.io.IOException; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedEntryAdapter.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedEntryAdapter.java similarity index 96% rename from LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedEntryAdapter.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedEntryAdapter.java index bc70cd91..1c555492 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedEntryAdapter.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedEntryAdapter.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.hasher; +package pro.gravit.launcher.core.hasher; import com.google.gson.*; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedFile.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedFile.java similarity index 92% rename from LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedFile.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedFile.java index cc36bf50..f4712fa1 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedFile.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedFile.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.hasher; +package pro.gravit.launcher.core.hasher; -import pro.gravit.launcher.LauncherNetworkAPI; -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.serialize.HOutput; +import pro.gravit.launcher.core.LauncherNetworkAPI; +import pro.gravit.launcher.core.serialize.HInput; +import pro.gravit.launcher.core.serialize.HOutput; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.SecurityHelper; import pro.gravit.utils.helper.SecurityHelper.DigestAlgorithm; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/managers/GsonManager.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/managers/GsonManager.java similarity index 86% rename from LauncherCore/src/main/java/pro/gravit/launcher/managers/GsonManager.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/managers/GsonManager.java index 5b06d10b..76466a63 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/managers/GsonManager.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/managers/GsonManager.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.managers; +package pro.gravit.launcher.core.managers; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import pro.gravit.launcher.hasher.HashedEntry; -import pro.gravit.launcher.hasher.HashedEntryAdapter; +import pro.gravit.launcher.core.hasher.HashedEntry; +import pro.gravit.launcher.core.hasher.HashedEntryAdapter; import pro.gravit.utils.helper.CommonHelper; public class GsonManager { diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/HInput.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/HInput.java similarity index 98% rename from LauncherCore/src/main/java/pro/gravit/launcher/serialize/HInput.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/HInput.java index 8e456425..9ee4e103 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/HInput.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/HInput.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.serialize; +package pro.gravit.launcher.core.serialize; import pro.gravit.utils.helper.IOHelper; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/HOutput.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/HOutput.java similarity index 98% rename from LauncherCore/src/main/java/pro/gravit/launcher/serialize/HOutput.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/HOutput.java index 37ee3dc7..aa9f136e 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/HOutput.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/HOutput.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.serialize; +package pro.gravit.launcher.core.serialize; import pro.gravit.utils.helper.IOHelper; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/signed/DigestBytesHolder.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/signed/DigestBytesHolder.java similarity index 86% rename from LauncherCore/src/main/java/pro/gravit/launcher/serialize/signed/DigestBytesHolder.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/signed/DigestBytesHolder.java index 34ae728f..b311ae29 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/signed/DigestBytesHolder.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/signed/DigestBytesHolder.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.serialize.signed; +package pro.gravit.launcher.core.serialize.signed; -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.serialize.HOutput; -import pro.gravit.launcher.serialize.stream.StreamObject; +import pro.gravit.launcher.core.serialize.HInput; +import pro.gravit.launcher.core.serialize.HOutput; +import pro.gravit.launcher.core.serialize.stream.StreamObject; import pro.gravit.utils.helper.SecurityHelper; import java.io.IOException; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/stream/EnumSerializer.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/stream/EnumSerializer.java similarity index 79% rename from LauncherCore/src/main/java/pro/gravit/launcher/serialize/stream/EnumSerializer.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/stream/EnumSerializer.java index e0bdf871..7c5a113d 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/stream/EnumSerializer.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/stream/EnumSerializer.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.serialize.stream; +package pro.gravit.launcher.core.serialize.stream; -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.serialize.HOutput; -import pro.gravit.launcher.serialize.stream.EnumSerializer.Itf; +import pro.gravit.launcher.core.serialize.HInput; +import pro.gravit.launcher.core.serialize.HOutput; +import pro.gravit.launcher.core.serialize.stream.EnumSerializer.Itf; import pro.gravit.utils.helper.VerifyHelper; import java.io.IOException; diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/stream/StreamObject.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/stream/StreamObject.java similarity index 81% rename from LauncherCore/src/main/java/pro/gravit/launcher/serialize/stream/StreamObject.java rename to LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/stream/StreamObject.java index c66c0741..d30bb14d 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/stream/StreamObject.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/stream/StreamObject.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.serialize.stream; +package pro.gravit.launcher.core.serialize.stream; -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.serialize.HOutput; +import pro.gravit.launcher.core.serialize.HInput; +import pro.gravit.launcher.core.serialize.HOutput; import pro.gravit.utils.helper.IOHelper; import java.io.ByteArrayOutputStream; 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 d63fa7f6..36d6b00b 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/LogHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/LogHelper.java @@ -1,6 +1,6 @@ package pro.gravit.utils.helper; -import pro.gravit.launcher.LauncherNetworkAPI; +import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.utils.logging.LogHelperAppender; import pro.gravit.utils.logging.SimpleLogHelperImpl; import pro.gravit.utils.logging.Slf4jLogHelperImpl; diff --git a/LauncherModernCore/src/main/java/pro/gravit/launcher/modern/Downloader.java b/LauncherModernCore/src/main/java/pro/gravit/launcher/modern/Downloader.java index 6cecfc9e..9ab8fae7 100644 --- a/LauncherModernCore/src/main/java/pro/gravit/launcher/modern/Downloader.java +++ b/LauncherModernCore/src/main/java/pro/gravit/launcher/modern/Downloader.java @@ -1,7 +1,7 @@ package pro.gravit.launcher.modern; -import pro.gravit.launcher.CertificatePinningTrustManager; -import pro.gravit.launcher.LauncherInject; +import pro.gravit.launcher.core.CertificatePinningTrustManager; +import pro.gravit.launcher.core.LauncherInject; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherStart/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java b/LauncherStart/src/main/java/pro/gravit/launcher/start/ClientLauncherWrapper.java similarity index 96% rename from LauncherStart/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java rename to LauncherStart/src/main/java/pro/gravit/launcher/start/ClientLauncherWrapper.java index 30e4301b..a068b3db 100644 --- a/LauncherStart/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java +++ b/LauncherStart/src/main/java/pro/gravit/launcher/start/ClientLauncherWrapper.java @@ -1,8 +1,10 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.start; -import pro.gravit.launcher.client.RuntimeModuleManager; -import pro.gravit.launcher.client.DirBridge; -import pro.gravit.launcher.utils.DirWatcher; +import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.LauncherConfig; +import pro.gravit.launcher.client.runtime.client.DirBridge; +import pro.gravit.launcher.client.runtime.utils.DirWatcher; +import pro.gravit.launcher.core.LauncherInject; import pro.gravit.utils.Version; import pro.gravit.utils.helper.*; diff --git a/LauncherStart/src/main/java/pro/gravit/launcher/ClientWrapperModule.java b/LauncherStart/src/main/java/pro/gravit/launcher/start/ClientWrapperModule.java similarity index 60% rename from LauncherStart/src/main/java/pro/gravit/launcher/ClientWrapperModule.java rename to LauncherStart/src/main/java/pro/gravit/launcher/start/ClientWrapperModule.java index 6c4feafb..af380726 100644 --- a/LauncherStart/src/main/java/pro/gravit/launcher/ClientWrapperModule.java +++ b/LauncherStart/src/main/java/pro/gravit/launcher/start/ClientWrapperModule.java @@ -1,6 +1,4 @@ -package pro.gravit.launcher; - -import pro.gravit.launcher.ClientLauncherWrapper; +package pro.gravit.launcher.start; public interface ClientWrapperModule { void wrapperPhase(ClientLauncherWrapper.ClientLauncherWrapperContext context); diff --git a/LauncherStart/src/main/java/pro/gravit/launcher/client/RuntimeModuleManager.java b/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java similarity index 88% rename from LauncherStart/src/main/java/pro/gravit/launcher/client/RuntimeModuleManager.java rename to LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java index c3f92075..597d086b 100644 --- a/LauncherStart/src/main/java/pro/gravit/launcher/client/RuntimeModuleManager.java +++ b/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java @@ -1,9 +1,7 @@ -package pro.gravit.launcher.client; +package pro.gravit.launcher.start; -import pro.gravit.launcher.ClientLauncherWrapper; -import pro.gravit.launcher.ClientWrapperModule; import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherTrustManager; +import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.launcher.modules.LauncherModule; import pro.gravit.launcher.modules.impl.SimpleModuleManager; 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 4b82b2a3..734fc1fa 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java @@ -1,17 +1,15 @@ package pro.gravit.launcher.server; -import pro.gravit.launcher.ClientPermissions; import pro.gravit.launcher.Launcher; import pro.gravit.launcher.LauncherConfig; -import pro.gravit.launcher.api.AuthService; -import pro.gravit.launcher.api.ClientService; -import pro.gravit.launcher.api.ConfigService; -import pro.gravit.launcher.api.KeyService; +import pro.gravit.launcher.client.api.AuthService; +import pro.gravit.launcher.client.api.ClientService; +import pro.gravit.launcher.client.api.ConfigService; +import pro.gravit.launcher.client.api.KeyService; import pro.gravit.launcher.config.JsonConfigurable; import pro.gravit.launcher.events.request.AuthRequestEvent; import pro.gravit.launcher.events.request.ProfilesRequestEvent; import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.PlayerProfile; import pro.gravit.launcher.profiles.optional.actions.OptionalAction; import pro.gravit.launcher.profiles.optional.triggers.OptionalTrigger; import pro.gravit.launcher.request.Request; @@ -21,7 +19,6 @@ import pro.gravit.launcher.request.websockets.StdWebSocketService; import pro.gravit.launcher.server.authlib.InstallAuthlib; import pro.gravit.launcher.server.setup.ServerWrapperSetup; -import pro.gravit.utils.PublicURLClassLoader; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.helper.SecurityHelper; diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapperGsonManager.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapperGsonManager.java index bb19fc5f..3c20fe6b 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapperGsonManager.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapperGsonManager.java @@ -1,7 +1,7 @@ package pro.gravit.launcher.server; import com.google.gson.GsonBuilder; -import pro.gravit.launcher.managers.GsonManager; +import pro.gravit.launcher.core.managers.GsonManager; import pro.gravit.launcher.request.websockets.ClientWebSocketService; public class ServerWrapperGsonManager extends GsonManager { diff --git a/modules b/modules index 7581b6c0..7f4eb168 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 7581b6c01470a5ec32ac67170635d10f6f589b0a +Subproject commit 7f4eb1684725565d161beeeda093f5964ab550ca From dfbb6e507ae348fa183a9e5d30c1bab121382628 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sat, 23 Dec 2023 12:18:10 +0700 Subject: [PATCH 04/23] [REFACTOR] Using Java 17 --- LauncherAPI/build.gradle | 23 +- LauncherClient/build.gradle | 4 +- LauncherCore/build.gradle | 22 +- .../pro/gravit/utils/helper/JVMHelper.java | 29 +- .../pro/gravit/utils/launch/ModuleHacks.java | 0 .../pro/gravit/utils/launch/ModuleLaunch.java | 316 ++++++++++++++++- .../pro/gravit/utils/helper/JVMHelper.java | 213 ------------ .../pro/gravit/utils/launch/ModuleLaunch.java | 323 ------------------ LauncherStart/build.gradle | 4 +- ServerWrapper/build.gradle | 24 +- 10 files changed, 324 insertions(+), 634 deletions(-) rename LauncherCore/src/main/{java11 => java}/pro/gravit/utils/launch/ModuleHacks.java (100%) delete mode 100644 LauncherCore/src/main/java11/pro/gravit/utils/helper/JVMHelper.java delete mode 100644 LauncherCore/src/main/java11/pro/gravit/utils/launch/ModuleLaunch.java diff --git a/LauncherAPI/build.gradle b/LauncherAPI/build.gradle index 8a418fc6..d50a567e 100644 --- a/LauncherAPI/build.gradle +++ b/LauncherAPI/build.gradle @@ -1,5 +1,5 @@ -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +sourceCompatibility = '17' +targetCompatibility = '17' dependencies { api project(':LauncherCore') @@ -14,29 +14,10 @@ api project(':LauncherCore') } } -sourceSets { - java11 { - java { - srcDirs = ['src/main/java11'] - } - dependencies { - java11Implementation files(sourceSets.main.output.classesDirs) { builtBy compileJava } - } - } -} - jar { - into('META-INF/versions/11') { - from sourceSets.java11.output - } archiveClassifier.set('clean') } -compileJava11Java { - sourceCompatibility = 11 - targetCompatibility = 11 -} - tasks.register('sourcesJar', Jar) { from sourceSets.main.allJava archiveClassifier.set('sources') diff --git a/LauncherClient/build.gradle b/LauncherClient/build.gradle index 5c62ac48..9a59ce29 100644 --- a/LauncherClient/build.gradle +++ b/LauncherClient/build.gradle @@ -8,8 +8,8 @@ url "https://repo.spring.io/plugins-release/" } } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +sourceCompatibility = '17' +targetCompatibility = '17' jar { archiveClassifier.set('clean') diff --git a/LauncherCore/build.gradle b/LauncherCore/build.gradle index 86420ba1..efd55c0a 100644 --- a/LauncherCore/build.gradle +++ b/LauncherCore/build.gradle @@ -1,5 +1,5 @@ -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +sourceCompatibility = '17' +targetCompatibility = '17' dependencies { compileOnly group: 'org.fusesource.jansi', name: 'jansi', version: rootProject['verJansi'] @@ -21,28 +21,10 @@ events "passed", "skipped", "failed" } } -sourceSets { - java11 { - java { - srcDirs = ['src/main/java11'] - } - dependencies { - java11Implementation group: 'com.google.code.gson', name: 'gson', version: rootProject['verGson'] - java11Implementation files(sourceSets.main.output.classesDirs) { builtBy compileJava } - } - } -} jar { - into('META-INF/versions/11') { - from sourceSets.java11.output - } archiveClassifier.set('clean') manifest.attributes("Multi-Release": "true") } -compileJava11Java { - sourceCompatibility = 11 - targetCompatibility = 11 -} tasks.register('sourcesJar', Jar) { from sourceSets.main.allJava diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java index e691aacb..d2779207 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java @@ -53,35 +53,12 @@ public static ARCH getArch(String arch) { } public static int getVersion() { - String version = System.getProperty("java.version"); - if (version.startsWith("1.")) { - version = version.substring(2, 3); - } else { - int dot = version.indexOf("."); - if (dot != -1) { - version = version.substring(0, dot); - } - } - return Integer.parseInt(version); + //System.out.println("[DEBUG] JVMHelper 11 version"); + return Runtime.version().feature(); } public static int getBuild() { - String version = System.getProperty("java.version"); - int dot; - if (version.startsWith("1.")) { - dot = version.indexOf("_"); - } else { - dot = version.lastIndexOf("."); - } - if (dot != -1) { - version = version.substring(dot + 1); - } - try { - return Integer.parseInt(version); - } catch (NumberFormatException exception) { - return 0; - } - + return Runtime.version().update(); } public static String getNativeExtension(JVMHelper.OS OS_TYPE) { diff --git a/LauncherCore/src/main/java11/pro/gravit/utils/launch/ModuleHacks.java b/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleHacks.java similarity index 100% rename from LauncherCore/src/main/java11/pro/gravit/utils/launch/ModuleHacks.java rename to LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleHacks.java diff --git a/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java b/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java index 0301ad02..ab4d829d 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java @@ -1,17 +1,323 @@ package pro.gravit.utils.launch; +import pro.gravit.utils.helper.HackHelper; +import pro.gravit.utils.helper.IOHelper; +import pro.gravit.utils.helper.JVMHelper; +import pro.gravit.utils.helper.LogHelper; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.lang.module.Configuration; +import java.lang.module.ModuleFinder; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URL; +import java.net.URLClassLoader; import java.nio.file.Path; -import java.util.Collection; -import java.util.List; +import java.nio.file.Paths; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; public class ModuleLaunch implements Launch { + private ModuleClassLoader moduleClassLoader; + private Configuration configuration; + private ModuleLayer.Controller controller; + private ModuleFinder moduleFinder; + private ModuleLayer layer; + private MethodHandles.Lookup hackLookup; + private boolean disablePackageDelegateSupport; @Override public ClassLoaderControl init(List files, String nativePath, LaunchOptions options) { - throw new UnsupportedOperationException("Please use Multi-Release JAR"); + this.disablePackageDelegateSupport = options.disablePackageDelegateSupport; + moduleClassLoader = new ModuleClassLoader(files.stream().map((e) -> { + try { + return e.toUri().toURL(); + } catch (MalformedURLException ex) { + throw new RuntimeException(ex); + } + }).toArray(URL[]::new), ClassLoader.getPlatformClassLoader()); + moduleClassLoader.nativePath = nativePath; + { + if(options.enableHacks) { + hackLookup = HackHelper.createHackLookup(ModuleLaunch.class); + } + if(options.moduleConf != null) { + // Create Module Layer + moduleFinder = ModuleFinder.of(options.moduleConf.modulePath.stream().map(Paths::get).map(Path::toAbsolutePath).toArray(Path[]::new)); + ModuleLayer bootLayer = ModuleLayer.boot(); + if(options.moduleConf.modules.contains("ALL-MODULE-PATH")) { + var set = moduleFinder.findAll(); + if(LogHelper.isDevEnabled()) { + for(var m : set) { + LogHelper.dev("Found module %s in %s", m.descriptor().name(), m.location().map(URI::toString).orElse("unknown")); + } + LogHelper.dev("Found %d modules", set.size()); + } + for(var m : set) { + options.moduleConf.modules.add(m.descriptor().name()); + } + options.moduleConf.modules.remove("ALL-MODULE-PATH"); + } + configuration = bootLayer.configuration() + .resolveAndBind(moduleFinder, ModuleFinder.of(), options.moduleConf.modules); + controller = ModuleLayer.defineModulesWithOneLoader(configuration, List.of(bootLayer), moduleClassLoader); + layer = controller.layer(); + // Configure exports / opens + for(var e : options.moduleConf.exports.entrySet()) { + String[] split = e.getKey().split("/"); + String moduleName = split[0]; + String pkg = split[1]; + LogHelper.dev("Export module: %s package: %s to %s", moduleName, pkg, e.getValue()); + Module source = layer.findModule(split[0]).orElse(null); + if(source == null) { + throw new RuntimeException(String.format("Module %s not found", moduleName)); + } + Module target = layer.findModule(e.getValue()).orElse(null); + if(target == null) { + throw new RuntimeException(String.format("Module %s not found", e.getValue())); + } + if(options.enableHacks && source.getLayer() != layer) { + ModuleHacks.createController(hackLookup, source.getLayer()).addExports(source, pkg, target); + } else { + controller.addExports(source, pkg, target); + } + } + for(var e : options.moduleConf.opens.entrySet()) { + String[] split = e.getKey().split("/"); + String moduleName = split[0]; + String pkg = split[1]; + LogHelper.dev("Open module: %s package: %s to %s", moduleName, pkg, e.getValue()); + Module source = layer.findModule(split[0]).orElse(null); + if(source == null) { + throw new RuntimeException(String.format("Module %s not found", moduleName)); + } + Module target = layer.findModule(e.getValue()).orElse(null); + if(target == null) { + throw new RuntimeException(String.format("Module %s not found", e.getValue())); + } + if(options.enableHacks && source.getLayer() != layer) { + ModuleHacks.createController(hackLookup, source.getLayer()).addOpens(source, pkg, target); + } else { + controller.addOpens(source, pkg, target); + } + } + for(var e : options.moduleConf.reads.entrySet()) { + LogHelper.dev("Read module %s to %s", e.getKey(), e.getValue()); + Module source = layer.findModule(e.getKey()).orElse(null); + if(source == null) { + throw new RuntimeException(String.format("Module %s not found", e.getKey())); + } + Module target = layer.findModule(e.getValue()).orElse(null); + if(target == null) { + throw new RuntimeException(String.format("Module %s not found", e.getValue())); + } + if(options.enableHacks && source.getLayer() != layer) { + ModuleHacks.createController(hackLookup, source.getLayer()).addReads(source, target); + } else { + controller.addReads(source, target); + } + } + moduleClassLoader.initializeWithLayer(layer); + } + } + return moduleClassLoader.makeControl(); } @Override - public void launch(String mainClass, String mainModule, Collection args) throws Throwable { - throw new UnsupportedOperationException("Please use Multi-Release JAR"); + public void launch(String mainClass, String mainModuleName, Collection args) throws Throwable { + Thread.currentThread().setContextClassLoader(moduleClassLoader); + if(mainModuleName == null) { + Class mainClazz = Class.forName(mainClass, true, moduleClassLoader); + MethodHandle mainMethod = MethodHandles.lookup().findStatic(mainClazz, "main", MethodType.methodType(void.class, String[].class)).asFixedArity(); + JVMHelper.fullGC(); + mainMethod.asFixedArity().invokeWithArguments((Object) args.toArray(new String[0])); + return; + } + Module mainModule = layer.findModule(mainModuleName).orElseThrow(); + Module unnamed = ModuleLaunch.class.getClassLoader().getUnnamedModule(); + if(unnamed != null) { + controller.addOpens(mainModule, getPackageFromClass(mainClass), unnamed); + } + // Start main class + ClassLoader loader = mainModule.getClassLoader(); + Class mainClazz = Class.forName(mainClass, true, loader); + MethodHandle mainMethod = MethodHandles.lookup().findStatic(mainClazz, "main", MethodType.methodType(void.class, String[].class)); + mainMethod.asFixedArity().invokeWithArguments((Object) args.toArray(new String[0])); + } + + private static String getPackageFromClass(String clazz) { + int index = clazz.lastIndexOf("."); + if(index >= 0) { + return clazz.substring(0, index); + } + return clazz; + } + + private class ModuleClassLoader extends URLClassLoader { + private final ClassLoader SYSTEM_CLASS_LOADER = ClassLoader.getSystemClassLoader(); + private final List transformers = new ArrayList<>(); + private final Map> classMap = new ConcurrentHashMap<>(); + private final Map packageToModule = new HashMap<>(); + private String nativePath; + + private final List packages = new ArrayList<>(); + public ModuleClassLoader(URL[] urls, ClassLoader parent) { + super("LAUNCHER", urls, parent); + packages.add("pro.gravit.launcher."); + packages.add("pro.gravit.utils."); + } + + private void initializeWithLayer(ModuleLayer layer) { + for(var m : layer.modules()) { + for(var p : m.getPackages()) { + packageToModule.put(p, m); + } + } + } + + @Override + protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + if(name != null && !disablePackageDelegateSupport) { + for(String pkg : packages) { + if(name.startsWith(pkg)) { + return SYSTEM_CLASS_LOADER.loadClass(name); + } + } + } + return super.loadClass(name, resolve); + } + + @Override + protected Class findClass(String name) throws ClassNotFoundException { + var clazz = findClass(null, name); + if(clazz == null) { + throw new ClassNotFoundException(name); + } + return clazz; + } + + @Override + protected Class findClass(String moduleName, String name) { + Class clazz; + { + clazz = classMap.get(name); + if(clazz != null) { + return clazz; + } + } + if(name != null && !transformers.isEmpty()) { + boolean needTransform = false; + for(ClassLoaderControl.ClassTransformer t : transformers) { + if(t.filter(moduleName, name)) { + needTransform = true; + break; + } + } + if(needTransform) { + String rawClassName = name.replace(".", "/").concat(".class"); + try(InputStream input = getResourceAsStream(rawClassName)) { + byte[] bytes = IOHelper.read(input); + for(ClassLoaderControl.ClassTransformer t : transformers) { + bytes = t.transform(moduleName, name, null, bytes); + } + clazz = defineClass(name, bytes, 0, bytes.length); + } catch (IOException e) { + return null; + } + } + } + if(clazz == null && layer != null && name != null) { + var pkg = getPackageFromClass(name); + var module = packageToModule.get(pkg); + if(module != null) { + try { + clazz = module.getClassLoader().loadClass(name); + } catch (ClassNotFoundException e) { + return null; + } + } + } + if(clazz == null) { + try { + clazz = super.findClass(name); + } catch (ClassNotFoundException e) { + return null; + } + } + if(clazz != null) { + classMap.put(name, clazz); + return clazz; + } else { + return null; + } + } + + @Override + public String findLibrary(String name) { + return nativePath.concat(IOHelper.PLATFORM_SEPARATOR).concat(JVMHelper.NATIVE_PREFIX).concat(name).concat(JVMHelper.NATIVE_EXTENSION); + } + + public void addAllowedPackage(String pkg) { + packages.add(pkg); + } + + private ModuleClassLoaderControl makeControl() { + return new ModuleClassLoaderControl(); + } + + private class ModuleClassLoaderControl implements ClassLoaderControl { + + @Override + public void addLauncherPackage(String prefix) { + addAllowedPackage(prefix); + } + + @Override + public void addTransformer(ClassTransformer transformer) { + transformers.add(transformer); + } + + @Override + public void addURL(URL url) { + ModuleClassLoader.this.addURL(url); + } + + @Override + public void addJar(Path path) { + try { + ModuleClassLoader.this.addURL(path.toUri().toURL()); + } catch (MalformedURLException e) { + throw new RuntimeException(e); + } + } + + @Override + public URL[] getURLs() { + return ModuleClassLoader.this.getURLs(); + } + + @Override + public Class getClass(String name) throws ClassNotFoundException { + return Class.forName(name, false, ModuleClassLoader.this); + } + + @Override + public ClassLoader getClassLoader() { + return ModuleClassLoader.this; + } + + @Override + public Object getJava9ModuleController() { + return controller; + } + + @Override + public MethodHandles.Lookup getHackLookup() { + return hackLookup; + } + } } } diff --git a/LauncherCore/src/main/java11/pro/gravit/utils/helper/JVMHelper.java b/LauncherCore/src/main/java11/pro/gravit/utils/helper/JVMHelper.java deleted file mode 100644 index d2779207..00000000 --- a/LauncherCore/src/main/java11/pro/gravit/utils/helper/JVMHelper.java +++ /dev/null @@ -1,213 +0,0 @@ -package pro.gravit.utils.helper; - -import java.io.File; -import java.lang.invoke.MethodHandles; -import java.lang.management.ManagementFactory; -import java.lang.management.OperatingSystemMXBean; -import java.lang.management.RuntimeMXBean; -import java.net.MalformedURLException; -import java.net.URL; -import java.security.cert.X509Certificate; -import java.util.Arrays; -import java.util.Collection; -import java.util.Locale; -import java.util.Map; - -public final class JVMHelper { - - // MXBeans exports - public static final RuntimeMXBean RUNTIME_MXBEAN = ManagementFactory.getRuntimeMXBean(); - public static final OperatingSystemMXBean OPERATING_SYSTEM_MXBEAN = - ManagementFactory.getOperatingSystemMXBean(); - public static final OS OS_TYPE = OS.byName(OPERATING_SYSTEM_MXBEAN.getName()); - public static final int OS_BITS = getCorrectOSArch(); - // System properties - public static final String OS_VERSION = OPERATING_SYSTEM_MXBEAN.getVersion(); - public static final ARCH ARCH_TYPE = getArch(System.getProperty("os.arch")); - public static final String NATIVE_EXTENSION = getNativeExtension(OS_TYPE); - public static final String NATIVE_PREFIX = getNativePrefix(OS_TYPE); - public static final int JVM_BITS = Integer.parseInt(System.getProperty("sun.arch.data.model")); - // Public static fields - public static final Runtime RUNTIME = Runtime.getRuntime(); - public static final ClassLoader LOADER = ClassLoader.getSystemClassLoader(); - public static final int JVM_VERSION = getVersion(); - public static final int JVM_BUILD = getBuild(); - - static { - try { - MethodHandles.publicLookup(); // Just to initialize class - } catch (Throwable exc) { - throw new InternalError(exc); - } - } - - private JVMHelper() { - } - - public static ARCH getArch(String arch) { - if (arch.equals("amd64") || arch.equals("x86-64") || arch.equals("x86_64")) return ARCH.X86_64; - if (arch.equals("i386") || arch.equals("i686") || arch.equals("x86")) return ARCH.X86; - if (arch.startsWith("armv8") || arch.startsWith("aarch64")) return ARCH.ARM64; - if (arch.startsWith("arm") || arch.startsWith("aarch32")) return ARCH.ARM32; - throw new InternalError(String.format("Unsupported arch '%s'", arch)); - } - - public static int getVersion() { - //System.out.println("[DEBUG] JVMHelper 11 version"); - return Runtime.version().feature(); - } - - public static int getBuild() { - return Runtime.version().update(); - } - - public static String getNativeExtension(JVMHelper.OS OS_TYPE) { - switch (OS_TYPE) { - case MUSTDIE: - return ".dll"; - case LINUX: - return ".so"; - case MACOSX: - return ".dylib"; - default: - throw new InternalError(String.format("Unsupported OS TYPE '%s'", OS_TYPE)); - } - } - - public static String getNativePrefix(JVMHelper.OS OS_TYPE) { - switch (OS_TYPE) { - case LINUX: - case MACOSX: - return "lib"; - default: - return ""; - } - } - - public static void appendVars(ProcessBuilder builder, Map vars) { - builder.environment().putAll(vars); - } - - public static Class firstClass(String... names) throws ClassNotFoundException { - for (String name : names) - try { - return Class.forName(name, false, LOADER); - } catch (ClassNotFoundException ignored) { - // Expected - } - throw new ClassNotFoundException(Arrays.toString(names)); - } - - public static void fullGC() { - RUNTIME.gc(); - LogHelper.debug("Used heap: %d MiB", RUNTIME.totalMemory() - RUNTIME.freeMemory() >> 20); - } - - public static String[] getClassPath() { - return System.getProperty("java.class.path").split(File.pathSeparator); - } - - public static URL[] getClassPathURL() { - String[] cp = System.getProperty("java.class.path").split(File.pathSeparator); - URL[] list = new URL[cp.length]; - - for (int i = 0; i < cp.length; i++) { - URL url = null; - try { - url = new URL(cp[i]); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - list[i] = url; - } - return list; - } - - public static X509Certificate[] getCertificates(Class clazz) { - Object[] signers = clazz.getSigners(); - if (signers == null) return null; - return Arrays.stream(signers).filter((c) -> c instanceof X509Certificate).map((c) -> (X509Certificate) c).toArray(X509Certificate[]::new); - } - - public static void checkStackTrace(Class mainClass) { - LogHelper.debug("Testing stacktrace"); - Exception e = new Exception("Testing stacktrace"); - StackTraceElement[] list = e.getStackTrace(); - if (!list[list.length - 1].getClassName().equals(mainClass.getName())) { - throw new SecurityException(String.format("Invalid StackTraceElement: %s", list[list.length - 1].getClassName())); - } - } - - private static int getCorrectOSArch() { - // As always, mustdie must die - if (OS_TYPE == OS.MUSTDIE) - return System.getenv("ProgramFiles(x86)") == null ? 32 : 64; - - // Or trust system property (maybe incorrect) - return System.getProperty("os.arch").contains("64") ? 64 : 32; - } - - public static String getEnvPropertyCaseSensitive(String name) { - return System.getenv().get(name); - } - - public static boolean isJVMMatchesSystemArch() { - return JVM_BITS == OS_BITS; - } - - public static String jvmProperty(String name, String value) { - return String.format("-D%s=%s", name, value); - } - - public static String systemToJvmProperty(String name) { - return String.format("-D%s=%s", name, System.getProperties().getProperty(name)); - } - - public static void addSystemPropertyToArgs(Collection args, String name) { - String property = System.getProperty(name); - if (property != null) - args.add(String.format("-D%s=%s", name, property)); - } - - public static void verifySystemProperties(Class mainClass, boolean requireSystem) { - Locale.setDefault(Locale.US); - // Verify class loader - LogHelper.debug("Verifying class loader"); - if (requireSystem && !mainClass.getClassLoader().equals(LOADER)) - throw new SecurityException("ClassLoader should be system"); - - // Verify system and java architecture - LogHelper.debug("Verifying JVM architecture"); - } - - public enum ARCH { - X86("x86"), X86_64("x86-64"), ARM64("arm64"), ARM32("arm32"); - - public final String name; - - ARCH(String name) { - this.name = name; - } - } - - public enum OS { - MUSTDIE("mustdie"), LINUX("linux"), MACOSX("macosx"); - - public final String name; - - OS(String name) { - this.name = name; - } - - public static OS byName(String name) { - if (name.startsWith("Windows")) - return MUSTDIE; - if (name.startsWith("Linux")) - return LINUX; - if (name.startsWith("Mac OS X")) - return MACOSX; - throw new RuntimeException(String.format("This shit is not yet supported: '%s'", name)); - } - } - -} diff --git a/LauncherCore/src/main/java11/pro/gravit/utils/launch/ModuleLaunch.java b/LauncherCore/src/main/java11/pro/gravit/utils/launch/ModuleLaunch.java deleted file mode 100644 index ab4d829d..00000000 --- a/LauncherCore/src/main/java11/pro/gravit/utils/launch/ModuleLaunch.java +++ /dev/null @@ -1,323 +0,0 @@ -package pro.gravit.utils.launch; - -import pro.gravit.utils.helper.HackHelper; -import pro.gravit.utils.helper.IOHelper; -import pro.gravit.utils.helper.JVMHelper; -import pro.gravit.utils.helper.LogHelper; - -import java.io.IOException; -import java.io.InputStream; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; -import java.lang.module.Configuration; -import java.lang.module.ModuleFinder; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.net.URLClassLoader; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - -public class ModuleLaunch implements Launch { - private ModuleClassLoader moduleClassLoader; - private Configuration configuration; - private ModuleLayer.Controller controller; - private ModuleFinder moduleFinder; - private ModuleLayer layer; - private MethodHandles.Lookup hackLookup; - private boolean disablePackageDelegateSupport; - @Override - public ClassLoaderControl init(List files, String nativePath, LaunchOptions options) { - this.disablePackageDelegateSupport = options.disablePackageDelegateSupport; - moduleClassLoader = new ModuleClassLoader(files.stream().map((e) -> { - try { - return e.toUri().toURL(); - } catch (MalformedURLException ex) { - throw new RuntimeException(ex); - } - }).toArray(URL[]::new), ClassLoader.getPlatformClassLoader()); - moduleClassLoader.nativePath = nativePath; - { - if(options.enableHacks) { - hackLookup = HackHelper.createHackLookup(ModuleLaunch.class); - } - if(options.moduleConf != null) { - // Create Module Layer - moduleFinder = ModuleFinder.of(options.moduleConf.modulePath.stream().map(Paths::get).map(Path::toAbsolutePath).toArray(Path[]::new)); - ModuleLayer bootLayer = ModuleLayer.boot(); - if(options.moduleConf.modules.contains("ALL-MODULE-PATH")) { - var set = moduleFinder.findAll(); - if(LogHelper.isDevEnabled()) { - for(var m : set) { - LogHelper.dev("Found module %s in %s", m.descriptor().name(), m.location().map(URI::toString).orElse("unknown")); - } - LogHelper.dev("Found %d modules", set.size()); - } - for(var m : set) { - options.moduleConf.modules.add(m.descriptor().name()); - } - options.moduleConf.modules.remove("ALL-MODULE-PATH"); - } - configuration = bootLayer.configuration() - .resolveAndBind(moduleFinder, ModuleFinder.of(), options.moduleConf.modules); - controller = ModuleLayer.defineModulesWithOneLoader(configuration, List.of(bootLayer), moduleClassLoader); - layer = controller.layer(); - // Configure exports / opens - for(var e : options.moduleConf.exports.entrySet()) { - String[] split = e.getKey().split("/"); - String moduleName = split[0]; - String pkg = split[1]; - LogHelper.dev("Export module: %s package: %s to %s", moduleName, pkg, e.getValue()); - Module source = layer.findModule(split[0]).orElse(null); - if(source == null) { - throw new RuntimeException(String.format("Module %s not found", moduleName)); - } - Module target = layer.findModule(e.getValue()).orElse(null); - if(target == null) { - throw new RuntimeException(String.format("Module %s not found", e.getValue())); - } - if(options.enableHacks && source.getLayer() != layer) { - ModuleHacks.createController(hackLookup, source.getLayer()).addExports(source, pkg, target); - } else { - controller.addExports(source, pkg, target); - } - } - for(var e : options.moduleConf.opens.entrySet()) { - String[] split = e.getKey().split("/"); - String moduleName = split[0]; - String pkg = split[1]; - LogHelper.dev("Open module: %s package: %s to %s", moduleName, pkg, e.getValue()); - Module source = layer.findModule(split[0]).orElse(null); - if(source == null) { - throw new RuntimeException(String.format("Module %s not found", moduleName)); - } - Module target = layer.findModule(e.getValue()).orElse(null); - if(target == null) { - throw new RuntimeException(String.format("Module %s not found", e.getValue())); - } - if(options.enableHacks && source.getLayer() != layer) { - ModuleHacks.createController(hackLookup, source.getLayer()).addOpens(source, pkg, target); - } else { - controller.addOpens(source, pkg, target); - } - } - for(var e : options.moduleConf.reads.entrySet()) { - LogHelper.dev("Read module %s to %s", e.getKey(), e.getValue()); - Module source = layer.findModule(e.getKey()).orElse(null); - if(source == null) { - throw new RuntimeException(String.format("Module %s not found", e.getKey())); - } - Module target = layer.findModule(e.getValue()).orElse(null); - if(target == null) { - throw new RuntimeException(String.format("Module %s not found", e.getValue())); - } - if(options.enableHacks && source.getLayer() != layer) { - ModuleHacks.createController(hackLookup, source.getLayer()).addReads(source, target); - } else { - controller.addReads(source, target); - } - } - moduleClassLoader.initializeWithLayer(layer); - } - } - return moduleClassLoader.makeControl(); - } - - @Override - public void launch(String mainClass, String mainModuleName, Collection args) throws Throwable { - Thread.currentThread().setContextClassLoader(moduleClassLoader); - if(mainModuleName == null) { - Class mainClazz = Class.forName(mainClass, true, moduleClassLoader); - MethodHandle mainMethod = MethodHandles.lookup().findStatic(mainClazz, "main", MethodType.methodType(void.class, String[].class)).asFixedArity(); - JVMHelper.fullGC(); - mainMethod.asFixedArity().invokeWithArguments((Object) args.toArray(new String[0])); - return; - } - Module mainModule = layer.findModule(mainModuleName).orElseThrow(); - Module unnamed = ModuleLaunch.class.getClassLoader().getUnnamedModule(); - if(unnamed != null) { - controller.addOpens(mainModule, getPackageFromClass(mainClass), unnamed); - } - // Start main class - ClassLoader loader = mainModule.getClassLoader(); - Class mainClazz = Class.forName(mainClass, true, loader); - MethodHandle mainMethod = MethodHandles.lookup().findStatic(mainClazz, "main", MethodType.methodType(void.class, String[].class)); - mainMethod.asFixedArity().invokeWithArguments((Object) args.toArray(new String[0])); - } - - private static String getPackageFromClass(String clazz) { - int index = clazz.lastIndexOf("."); - if(index >= 0) { - return clazz.substring(0, index); - } - return clazz; - } - - private class ModuleClassLoader extends URLClassLoader { - private final ClassLoader SYSTEM_CLASS_LOADER = ClassLoader.getSystemClassLoader(); - private final List transformers = new ArrayList<>(); - private final Map> classMap = new ConcurrentHashMap<>(); - private final Map packageToModule = new HashMap<>(); - private String nativePath; - - private final List packages = new ArrayList<>(); - public ModuleClassLoader(URL[] urls, ClassLoader parent) { - super("LAUNCHER", urls, parent); - packages.add("pro.gravit.launcher."); - packages.add("pro.gravit.utils."); - } - - private void initializeWithLayer(ModuleLayer layer) { - for(var m : layer.modules()) { - for(var p : m.getPackages()) { - packageToModule.put(p, m); - } - } - } - - @Override - protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { - if(name != null && !disablePackageDelegateSupport) { - for(String pkg : packages) { - if(name.startsWith(pkg)) { - return SYSTEM_CLASS_LOADER.loadClass(name); - } - } - } - return super.loadClass(name, resolve); - } - - @Override - protected Class findClass(String name) throws ClassNotFoundException { - var clazz = findClass(null, name); - if(clazz == null) { - throw new ClassNotFoundException(name); - } - return clazz; - } - - @Override - protected Class findClass(String moduleName, String name) { - Class clazz; - { - clazz = classMap.get(name); - if(clazz != null) { - return clazz; - } - } - if(name != null && !transformers.isEmpty()) { - boolean needTransform = false; - for(ClassLoaderControl.ClassTransformer t : transformers) { - if(t.filter(moduleName, name)) { - needTransform = true; - break; - } - } - if(needTransform) { - String rawClassName = name.replace(".", "/").concat(".class"); - try(InputStream input = getResourceAsStream(rawClassName)) { - byte[] bytes = IOHelper.read(input); - for(ClassLoaderControl.ClassTransformer t : transformers) { - bytes = t.transform(moduleName, name, null, bytes); - } - clazz = defineClass(name, bytes, 0, bytes.length); - } catch (IOException e) { - return null; - } - } - } - if(clazz == null && layer != null && name != null) { - var pkg = getPackageFromClass(name); - var module = packageToModule.get(pkg); - if(module != null) { - try { - clazz = module.getClassLoader().loadClass(name); - } catch (ClassNotFoundException e) { - return null; - } - } - } - if(clazz == null) { - try { - clazz = super.findClass(name); - } catch (ClassNotFoundException e) { - return null; - } - } - if(clazz != null) { - classMap.put(name, clazz); - return clazz; - } else { - return null; - } - } - - @Override - public String findLibrary(String name) { - return nativePath.concat(IOHelper.PLATFORM_SEPARATOR).concat(JVMHelper.NATIVE_PREFIX).concat(name).concat(JVMHelper.NATIVE_EXTENSION); - } - - public void addAllowedPackage(String pkg) { - packages.add(pkg); - } - - private ModuleClassLoaderControl makeControl() { - return new ModuleClassLoaderControl(); - } - - private class ModuleClassLoaderControl implements ClassLoaderControl { - - @Override - public void addLauncherPackage(String prefix) { - addAllowedPackage(prefix); - } - - @Override - public void addTransformer(ClassTransformer transformer) { - transformers.add(transformer); - } - - @Override - public void addURL(URL url) { - ModuleClassLoader.this.addURL(url); - } - - @Override - public void addJar(Path path) { - try { - ModuleClassLoader.this.addURL(path.toUri().toURL()); - } catch (MalformedURLException e) { - throw new RuntimeException(e); - } - } - - @Override - public URL[] getURLs() { - return ModuleClassLoader.this.getURLs(); - } - - @Override - public Class getClass(String name) throws ClassNotFoundException { - return Class.forName(name, false, ModuleClassLoader.this); - } - - @Override - public ClassLoader getClassLoader() { - return ModuleClassLoader.this; - } - - @Override - public Object getJava9ModuleController() { - return controller; - } - - @Override - public MethodHandles.Lookup getHackLookup() { - return hackLookup; - } - } - } -} diff --git a/LauncherStart/build.gradle b/LauncherStart/build.gradle index bdc73a50..225658f7 100644 --- a/LauncherStart/build.gradle +++ b/LauncherStart/build.gradle @@ -8,8 +8,8 @@ url "https://repo.spring.io/plugins-release/" } } -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +sourceCompatibility = '17' +targetCompatibility = '17' jar { archiveClassifier.set('clean') diff --git a/ServerWrapper/build.gradle b/ServerWrapper/build.gradle index 66520bef..9937f08f 100644 --- a/ServerWrapper/build.gradle +++ b/ServerWrapper/build.gradle @@ -14,30 +14,10 @@ } } -sourceSets { - java11 { - java { - srcDirs = ['src/main/java11'] - } - dependencies { - java11Implementation project(':LauncherAPI') - java11Implementation files(sourceSets.main.output.classesDirs) { builtBy compileJava } - } - } -} - -sourceCompatibility = '1.8' -targetCompatibility = '1.8' - -compileJava11Java { - sourceCompatibility = 11 - targetCompatibility = 11 -} +sourceCompatibility = '17' +targetCompatibility = '17' jar { - into('META-INF/versions/11') { - from sourceSets.java11.output - } archiveClassifier.set('clean') manifest.attributes("Main-Class": mainClassName, "Premain-Class": mainAgentName, From e6516a89911d0d6ec90706d5551db7ec4ac53c86 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sat, 23 Dec 2023 12:25:11 +0700 Subject: [PATCH 05/23] [REFACTOR] IDEA mini refactor --- .../launchserver/LaunchServerStarter.java | 3 --- .../pro/gravit/launchserver/StarterAgent.java | 6 ----- .../launchserver/auth/AuthProviderPair.java | 8 +++--- .../auth/core/MySQLCoreProvider.java | 2 +- .../AuthSupportExtendedCheckServer.java | 1 - .../auth/protect/StdProtectHandler.java | 2 +- .../launchserver/binary/BinaryPipeline.java | 2 -- .../binary/tasks/exe/Launch4JTask.java | 1 - .../command/hash/SaveProfilesCommand.java | 2 +- .../config/LaunchServerConfig.java | 2 +- .../gravit/launchserver/socket/Client.java | 1 - .../launchserver/FeatureCollectionTest.java | 2 -- .../runtime/client/ClientLauncherProcess.java | 8 +++--- .../client/runtime/utils/HWIDProvider.java | 4 +-- .../pro/gravit/launcher/LauncherConfig.java | 4 +-- .../pro/gravit/launcher/request/Request.java | 4 +-- .../websockets/StdWebSocketService.java | 3 +-- .../websockets/WebSocketClientHandler.java | 6 ++--- .../client/BasicLauncherEventHandler.java | 3 +-- .../client/api/CertificateService.java | 22 ++++++--------- .../runtime/client/ClientModuleManager.java | 2 +- .../launcher/core/hasher/HashedDir.java | 15 ++++------- .../launcher/core/serialize/HInput.java | 13 ++++----- .../pro/gravit/utils/helper/CommonHelper.java | 2 +- .../pro/gravit/utils/helper/FormatHelper.java | 17 +++++------- .../pro/gravit/utils/helper/HackHelper.java | 2 -- .../pro/gravit/utils/helper/IOHelper.java | 26 +++++------------- .../pro/gravit/utils/helper/JVMHelper.java | 27 +++++++------------ .../pro/gravit/utils/helper/JavaHelper.java | 12 ++------- .../gravit/launcher/modern/Downloader.java | 8 ++---- .../launcher/start/RuntimeModuleManager.java | 2 +- .../gravit/launcher/server/ServerWrapper.java | 7 +++-- .../server/authlib/InstallAuthlib.java | 4 +-- 33 files changed, 75 insertions(+), 148 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java index 57d87cf3..e7b93168 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java @@ -28,15 +28,12 @@ import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.LogHelper; -import pro.gravit.utils.launch.LaunchOptions; -import pro.gravit.utils.launch.ModuleLaunch; import java.io.*; import java.nio.file.Files; import java.nio.file.Path; import java.security.Security; import java.security.cert.CertificateException; -import java.util.ArrayList; import java.util.List; public class LaunchServerStarter { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/StarterAgent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/StarterAgent.java index 2809eac6..484d754e 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/StarterAgent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/StarterAgent.java @@ -1,13 +1,7 @@ package pro.gravit.launchserver; -import java.io.IOException; import java.lang.instrument.Instrumentation; import java.nio.file.*; -import java.nio.file.attribute.BasicFileAttributes; -import java.nio.file.attribute.PosixFileAttributeView; -import java.nio.file.attribute.PosixFilePermission; -import java.util.*; -import java.util.jar.JarFile; public final class StarterAgent { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthProviderPair.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthProviderPair.java index 9645fa01..72c198f2 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthProviderPair.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthProviderPair.java @@ -57,7 +57,7 @@ public static void getFeatures(Class clazz, Set list) { } } - public final T isSupport(Class clazz) { + public T isSupport(Class clazz) { if (core == null) return null; T result = core.isSupport(clazz); if (result == null && mixes != null) { @@ -71,7 +71,7 @@ public final T isSupport(Class clazz) { return result; } - public final void init(LaunchServer srv, String name) { + public void init(LaunchServer srv, String name) { this.name = name; if (links != null) link(srv); core.init(srv); @@ -85,7 +85,7 @@ public final void init(LaunchServer srv, String name) { } } - public final void link(LaunchServer srv) { + public void link(LaunchServer srv) { links.forEach((k, v) -> { AuthProviderPair pair = srv.config.getAuthProviderPair(v); if (pair == null) { @@ -99,7 +99,7 @@ public final void link(LaunchServer srv) { }); } - public final void close() throws IOException { + public void close() throws IOException { core.close(); if (textureProvider != null) { textureProvider.close(); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java index ce093a2e..c5ed101a 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java @@ -332,7 +332,7 @@ public String toString() { } } - public class MySQLUser extends SQLUser { + public static class MySQLUser extends SQLUser { protected long hwidId; public MySQLUser(UUID uuid, String username, String accessToken, String serverId, String password, ClientPermissions permissions, long hwidId) { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportExtendedCheckServer.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportExtendedCheckServer.java index fb188782..a0eb8365 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportExtendedCheckServer.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportExtendedCheckServer.java @@ -1,6 +1,5 @@ package pro.gravit.launchserver.auth.core.interfaces.provider; -import pro.gravit.launchserver.auth.core.User; import pro.gravit.launchserver.auth.core.UserSession; import pro.gravit.launchserver.socket.Client; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java index 1b34b7ac..1188dcab 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java @@ -22,7 +22,7 @@ public boolean allowGetAccessToken(AuthResponse.AuthContext context) { @Override public void init(LaunchServer server) { - if (profileWhitelist != null && profileWhitelist.size() > 0) { + if (profileWhitelist != null && !profileWhitelist.isEmpty()) { logger.warn("profileWhitelist deprecated. Please use permission 'launchserver.profile.PROFILE_UUID.show' and 'launchserver.profile.PROFILE_UUID.enter'"); } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BinaryPipeline.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BinaryPipeline.java index dec8e0e2..86fbf9c3 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BinaryPipeline.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BinaryPipeline.java @@ -7,12 +7,10 @@ import pro.gravit.utils.helper.IOHelper; import java.io.IOException; -import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import java.util.Optional; -import java.util.concurrent.atomic.AtomicLong; import java.util.function.Predicate; import java.util.stream.Collectors; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java index 51197ee1..f9390719 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java @@ -5,7 +5,6 @@ import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.binary.tasks.LauncherBuildTask; import pro.gravit.utils.Version; -import pro.gravit.utils.helper.IOHelper; import java.io.IOException; import java.nio.file.Path; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/SaveProfilesCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/SaveProfilesCommand.java index 151011ba..c4609883 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/SaveProfilesCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/SaveProfilesCommand.java @@ -24,7 +24,7 @@ public SaveProfilesCommand(LaunchServer server) { public static void saveProfile(ClientProfile profile, Path path) throws IOException { if (profile.getUUID() == null) profile.setUUID(UUID.randomUUID()); - if (profile.getServers().size() == 0) { + if (profile.getServers().isEmpty()) { ClientProfile.ServerProfile serverProfile = new ClientProfile.ServerProfile(); serverProfile.isDefault = true; serverProfile.name = profile.getTitle(); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java index 502889f8..8f01b866 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java @@ -142,7 +142,7 @@ public void setEnv(LauncherConfig.LauncherEnvironment env) { } public void verify() { - if (auth == null || auth.size() < 1) { + if (auth == null || auth.isEmpty()) { throw new NullPointerException("AuthProviderPair`s count should be at least one"); } 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 3853bf93..32b4fdf4 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java @@ -2,7 +2,6 @@ import pro.gravit.launcher.ClientPermissions; import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.request.secure.HardwareReportRequest; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.core.interfaces.UserHardware; diff --git a/LaunchServer/src/test/java/pro/gravit/launchserver/FeatureCollectionTest.java b/LaunchServer/src/test/java/pro/gravit/launchserver/FeatureCollectionTest.java index f222f818..670d95a2 100644 --- a/LaunchServer/src/test/java/pro/gravit/launchserver/FeatureCollectionTest.java +++ b/LaunchServer/src/test/java/pro/gravit/launchserver/FeatureCollectionTest.java @@ -5,8 +5,6 @@ import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.Feature; -import java.util.List; - public class FeatureCollectionTest { public static class TestClass1 implements TextInterface1 { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherProcess.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherProcess.java index 3942d933..29239476 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherProcess.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherProcess.java @@ -197,18 +197,18 @@ private void applyJava9Params(List processArgs) { StringBuilder modulesPath = new StringBuilder(); StringBuilder modulesAdd = new StringBuilder(); for (String moduleName : jvmModules) { - if (modulesAdd.length() > 0) modulesAdd.append(","); + if (!modulesAdd.isEmpty()) modulesAdd.append(","); modulesAdd.append(moduleName); } for (String modulePath : jvmModulesPaths) { - if (modulesPath.length() > 0) modulesPath.append(File.pathSeparator); + if (!modulesPath.isEmpty()) modulesPath.append(File.pathSeparator); modulesPath.append(modulePath); } - if (modulesAdd.length() > 0) { + if (!modulesAdd.isEmpty()) { processArgs.add("--add-modules"); processArgs.add(modulesAdd.toString()); } - if (modulesPath.length() > 0) { + if (!modulesPath.isEmpty()) { processArgs.add("--module-path"); processArgs.add(modulesPath.toString()); } diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/HWIDProvider.java b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/HWIDProvider.java index 31e7b261..4e1c8d4c 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/HWIDProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/HWIDProvider.java @@ -41,7 +41,7 @@ public int getProcessorLogicalCount() { public boolean isBattery() { List powerSources = hardware.getPowerSources(); - return powerSources != null && powerSources.size() != 0; + return powerSources != null && !powerSources.isEmpty(); } //Hardware Information @@ -93,7 +93,7 @@ public long getGraphicCardMemory() { public byte[] getDisplayID() { List displays = hardware.getDisplays(); - if (displays == null || displays.size() == 0) return null; + if (displays == null || displays.isEmpty()) return null; for (Display display : displays) { return display.getEdid(); } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java b/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java index 19e26ccd..4b923236 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java @@ -96,7 +96,7 @@ public LauncherConfig(String address, ECPublicKey ecdsaPublicKey, RSAPublicKey r this.address = address; this.ecdsaPublicKey = ecdsaPublicKey; this.rsaPublicKey = rsaPublicKey; - this.runtime = Collections.unmodifiableMap(new HashMap<>(runtime)); + this.runtime = Map.copyOf(runtime); this.projectName = projectName; this.clientPort = 32148; environment = LauncherEnvironment.STD; @@ -109,7 +109,7 @@ public LauncherConfig(String address, ECPublicKey ecdsaPublicKey, RSAPublicKey r public LauncherConfig(String address, Map runtime, String projectName, LauncherEnvironment env, LauncherTrustManager trustManager) { this.address = address; - this.runtime = Collections.unmodifiableMap(new HashMap<>(runtime)); + this.runtime = Map.copyOf(runtime); this.projectName = projectName; this.clientPort = 32148; this.trustManager = trustManager; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java index 991a638d..593e309b 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java @@ -203,12 +203,12 @@ public static synchronized RequestRestoreReport restore(boolean needUserInfo, bo } RestoreRequestEvent event = request.request(); List invalidTokens = null; - if (event.invalidTokens != null && event.invalidTokens.size() > 0) { + if (event.invalidTokens != null && !event.invalidTokens.isEmpty()) { Map tokens = makeNewTokens(event.invalidTokens); if (!tokens.isEmpty()) { request = new RestoreRequest(authId, null, tokens, false); event = request.request(); - if (event.invalidTokens != null && event.invalidTokens.size() > 0) { + if (event.invalidTokens != null && !event.invalidTokens.isEmpty()) { LogHelper.warning("Tokens %s not restored", String.join(",", event.invalidTokens)); } } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StdWebSocketService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StdWebSocketService.java index 1ee786f8..c4946129 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StdWebSocketService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StdWebSocketService.java @@ -72,8 +72,7 @@ public void processEventHandlers(T event) { @SuppressWarnings({"unchecked"}) public void eventHandle(T webSocketEvent) { - if (webSocketEvent instanceof RequestEvent) { - RequestEvent event = (RequestEvent) webSocketEvent; + if (webSocketEvent instanceof RequestEvent event) { if (event.requestUUID == null) { LogHelper.warning("Request event type %s.requestUUID is null", event.getType() == null ? "null" : event.getType()); return; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/WebSocketClientHandler.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/WebSocketClientHandler.java index 1fa99c11..99739729 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/WebSocketClientHandler.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/WebSocketClientHandler.java @@ -51,15 +51,13 @@ protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Except return; } - if (msg instanceof FullHttpResponse) { - final FullHttpResponse response = (FullHttpResponse) msg; + if (msg instanceof FullHttpResponse response) { throw new Exception("Unexpected FullHttpResponse (getStatus=" + response.status() + ", content=" + response.content().toString(CharsetUtil.UTF_8) + ')'); } final WebSocketFrame frame = (WebSocketFrame) msg; - if (frame instanceof TextWebSocketFrame) { - final TextWebSocketFrame textFrame = (TextWebSocketFrame) frame; + if (frame instanceof TextWebSocketFrame textFrame) { if (LogHelper.isDevEnabled()) { LogHelper.dev("Message: %s", textFrame.text()); } diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/BasicLauncherEventHandler.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/BasicLauncherEventHandler.java index aea92c9d..8b36651f 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/BasicLauncherEventHandler.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/BasicLauncherEventHandler.java @@ -28,8 +28,7 @@ public boolean eventHandle(T event) { if (token != null) { Request.addExtendedToken(event1.getExtendedTokenName(), new Request.ExtendedToken(event1.getExtendedToken(), event1.getExtendedTokenExpire())); } - } else if (event instanceof NotificationEvent) { - NotificationEvent n = (NotificationEvent) event; + } else if (event instanceof NotificationEvent n) { if (DialogService.isNotificationsAvailable()) { DialogService.createNotification(n.icon, n.head, n.message); } diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/api/CertificateService.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/CertificateService.java index 1bfbe960..222c8de6 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/api/CertificateService.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/CertificateService.java @@ -78,20 +78,14 @@ private static CheckClassResultApi fromCheckClassResult(LauncherTrustManager.Che private static CheckClassResultTypeApi fromType(LauncherTrustManager.CheckClassResultType type) { if (type == null) return null; - switch (type) { - case NOT_SIGNED: - return CheckClassResultTypeApi.NOT_SIGNED; - case SUCCESS: - return CheckClassResultTypeApi.SUCCESS; - case UNTRUSTED: - return CheckClassResultTypeApi.UNTRUSTED; - case UNVERIFED: - return CheckClassResultTypeApi.UNVERIFED; - case UNCOMPAT: - return CheckClassResultTypeApi.UNCOMPAT; - default: - return CheckClassResultTypeApi.UNKNOWN; - } + return switch (type) { + case NOT_SIGNED -> CheckClassResultTypeApi.NOT_SIGNED; + case SUCCESS -> CheckClassResultTypeApi.SUCCESS; + case UNTRUSTED -> CheckClassResultTypeApi.UNTRUSTED; + case UNVERIFED -> CheckClassResultTypeApi.UNVERIFED; + case UNCOMPAT -> CheckClassResultTypeApi.UNCOMPAT; + default -> CheckClassResultTypeApi.UNKNOWN; + }; } } } diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientModuleManager.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientModuleManager.java index 046cbc33..e89b8af5 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientModuleManager.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientModuleManager.java @@ -34,7 +34,7 @@ public List getModules() { } @Override - public final boolean verifyClassCheckResult(LauncherTrustManager.CheckClassResult result) { + public boolean verifyClassCheckResult(LauncherTrustManager.CheckClassResult result) { return result.type == LauncherTrustManager.CheckClassResultType.SUCCESS; } } diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedDir.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedDir.java index 14ed4211..232e98ce 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedDir.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/hasher/HashedDir.java @@ -30,16 +30,11 @@ public HashedDir(HInput input) throws IOException { // Read entry HashedEntry entry; Type type = Type.read(input); - switch (type) { - case FILE: - entry = new HashedFile(input); - break; - case DIR: - entry = new HashedDir(input); - break; - default: - throw new AssertionError("Unsupported hashed entry type: " + type.name()); - } + entry = switch (type) { + case FILE -> new HashedFile(input); + case DIR -> new HashedDir(input); + default -> throw new AssertionError("Unsupported hashed entry type: " + type.name()); + }; // Try add entry to map VerifyHelper.putIfAbsent(map, name, entry, String.format("Duplicate dir entry: '%s'", name)); diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/HInput.java b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/HInput.java index 9ee4e103..5b8161a7 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/HInput.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/core/serialize/HInput.java @@ -42,14 +42,11 @@ public BigInteger readBigInteger(int maxBytes) throws IOException { public boolean readBoolean() throws IOException { int b = readUnsignedByte(); - switch (b) { - case 0b0: - return false; - case 0b1: - return true; - default: - throw new IOException("Invalid boolean state: " + b); - } + return switch (b) { + case 0b0 -> false; + case 0b1 -> true; + default -> throw new IOException("Invalid boolean state: " + b); + }; } diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java index ccaeb8ea..1d5d7ac9 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java @@ -73,7 +73,7 @@ public static String[] parseCommand(CharSequence line) throws CommandException { throw new CommandException("Quotes wasn't closed"); // Empty args are ignored (except if was quoted) - if (wasQuoted || builder.length() > 0) + if (wasQuoted || !builder.isEmpty()) result.add(builder.toString()); // Reset file builder diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/FormatHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/FormatHelper.java index 9043f27d..a69e0f73 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/FormatHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/FormatHelper.java @@ -14,17 +14,12 @@ public class FormatHelper { public static Ansi rawAnsiFormat(LogHelper.Level level, String dateTime, boolean sub) { Ansi.Color levelColor; boolean bright = level != LogHelper.Level.DEBUG; - switch (level) { - case WARNING: - levelColor = Ansi.Color.YELLOW; - break; - case ERROR: - levelColor = Ansi.Color.RED; - break; - default: // INFO, DEBUG, Unknown - levelColor = Ansi.Color.WHITE; - break; - } + levelColor = switch (level) { + case WARNING -> Ansi.Color.YELLOW; + case ERROR -> Ansi.Color.RED; + default -> // INFO, DEBUG, Unknown + Ansi.Color.WHITE; + }; // Date-time Ansi ansi = new Ansi(); diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/HackHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/HackHelper.java index 8be8d890..21acd3d4 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/HackHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/HackHelper.java @@ -3,8 +3,6 @@ import java.lang.invoke.MethodHandles; import java.lang.reflect.Constructor; import java.lang.reflect.Field; -import java.util.Arrays; -import java.util.function.Consumer; public class HackHelper { private static native MethodHandles.Lookup createHackLookupNative(Class lookupClass); diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java index 4151dc98..0c8425de 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java @@ -138,17 +138,13 @@ public static String getIP(SocketAddress address) { } public static Path getRoot() { - switch (JVMHelper.OS_TYPE) { - case MUSTDIE: { + return switch (JVMHelper.OS_TYPE) { + case MUSTDIE -> { String drive = System.getenv("SystemDrive").concat("\\"); - return Paths.get(drive); + yield Paths.get(drive); } - case LINUX: - case MACOSX: { - return Paths.get("/"); - } - } - throw new UnsupportedOperationException(); + case LINUX, MACOSX -> Paths.get("/"); + }; } public static byte[] getResourceBytes(String name) throws IOException { @@ -545,19 +541,11 @@ public static void transfer(Path file, OutputStream output) throws IOException { } public static String urlDecode(String s) { - try { - return URLDecoder.decode(s, UNICODE_CHARSET.name()); - } catch (UnsupportedEncodingException e) { - throw new InternalError(e); - } + return URLDecoder.decode(s, UNICODE_CHARSET); } public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, UNICODE_CHARSET.name()); - } catch (UnsupportedEncodingException e) { - throw new InternalError(e); - } + return URLEncoder.encode(s, UNICODE_CHARSET); } public static String verifyFileName(String fileName) { diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java index d2779207..a7cdb354 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java @@ -62,26 +62,19 @@ public static int getBuild() { } public static String getNativeExtension(JVMHelper.OS OS_TYPE) { - switch (OS_TYPE) { - case MUSTDIE: - return ".dll"; - case LINUX: - return ".so"; - case MACOSX: - return ".dylib"; - default: - throw new InternalError(String.format("Unsupported OS TYPE '%s'", OS_TYPE)); - } + return switch (OS_TYPE) { + case MUSTDIE -> ".dll"; + case LINUX -> ".so"; + case MACOSX -> ".dylib"; + default -> throw new InternalError(String.format("Unsupported OS TYPE '%s'", OS_TYPE)); + }; } public static String getNativePrefix(JVMHelper.OS OS_TYPE) { - switch (OS_TYPE) { - case LINUX: - case MACOSX: - return "lib"; - default: - return ""; - } + return switch (OS_TYPE) { + case LINUX, MACOSX -> "lib"; + default -> ""; + }; } public static void appendVars(ProcessBuilder builder, Map vars) { diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java index a4d1f58f..2bfb54cf 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java @@ -13,15 +13,7 @@ public class JavaHelper { public static final List javaFxModules; static { - List modules = new ArrayList<>(); - modules.add("javafx.base"); - modules.add("javafx.graphics"); - modules.add("javafx.fxml"); - modules.add("javafx.controls"); - modules.add("javafx.swing"); - modules.add("javafx.media"); - modules.add("javafx.web"); - javaFxModules = Collections.unmodifiableList(modules); + javaFxModules = List.of("javafx.base", "javafx.graphics", "javafx.fxml", "javafx.controls", "javafx.swing", "javafx.media", "javafx.web"); } public static Path tryGetOpenJFXPath(Path jvmDir) { @@ -60,7 +52,7 @@ public static boolean tryAddModule(List paths, String moduleName, StringBu if (path == null) continue; Path result = tryFindModule(path, moduleName); if (result != null) { - if (args.length() != 0) args.append(File.pathSeparatorChar); + if (!args.isEmpty()) args.append(File.pathSeparatorChar); args.append(result.toAbsolutePath()); return true; } diff --git a/LauncherModernCore/src/main/java/pro/gravit/launcher/modern/Downloader.java b/LauncherModernCore/src/main/java/pro/gravit/launcher/modern/Downloader.java index 9ab8fae7..1d7e052d 100644 --- a/LauncherModernCore/src/main/java/pro/gravit/launcher/modern/Downloader.java +++ b/LauncherModernCore/src/main/java/pro/gravit/launcher/modern/Downloader.java @@ -78,9 +78,7 @@ public static Downloader downloadFile(URI uri, Path path, ExecutorService execut downloader.future = downloader.downloadFile(uri, path); if (closeExecutor) { ExecutorService finalExecutor = executor; - downloader.future = downloader.future.thenAccept((e) -> { - finalExecutor.shutdownNow(); - }).exceptionallyCompose((ex) -> { + downloader.future = downloader.future.thenAccept((e) -> finalExecutor.shutdownNow()).exceptionallyCompose((ex) -> { finalExecutor.shutdownNow(); return CompletableFuture.failedFuture(ex); }); @@ -99,9 +97,7 @@ public static Downloader downloadList(List files, String baseURL, Pat downloader.future = downloader.downloadFiles(files, baseURL, targetDir, callback, executor, threads); if (closeExecutor) { ExecutorService finalExecutor = executor; - downloader.future = downloader.future.thenAccept((e) -> { - finalExecutor.shutdownNow(); - }).exceptionallyCompose((ex) -> { + downloader.future = downloader.future.thenAccept((e) -> finalExecutor.shutdownNow()).exceptionallyCompose((ex) -> { finalExecutor.shutdownNow(); return CompletableFuture.failedFuture(ex); }); diff --git a/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java b/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java index 597d086b..8f5a350c 100644 --- a/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java +++ b/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java @@ -34,7 +34,7 @@ public List getModules() { } @Override - public final boolean verifyClassCheckResult(LauncherTrustManager.CheckClassResult result) { + public boolean verifyClassCheckResult(LauncherTrustManager.CheckClassResult result) { return result.type == LauncherTrustManager.CheckClassResultType.SUCCESS; } 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 596dfdf2..77faaa45 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java @@ -122,8 +122,7 @@ public void run(String... args) throws Throwable { LogHelper.debug("Read ServerWrapperConfig.json"); loadConfig(); updateLauncherConfig(); - if (config.env != null) Launcher.applyLauncherEnv(config.env); - else Launcher.applyLauncherEnv(LauncherConfig.LauncherEnvironment.STD); + Launcher.applyLauncherEnv(Objects.requireNonNullElse(config.env, LauncherConfig.LauncherEnvironment.STD)); StdWebSocketService service = StdWebSocketService.initWebSockets(config.address).get(); service.reconnectCallback = () -> { @@ -153,7 +152,7 @@ public void run(String... args) throws Throwable { KeyService.serverEcPublicKey = SecurityHelper.toPublicECDSAKey(config.encodedServerEcPublicKey); } String classname = (config.mainclass == null || config.mainclass.isEmpty()) ? args[0] : config.mainclass; - if (classname.length() == 0) { + if (classname.isEmpty()) { LogHelper.error("MainClass not found. Please set MainClass for ServerWrapper.json or first commandline argument"); System.exit(-1); } @@ -174,7 +173,7 @@ public void run(String... args) throws Throwable { LogHelper.info("ServerWrapper: LaunchServer address: %s. Title: %s", config.address, Launcher.profile != null ? Launcher.profile.getTitle() : "unknown"); LogHelper.info("Minecraft Version (for profile): %s", wrapper.profile == null ? "unknown" : wrapper.profile.getVersion().toString()); String[] real_args; - if(config.args != null && config.args.size() > 0) { + if(config.args != null && !config.args.isEmpty()) { real_args = config.args.toArray(new String[0]); } else if (args.length > 0) { real_args = new String[args.length - 1]; 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 index aa6fdbef..3cdf6d22 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/InstallAuthlib.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/authlib/InstallAuthlib.java @@ -41,10 +41,10 @@ public void run(String... args) throws Exception { } context.workdir = IOHelper.WORKING_DIR; LogHelper.info("Search .jar files in %s", context.workdir.toAbsolutePath()); - IOHelper.walk(context.workdir, new SimpleFileVisitor() { + IOHelper.walk(context.workdir, new SimpleFileVisitor<>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { - if(file.getFileName().toString().endsWith(".jar")) { + if (file.getFileName().toString().endsWith(".jar")) { context.files.add(file); } return FileVisitResult.CONTINUE; From 4607ab88bf983f856b97a48bd0e265d287c6941a Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sat, 23 Dec 2023 12:25:55 +0700 Subject: [PATCH 06/23] [ANY] Update modules --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 7f4eb168..9b1740cc 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 7f4eb1684725565d161beeeda093f5964ab550ca +Subproject commit 9b1740ccc426de8a8ac332545c64afbe9c17f89f From 64635cbb9bf9f384e190d133eec67d4531475f30 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sat, 23 Dec 2023 17:58:09 +0700 Subject: [PATCH 07/23] [REFACTOR] Renaming --- LaunchServer/build.gradle | 1 - .../gravit/launchserver/HttpRequester.java | 2 +- .../pro/gravit/launchserver/LaunchServer.java | 11 +- .../launchserver/LaunchServerStarter.java | 12 +- .../java/pro/gravit/launchserver/Main.java | 26 +++ .../launchserver/auth/AuthException.java | 2 +- .../auth/core/AbstractSQLCoreProvider.java | 6 +- .../auth/core/AuthCoreProvider.java | 12 +- .../auth/core/MemoryAuthCoreProvider.java | 8 +- .../auth/core/MergeAuthCoreProvider.java | 2 +- .../auth/core/MySQLCoreProvider.java | 4 +- .../auth/core/RejectAuthCoreProvider.java | 2 +- .../gravit/launchserver/auth/core/User.java | 2 +- .../auth/core/interfaces/UserHardware.java | 2 +- .../provider/AuthSupportAssetUpload.java | 6 +- .../provider/AuthSupportHardware.java | 2 +- .../provider/AuthSupportRegistration.java | 2 +- .../interfaces/user/UserSupportTextures.java | 4 +- .../auth/mix/UploadAssetMixProvider.java | 2 +- .../auth/password/JsonPasswordVerifier.java | 2 +- .../auth/protect/AdvancedProtectHandler.java | 6 +- .../auth/protect/StdProtectHandler.java | 2 +- .../interfaces/ProfilesProtectHandler.java | 2 +- .../interfaces/SecureProtectHandler.java | 6 +- .../auth/texture/JsonTextureProvider.java | 2 +- .../auth/texture/NullTextureProvider.java | 2 +- .../auth/texture/RequestTextureProvider.java | 4 +- .../auth/texture/TextureProvider.java | 2 +- .../auth/texture/VoidTextureProvider.java | 2 +- .../launchserver/binary/BuildContext.java | 2 +- .../binary/JARLauncherBinary.java | 2 +- .../binary/tasks/MainBuildTask.java | 4 +- .../gravit/launchserver/command/Command.java | 6 +- .../command/hash/DownloadAssetCommand.java | 4 +- .../command/hash/DownloadClientCommand.java | 6 +- .../command/hash/IndexAssetCommand.java | 2 +- .../command/hash/MakeProfileCommand.java | 4 +- .../command/hash/SaveProfilesCommand.java | 4 +- .../command/modules/ModulesCommand.java | 4 +- .../command/service/ComponentCommand.java | 2 +- .../command/service/NotifyCommand.java | 4 +- .../command/service/SecurityCheckCommand.java | 2 +- .../command/service/TokenCommand.java | 2 +- .../config/LaunchServerConfig.java | 4 +- .../launchserver/helper/HttpHelper.java | 4 +- .../helper/MakeProfileHelper.java | 14 +- .../launchermodules/LauncherModuleLoader.java | 2 +- .../launchserver/manangers/AuthManager.java | 12 +- .../manangers}/ConfigManager.java | 4 +- .../manangers/LaunchServerGsonManager.java | 18 +- .../launchserver/manangers/MirrorManager.java | 2 +- .../events/LaunchServerFullInitEvent.java | 2 +- .../modules/events/LaunchServerInitPhase.java | 2 +- .../events/LaunchServerLauncherExeInit.java | 2 +- .../LaunchServerNettyFullInitEvent.java | 2 +- .../events/LaunchServerPostInitPhase.java | 2 +- .../events/LaunchServerProfilesSyncEvent.java | 2 +- .../events/LaunchServerUpdatesSyncEvent.java | 2 +- .../events/NewLaunchServerInstanceEvent.java | 2 +- .../security/SecurityReportModuleEvent.java | 4 +- .../modules/impl/LaunchServerCoreModule.java | 8 +- .../modules/impl/LaunchServerInitContext.java | 2 +- .../impl/LaunchServerModulesManager.java | 4 +- .../gravit/launchserver/socket/Client.java | 4 +- .../launchserver/socket/WebSocketService.java | 10 +- .../socket/handlers/NettyWebAPIHandler.java | 2 +- .../socket/response/SimpleResponse.java | 4 +- .../response/WebSocketServerResponse.java | 2 +- .../response/auth/AdditionalDataResponse.java | 2 +- .../socket/response/auth/AuthResponse.java | 4 +- .../response/auth/CheckServerResponse.java | 2 +- .../response/auth/CurrentUserResponse.java | 2 +- .../socket/response/auth/ExitResponse.java | 4 +- .../auth/FetchClientProfileKeyResponse.java | 2 +- .../auth/GetAvailabilityAuthResponse.java | 2 +- .../response/auth/JoinServerResponse.java | 2 +- .../response/auth/ProfilesResponse.java | 4 +- .../response/auth/RefreshTokenResponse.java | 4 +- .../socket/response/auth/RestoreResponse.java | 6 +- .../response/auth/SetProfileResponse.java | 4 +- .../cabinet/GetAssetUploadInfoResponse.java | 2 +- .../response/management/FeaturesResponse.java | 2 +- .../management/GetPublicKeyResponse.java | 2 +- .../profile/BatchProfileByUsername.java | 4 +- .../profile/ProfileByUUIDResponse.java | 2 +- .../response/profile/ProfileByUsername.java | 4 +- .../secure/GetSecureLevelInfoResponse.java | 2 +- .../secure/HardwareReportResponse.java | 4 +- .../secure/SecurityReportResponse.java | 2 +- .../response/update/LauncherResponse.java | 2 +- .../response/update/UpdateListResponse.java | 2 +- .../response/update/UpdateResponse.java | 2 +- .../gravit/launchserver/defaults/proguard.cfg | 4 +- .../launchserver/ConfigurationTest.java | 2 +- .../launchserver/StartLaunchServerTest.java | 2 +- Launcher/build.gradle | 6 +- .../{client => }/runtime/LauncherEngine.java | 51 +++--- .../runtime/LauncherEngineWrapper.java | 2 +- .../runtime/NewLauncherSettings.java | 4 +- .../runtime/client/ClientLauncherProcess.java | 30 ++-- .../launcher}/runtime/client/DirBridge.java | 4 +- .../runtime/client/RuntimeGsonManager.java | 6 +- .../runtime/client/ServerPinger.java | 6 +- .../runtime/client/UserSettings.java | 2 +- .../client/events/ClientEngineInitPhase.java | 6 +- .../runtime/client/events/ClientGuiPhase.java | 6 +- .../client/events/ClientPreGuiPhase.java | 6 +- .../ClientProcessBuilderCreateEvent.java | 6 +- .../ClientProcessBuilderLaunchedEvent.java | 6 +- ...lientProcessBuilderParamsWrittedEvent.java | 6 +- .../ClientProcessBuilderPreLaunchEvent.java | 6 +- .../runtime/console/GetPublicKeyCommand.java | 4 +- .../runtime/console/ModulesCommand.java | 10 +- .../runtime/console/SignDataCommand.java | 4 +- .../runtime/console/UnlockCommand.java | 6 +- .../test/PrintHardwareInfoCommand.java | 4 +- .../runtime/debug/ClientRuntimeProvider.java | 26 +-- .../debug/DebugLauncherTrustManager.java | 2 +- .../{client => }/runtime/debug/DebugMain.java | 26 +-- .../runtime/gui/NoRuntimeProvider.java | 2 +- .../runtime/gui/RuntimeProvider.java | 2 +- .../runtime/managers/ConsoleManager.java | 12 +- .../runtime/managers/SettingsManager.java | 8 +- .../runtime/utils/HWIDProvider.java | 4 +- .../runtime/utils/LauncherUpdater.java | 8 +- LauncherAPI/build.gradle | 1 - .../{ => base}/ClientPermissions.java | 2 +- .../pro/gravit/launcher/base}/Downloader.java | 2 +- .../gravit/launcher/{ => base}/Launcher.java | 4 +- .../launcher/{ => base}/LauncherConfig.java | 6 +- .../{client => base}/api/AuthService.java | 6 +- .../{client => base}/api/ClientService.java | 2 +- .../{client => base}/api/ConfigService.java | 2 +- .../{client => base}/api/KeyService.java | 2 +- .../{ => base}/config/JsonConfigurable.java | 2 +- .../config/JsonConfigurableInterface.java | 4 +- .../{ => base}/config/SimpleConfig.java | 2 +- .../{ => base}/config/SimpleConfigurable.java | 2 +- .../events/ExtendedTokenRequestEvent.java | 2 +- .../{ => base}/events/NotificationEvent.java | 4 +- .../{ => base}/events/RequestEvent.java | 4 +- .../request/AdditionalDataRequestEvent.java | 4 +- .../request/AssetUploadInfoRequestEvent.java | 4 +- .../events/request/AuthRequestEvent.java | 8 +- .../BatchProfileByUsernameRequestEvent.java | 6 +- .../request/CheckServerRequestEvent.java | 6 +- .../request/CurrentUserRequestEvent.java | 8 +- .../events/request/ErrorRequestEvent.java | 4 +- .../events/request/ExitRequestEvent.java | 4 +- .../events/request/FeaturesRequestEvent.java | 4 +- .../FetchClientProfileKeyRequestEvent.java | 4 +- .../GetAssetUploadUrlRequestEvent.java | 4 +- .../GetAvailabilityAuthRequestEvent.java | 4 +- .../request/GetPublicKeyRequestEvent.java | 4 +- .../GetSecureLevelInfoRequestEvent.java | 4 +- .../request/HardwareReportRequestEvent.java | 6 +- .../request/JoinServerRequestEvent.java | 4 +- .../events/request/LauncherRequestEvent.java | 6 +- .../request/ProfileByUUIDRequestEvent.java | 6 +- .../ProfileByUsernameRequestEvent.java | 6 +- .../events/request/ProfilesRequestEvent.java | 6 +- .../request/RefreshTokenRequestEvent.java | 4 +- .../events/request/RestoreRequestEvent.java | 4 +- .../request/SecurityReportRequestEvent.java | 4 +- .../request/SetProfileRequestEvent.java | 6 +- .../request/UpdateListRequestEvent.java | 4 +- .../events/request/UpdateRequestEvent.java | 4 +- .../VerifySecureLevelKeyRequestEvent.java | 6 +- .../modules/LauncherInitContext.java | 2 +- .../{ => base}/modules/LauncherModule.java | 2 +- .../modules/LauncherModuleInfo.java | 2 +- .../modules/LauncherModulesContext.java | 2 +- .../modules/LauncherModulesManager.java | 2 +- .../modules/ModulesConfigManager.java | 4 +- .../base/modules/events/ClosePhase.java | 6 + .../base/modules/events/InitPhase.java | 6 + .../modules/events/OfflineModeEvent.java | 6 +- .../base/modules/events/PostInitPhase.java | 6 + .../base/modules/events/PreConfigPhase.java | 6 + .../modules/events/PreGsonPhase.java | 4 +- .../modules/impl/SimpleModuleContext.java | 8 +- .../modules/impl/SimpleModuleManager.java | 5 +- .../impl}/SimpleModulesConfigManager.java | 6 +- .../{ => base}/profiles/ClientProfile.java | 8 +- .../profiles/ClientProfileBuilder.java | 4 +- .../profiles/ClientProfileVersions.java | 2 +- .../{ => base}/profiles/PlayerProfile.java | 2 +- .../launcher/{ => base}/profiles/Texture.java | 2 +- .../profiles/optional/OptionalDepend.java | 2 +- .../profiles/optional/OptionalFile.java | 6 +- .../profiles/optional/OptionalView.java | 6 +- .../optional/actions/OptionalAction.java | 2 +- .../actions/OptionalActionClassPath.java | 2 +- .../actions/OptionalActionClientArgs.java | 2 +- .../optional/actions/OptionalActionFile.java | 2 +- .../actions/OptionalActionJvmArgs.java | 2 +- .../optional/triggers/ArchTrigger.java | 4 +- .../optional/triggers/JavaTrigger.java | 4 +- .../profiles/optional/triggers/OSTrigger.java | 4 +- .../optional/triggers/OptionalTrigger.java | 4 +- .../triggers/OptionalTriggerContext.java | 8 +- .../request/JsonResultSerializeAdapter.java | 2 +- .../{ => base}/request/PingRequest.java | 2 +- .../launcher/{ => base}/request/Request.java | 18 +- .../{ => base}/request/RequestException.java | 2 +- .../{ => base}/request/RequestService.java | 2 +- .../{ => base}/request/WebSocketEvent.java | 2 +- .../request/auth/AdditionalDataRequest.java | 6 +- .../{ => base}/request/auth/AuthRequest.java | 10 +- .../request/auth/CheckServerRequest.java | 8 +- .../base/request/auth/CurrentUserRequest.java | 11 ++ .../{ => base}/request/auth/ExitRequest.java | 6 +- .../auth/FetchClientProfileKeyRequest.java | 6 +- .../auth/GetAvailabilityAuthRequest.java | 16 +- .../request/auth/GetPublicKeyRequest.java | 6 +- .../request/auth/JoinServerRequest.java | 8 +- .../request/auth/RefreshTokenRequest.java | 6 +- .../request/auth/RestoreRequest.java | 6 +- .../request/auth/SetProfileRequest.java | 10 +- .../auth/details/AuthLoginOnlyDetails.java | 4 +- .../auth/details/AuthPasswordDetails.java | 4 +- .../request/auth/details/AuthTotpDetails.java | 4 +- .../auth/details/AuthWebViewDetails.java | 4 +- .../auth/password/Auth2FAPassword.java | 4 +- .../auth/password/AuthAESPassword.java | 4 +- .../auth/password/AuthCodePassword.java | 4 +- .../auth/password/AuthMultiPassword.java | 4 +- .../auth/password/AuthOAuthPassword.java | 4 +- .../auth/password/AuthPlainPassword.java | 4 +- .../auth/password/AuthRSAPassword.java | 4 +- .../auth/password/AuthSignaturePassword.java | 4 +- .../auth/password/AuthTOTPPassword.java | 4 +- .../cabinet/AssetUploadInfoRequest.java | 11 ++ .../request/cabinet/GetAssetUploadUrl.java | 6 +- .../request/management/FeaturesRequest.java | 11 ++ .../secure/GetSecureLevelInfoRequest.java | 6 +- .../request/secure/HardwareReportRequest.java | 6 +- .../request/secure/SecurityReportRequest.java | 6 +- .../secure/VerifySecureLevelKeyRequest.java | 6 +- .../request/update/LauncherRequest.java | 12 +- .../base/request/update/ProfilesRequest.java | 13 ++ .../request/update/UpdateListRequest.java | 13 ++ .../request/update/UpdateRequest.java | 8 +- .../uuid/BatchProfileByUsernameRequest.java | 8 +- .../request/uuid/ProfileByUUIDRequest.java | 8 +- .../uuid/ProfileByUsernameRequest.java | 8 +- .../request/websockets/ClientJSONPoint.java | 112 +++++++++++++ .../websockets/ClientWebSocketService.java | 30 ++-- .../websockets/OfflineRequestService.java | 12 +- .../websockets/StdWebSocketService.java | 14 +- .../websockets/VoidRequestService.java | 10 +- .../request/websockets/WebSocketRequest.java | 2 +- .../launcher/modules/events/ClosePhase.java | 6 - .../launcher/modules/events/InitPhase.java | 6 - .../modules/events/PostInitPhase.java | 6 - .../modules/events/PreConfigPhase.java | 6 - .../request/auth/CurrentUserRequest.java | 11 -- .../cabinet/AssetUploadInfoRequest.java | 11 -- .../request/management/FeaturesRequest.java | 11 -- .../request/update/ProfilesRequest.java | 13 -- .../request/update/UpdateListRequest.java | 13 -- .../request/websockets/ClientJSONPoint.java | 155 ------------------ .../websockets/WebSocketClientHandler.java | 89 ---------- .../gravit/launcher/ClientVersionTest.java | 2 +- .../java/pro/gravit/launcher/ModulesTest.java | 4 +- .../pro/gravit/launcher/PermissionTest.java | 1 + .../launcher/impl/Cyclic2DependModule.java | 6 +- .../launcher/impl/CyclicDependModule.java | 6 +- .../gravit/launcher/impl/Depend1Module.java | 6 +- .../gravit/launcher/impl/Depend2Module.java | 6 +- .../gravit/launcher/impl/Depend3Module.java | 6 +- .../gravit/launcher/impl/InternalModule.java | 6 +- .../pro/gravit/launcher/impl/MainModule.java | 6 +- .../gravit/launcher/impl/ProvidedModule.java | 6 +- .../pro/gravit/launcher/impl/TestModule.java | 6 +- .../launcher/impl/event/CancelEvent.java | 2 +- .../launcher/impl/event/NormalEvent.java | 2 +- .../client/BasicLauncherEventHandler.java | 12 +- .../client => }/ClientGsonManager.java | 6 +- .../client => }/ClientLauncherCoreModule.java | 8 +- .../client => }/ClientLauncherEntryPoint.java | 38 ++--- .../client/ClientLauncherMethods.java | 42 +++-- .../client => }/ClientModuleManager.java | 8 +- .../{runtime/client => }/ClientParams.java | 18 +- .../gravit/launcher/client/LauncherAgent.java | 2 +- .../client/RuntimeLauncherCoreModule.java | 8 +- .../client/api/CertificateService.java | 2 +- .../launcher/client/api/DialogService.java | 2 +- .../client => }/events/ClientExitPhase.java | 4 +- .../ClientProcessClassLoaderEvent.java | 6 +- .../ClientProcessInitPhase.java | 6 +- .../ClientProcessLaunchEvent.java | 6 +- .../ClientProcessPreInvokeMainClassEvent.java | 8 +- .../ClientProcessReadyEvent.java | 6 +- .../events/ClientUnlockConsoleEvent.java | 4 +- .../{runtime => }/utils/ApiBridgeService.java | 4 +- .../{runtime => }/utils/DirWatcher.java | 2 +- .../{runtime => }/utils/NativeJVMHalt.java | 2 +- .../launcher/start/ClientLauncherWrapper.java | 12 +- .../launcher/start/RuntimeModuleManager.java | 6 +- .../gravit/launcher/server/ServerWrapper.java | 34 ++-- .../server/ServerWrapperGsonManager.java | 2 +- .../server/setup/ServerWrapperSetup.java | 12 +- build.gradle | 2 +- modules | 2 +- settings.gradle | 1 - 306 files changed, 989 insertions(+), 1112 deletions(-) rename {LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers => LaunchServer/src/main/java/pro/gravit/launchserver/manangers}/ConfigManager.java (93%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/LauncherEngine.java (86%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/LauncherEngineWrapper.java (97%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/NewLauncherSettings.java (73%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/client/ClientLauncherProcess.java (91%) rename {LauncherClient/src/main/java/pro/gravit/launcher/client => Launcher/src/main/java/pro/gravit/launcher}/runtime/client/DirBridge.java (97%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/client/RuntimeGsonManager.java (81%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/client/ServerPinger.java (98%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/client/UserSettings.java (74%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/client/events/ClientEngineInitPhase.java (53%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/client/events/ClientGuiPhase.java (57%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/client/events/ClientPreGuiPhase.java (57%) rename Launcher/src/main/java/pro/gravit/launcher/{client/runtime/client/events/client => runtime/client/events}/ClientProcessBuilderCreateEvent.java (59%) rename Launcher/src/main/java/pro/gravit/launcher/{client/runtime/client/events/client => runtime/client/events}/ClientProcessBuilderLaunchedEvent.java (59%) rename Launcher/src/main/java/pro/gravit/launcher/{client/runtime/client/events/client => runtime/client/events}/ClientProcessBuilderParamsWrittedEvent.java (57%) rename Launcher/src/main/java/pro/gravit/launcher/{client/runtime/client/events/client => runtime/client/events}/ClientProcessBuilderPreLaunchEvent.java (59%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/console/GetPublicKeyCommand.java (86%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/console/ModulesCommand.java (86%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/console/SignDataCommand.java (88%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/console/UnlockCommand.java (82%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/console/test/PrintHardwareInfoCommand.java (95%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/debug/ClientRuntimeProvider.java (91%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/debug/DebugLauncherTrustManager.java (94%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/debug/DebugMain.java (84%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/gui/NoRuntimeProvider.java (89%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/gui/RuntimeProvider.java (72%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/managers/ConsoleManager.java (85%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/managers/SettingsManager.java (79%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/utils/HWIDProvider.java (96%) rename Launcher/src/main/java/pro/gravit/launcher/{client => }/runtime/utils/LauncherUpdater.java (92%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/ClientPermissions.java (99%) rename {LauncherModernCore/src/main/java/pro/gravit/launcher/modern => LauncherAPI/src/main/java/pro/gravit/launcher/base}/Downloader.java (99%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/Launcher.java (97%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/LauncherConfig.java (97%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{client => base}/api/AuthService.java (80%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{client => base}/api/ClientService.java (93%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{client => base}/api/ConfigService.java (88%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{client => base}/api/KeyService.java (84%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/config/JsonConfigurable.java (93%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/config/JsonConfigurableInterface.java (96%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/config/SimpleConfig.java (96%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/config/SimpleConfigurable.java (95%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/ExtendedTokenRequestEvent.java (78%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/NotificationEvent.java (89%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/RequestEvent.java (81%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/AdditionalDataRequestEvent.java (77%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/AssetUploadInfoRequestEvent.java (83%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/AuthRequestEvent.java (93%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/BatchProfileByUsernameRequestEvent.java (76%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/CheckServerRequestEvent.java (83%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/CurrentUserRequestEvent.java (68%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/ErrorRequestEvent.java (80%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/ExitRequestEvent.java (76%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/FeaturesRequestEvent.java (77%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/FetchClientProfileKeyRequestEvent.java (91%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/GetAssetUploadUrlRequestEvent.java (83%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/GetAvailabilityAuthRequestEvent.java (94%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/GetPublicKeyRequestEvent.java (87%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/GetSecureLevelInfoRequestEvent.java (83%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/HardwareReportRequestEvent.java (81%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/JoinServerRequestEvent.java (82%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/LauncherRequestEvent.java (91%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/ProfileByUUIDRequestEvent.java (80%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/ProfileByUsernameRequestEvent.java (79%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/ProfilesRequestEvent.java (78%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/RefreshTokenRequestEvent.java (75%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/RestoreRequestEvent.java (87%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/SecurityReportRequestEvent.java (88%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/SetProfileRequestEvent.java (76%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/UpdateListRequestEvent.java (83%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/UpdateRequestEvent.java (89%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/events/request/VerifySecureLevelKeyRequestEvent.java (86%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/modules/LauncherInitContext.java (50%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/modules/LauncherModule.java (99%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/modules/LauncherModuleInfo.java (97%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/modules/LauncherModulesContext.java (77%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/modules/LauncherModulesManager.java (97%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/modules/ModulesConfigManager.java (87%) create mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/ClosePhase.java create mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/InitPhase.java rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/modules/events/OfflineModeEvent.java (54%) create mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/PostInitPhase.java create mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/PreConfigPhase.java rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/modules/events/PreGsonPhase.java (69%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/modules/impl/SimpleModuleContext.java (71%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/modules/impl/SimpleModuleManager.java (98%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{client/runtime/managers => base/modules/impl}/SimpleModulesConfigManager.java (87%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/ClientProfile.java (98%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/ClientProfileBuilder.java (98%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/ClientProfileVersions.java (97%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/PlayerProfile.java (97%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/Texture.java (98%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/OptionalDepend.java (72%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/OptionalFile.java (87%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/OptionalView.java (97%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/actions/OptionalAction.java (91%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/actions/OptionalActionClassPath.java (87%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/actions/OptionalActionClientArgs.java (81%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/actions/OptionalActionFile.java (95%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/actions/OptionalActionJvmArgs.java (80%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/triggers/ArchTrigger.java (70%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/triggers/JavaTrigger.java (89%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/triggers/OSTrigger.java (73%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/triggers/OptionalTrigger.java (88%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/profiles/optional/triggers/OptionalTriggerContext.java (62%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/JsonResultSerializeAdapter.java (93%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/PingRequest.java (76%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/Request.java (94%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/RequestException.java (92%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/RequestService.java (96%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/WebSocketEvent.java (83%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/AdditionalDataRequest.java (70%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/AuthRequest.java (88%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/CheckServerRequest.java (80%) create mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/CurrentUserRequest.java rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/ExitRequest.java (77%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/FetchClientProfileKeyRequest.java (56%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/GetAvailabilityAuthRequest.java (61%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/GetPublicKeyRequest.java (54%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/JoinServerRequest.java (81%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/RefreshTokenRequest.java (68%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/RestoreRequest.java (78%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/SetProfileRequest.java (57%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/details/AuthLoginOnlyDetails.java (57%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/details/AuthPasswordDetails.java (57%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/details/AuthTotpDetails.java (77%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/details/AuthWebViewDetails.java (85%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/password/Auth2FAPassword.java (81%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/password/AuthAESPassword.java (76%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/password/AuthCodePassword.java (69%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/password/AuthMultiPassword.java (79%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/password/AuthOAuthPassword.java (87%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/password/AuthPlainPassword.java (75%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/password/AuthRSAPassword.java (72%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/password/AuthSignaturePassword.java (78%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/auth/password/AuthTOTPPassword.java (60%) create mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/base/request/cabinet/AssetUploadInfoRequest.java rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/cabinet/GetAssetUploadUrl.java (63%) create mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/base/request/management/FeaturesRequest.java rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/secure/GetSecureLevelInfoRequest.java (50%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/secure/HardwareReportRequest.java (89%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/secure/SecurityReportRequest.java (93%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/secure/VerifySecureLevelKeyRequest.java (69%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/update/LauncherRequest.java (80%) create mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/ProfilesRequest.java create mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/UpdateListRequest.java rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/update/UpdateRequest.java (62%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/uuid/BatchProfileByUsernameRequest.java (79%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/uuid/ProfileByUUIDRequest.java (66%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/uuid/ProfileByUsernameRequest.java (63%) create mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/websockets/ClientWebSocketService.java (85%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/websockets/OfflineRequestService.java (88%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/websockets/StdWebSocketService.java (92%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/websockets/VoidRequestService.java (76%) rename LauncherAPI/src/main/java/pro/gravit/launcher/{ => base}/request/websockets/WebSocketRequest.java (72%) delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/ClosePhase.java delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/InitPhase.java delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/PostInitPhase.java delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/PreConfigPhase.java delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/CurrentUserRequest.java delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/request/cabinet/AssetUploadInfoRequest.java delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/request/management/FeaturesRequest.java delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/request/update/ProfilesRequest.java delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/request/update/UpdateListRequest.java delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/WebSocketClientHandler.java rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime/client => }/ClientGsonManager.java (75%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime/client => }/ClientLauncherCoreModule.java (59%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime/client => }/ClientLauncherEntryPoint.java (93%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime/client => }/ClientModuleManager.java (82%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime/client => }/ClientParams.java (88%) rename {Launcher/src/main/java/pro/gravit/launcher/client/runtime => LauncherClient/src/main/java/pro/gravit/launcher}/client/RuntimeLauncherCoreModule.java (59%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime/client => }/events/ClientExitPhase.java (57%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime/client/events/client => events}/ClientProcessClassLoaderEvent.java (76%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime/client/events/client => events}/ClientProcessInitPhase.java (51%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime/client/events/client => events}/ClientProcessLaunchEvent.java (53%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime/client/events/client => events}/ClientProcessPreInvokeMainClassEvent.java (66%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime/client/events/client => events}/ClientProcessReadyEvent.java (51%) rename {Launcher/src/main/java/pro/gravit/launcher/client/runtime => LauncherClient/src/main/java/pro/gravit/launcher}/client/events/ClientUnlockConsoleEvent.java (70%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime => }/utils/ApiBridgeService.java (88%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime => }/utils/DirWatcher.java (98%) rename LauncherClient/src/main/java/pro/gravit/launcher/client/{runtime => }/utils/NativeJVMHalt.java (94%) diff --git a/LaunchServer/build.gradle b/LaunchServer/build.gradle index 57742ddd..1439c426 100644 --- a/LaunchServer/build.gradle +++ b/LaunchServer/build.gradle @@ -73,7 +73,6 @@ dependencies { pack project(':LauncherAPI') - pack project(':LauncherModernCore') bundle group: 'me.tongfei', name: 'progressbar', version: '0.9.2' bundle group: 'com.github.Marcono1234', name: 'gson-record-type-adapter-factory', version: 'v0.2.0' bundle group: 'org.fusesource.jansi', name: 'jansi', version: rootProject['verJansi'] diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java b/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java index 9bac27ff..fac90dfb 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver; import com.google.gson.JsonElement; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launchserver.helper.HttpHelper; import java.io.IOException; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java index 3482f317..17264082 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java @@ -2,12 +2,11 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.events.request.ProfilesRequestEvent; -import pro.gravit.launcher.client.runtime.managers.ConfigManager; -import pro.gravit.launcher.modules.events.ClosePhase; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.events.request.ProfilesRequestEvent; +import pro.gravit.launcher.base.modules.events.ClosePhase; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.core.RejectAuthCoreProvider; import pro.gravit.launchserver.binary.EXEL4JLauncherBinary; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java index e7b93168..865cd674 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServerStarter.java @@ -3,13 +3,13 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bouncycastle.jce.provider.BouncyCastleProvider; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launcher.core.LauncherTrustManager; -import pro.gravit.launcher.modules.events.PreConfigPhase; -import pro.gravit.launcher.profiles.optional.actions.OptionalAction; -import pro.gravit.launcher.profiles.optional.triggers.OptionalTrigger; -import pro.gravit.launcher.request.auth.AuthRequest; -import pro.gravit.launcher.request.auth.GetAvailabilityAuthRequest; +import pro.gravit.launcher.base.modules.events.PreConfigPhase; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalAction; +import pro.gravit.launcher.base.profiles.optional.triggers.OptionalTrigger; +import pro.gravit.launcher.base.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.GetAvailabilityAuthRequest; import pro.gravit.launchserver.auth.core.AuthCoreProvider; import pro.gravit.launchserver.auth.mix.MixProvider; import pro.gravit.launchserver.auth.password.PasswordVerifier; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/Main.java b/LaunchServer/src/main/java/pro/gravit/launchserver/Main.java index 58f90497..8026ddb2 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/Main.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/Main.java @@ -5,6 +5,10 @@ import pro.gravit.utils.launch.LaunchOptions; import pro.gravit.utils.launch.ModuleLaunch; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; import java.nio.file.FileVisitOption; import java.nio.file.Files; import java.nio.file.Path; @@ -15,6 +19,7 @@ public class Main { private static final List classpathOnly = List.of("proguard", "jline", "kotlin", "epoll"); + private static final String LOG4J_PROPERTY = "log4j2.configurationFile"; private static boolean isClasspathOnly(Path path) { var fileName = path.getFileName().toString(); for(var e : classpathOnly) { @@ -25,7 +30,28 @@ private static boolean isClasspathOnly(Path path) { return false; } + private static void unpackLog4j() { + String log4jConfigurationFile = System.getProperty(LOG4J_PROPERTY); + if(log4jConfigurationFile == null) { + Path log4jConfigPath = Path.of("log4j2.xml"); + if(!Files.exists(log4jConfigPath)) { + try(FileOutputStream output = new FileOutputStream(log4jConfigPath.toFile())) { + try(InputStream input = Main.class.getResourceAsStream("log4j2.xml")) { + if(input == null) { + return; + } + input.transferTo(output); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + System.setProperty(LOG4J_PROPERTY, log4jConfigPath.toAbsolutePath().toString()); + } + } + public static void main(String[] args) throws Throwable { + unpackLog4j(); ModuleLaunch launch = new ModuleLaunch(); LaunchOptions options = new LaunchOptions(); options.disablePackageDelegateSupport = true; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthException.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthException.java index 0fb5c766..e30f9842 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthException.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthException.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.auth; -import pro.gravit.launcher.events.request.AuthRequestEvent; +import pro.gravit.launcher.base.events.request.AuthRequestEvent; import java.io.IOException; import java.io.Serial; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AbstractSQLCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AbstractSQLCoreProvider.java index 274c6b85..c469990a 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AbstractSQLCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AbstractSQLCoreProvider.java @@ -4,9 +4,9 @@ import io.jsonwebtoken.JwtException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.ClientPermissions; -import pro.gravit.launcher.request.auth.AuthRequest; -import pro.gravit.launcher.request.auth.password.AuthPlainPassword; +import pro.gravit.launcher.base.ClientPermissions; +import pro.gravit.launcher.base.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.password.AuthPlainPassword; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthException; import pro.gravit.launchserver.auth.MySQLSourceConfig; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AuthCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AuthCoreProvider.java index f1d8cf7d..50042661 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AuthCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/AuthCoreProvider.java @@ -3,12 +3,12 @@ import com.google.gson.reflect.TypeToken; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent; -import pro.gravit.launcher.request.auth.AuthRequest; -import pro.gravit.launcher.request.auth.details.AuthPasswordDetails; -import pro.gravit.launcher.request.auth.password.AuthPlainPassword; -import pro.gravit.launcher.request.secure.HardwareReportRequest; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent; +import pro.gravit.launcher.base.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.details.AuthPasswordDetails; +import pro.gravit.launcher.base.request.auth.password.AuthPlainPassword; +import pro.gravit.launcher.base.request.secure.HardwareReportRequest; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.Reconfigurable; import pro.gravit.launchserver.auth.AuthException; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MemoryAuthCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MemoryAuthCoreProvider.java index 01dc17ad..f8d8cc93 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MemoryAuthCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MemoryAuthCoreProvider.java @@ -1,9 +1,9 @@ package pro.gravit.launchserver.auth.core; -import pro.gravit.launcher.ClientPermissions; -import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent; -import pro.gravit.launcher.request.auth.AuthRequest; -import pro.gravit.launcher.request.auth.details.AuthLoginOnlyDetails; +import pro.gravit.launcher.base.ClientPermissions; +import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent; +import pro.gravit.launcher.base.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.details.AuthLoginOnlyDetails; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthException; import pro.gravit.launchserver.manangers.AuthManager; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MergeAuthCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MergeAuthCoreProvider.java index fe0a26cc..a0d83fd7 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MergeAuthCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MergeAuthCoreProvider.java @@ -2,7 +2,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthException; import pro.gravit.launchserver.manangers.AuthManager; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java index c5ed101a..13781df9 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.auth.core; -import pro.gravit.launcher.ClientPermissions; -import pro.gravit.launcher.request.secure.HardwareReportRequest; +import pro.gravit.launcher.base.ClientPermissions; +import pro.gravit.launcher.base.request.secure.HardwareReportRequest; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.MySQLSourceConfig; import pro.gravit.launchserver.auth.SQLSourceConfig; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/RejectAuthCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/RejectAuthCoreProvider.java index 0a95d12f..38f3864a 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/RejectAuthCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/RejectAuthCoreProvider.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.auth.core; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthException; import pro.gravit.launchserver.manangers.AuthManager; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/User.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/User.java index acf69db6..10e265f5 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/User.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/User.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.auth.core; -import pro.gravit.launcher.ClientPermissions; +import pro.gravit.launcher.base.ClientPermissions; import java.util.UUID; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/UserHardware.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/UserHardware.java index 82934d0c..642836ab 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/UserHardware.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/UserHardware.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.auth.core.interfaces; -import pro.gravit.launcher.request.secure.HardwareReportRequest; +import pro.gravit.launcher.base.request.secure.HardwareReportRequest; public interface UserHardware { HardwareReportRequest.HardwareInfo getHardwareInfo(); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportAssetUpload.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportAssetUpload.java index f1978698..fe5a0cea 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportAssetUpload.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportAssetUpload.java @@ -1,8 +1,8 @@ package pro.gravit.launchserver.auth.core.interfaces.provider; -import pro.gravit.launcher.events.request.AssetUploadInfoRequestEvent; -import pro.gravit.launcher.events.request.AuthRequestEvent; -import pro.gravit.launcher.events.request.GetAssetUploadUrlRequestEvent; +import pro.gravit.launcher.base.events.request.AssetUploadInfoRequestEvent; +import pro.gravit.launcher.base.events.request.AuthRequestEvent; +import pro.gravit.launcher.base.events.request.GetAssetUploadUrlRequestEvent; import pro.gravit.launchserver.auth.Feature; import pro.gravit.launchserver.auth.core.User; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportHardware.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportHardware.java index 943e4993..237a7aac 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportHardware.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportHardware.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.auth.core.interfaces.provider; -import pro.gravit.launcher.request.secure.HardwareReportRequest; +import pro.gravit.launcher.base.request.secure.HardwareReportRequest; import pro.gravit.launchserver.auth.core.User; import pro.gravit.launchserver.auth.core.UserSession; import pro.gravit.launchserver.auth.core.interfaces.UserHardware; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportRegistration.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportRegistration.java index 6277ae2b..fbe098ad 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportRegistration.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/provider/AuthSupportRegistration.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.auth.core.interfaces.provider; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; import pro.gravit.launchserver.auth.Feature; import pro.gravit.launchserver.auth.core.User; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/user/UserSupportTextures.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/user/UserSupportTextures.java index 214d759c..679c65e3 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/user/UserSupportTextures.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/interfaces/user/UserSupportTextures.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.auth.core.interfaces.user; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.Texture; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.Texture; import java.util.HashMap; import java.util.Map; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/mix/UploadAssetMixProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/mix/UploadAssetMixProvider.java index ef67994f..2e511a77 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/mix/UploadAssetMixProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/mix/UploadAssetMixProvider.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.auth.mix; -import pro.gravit.launcher.events.request.AssetUploadInfoRequestEvent; +import pro.gravit.launcher.base.events.request.AssetUploadInfoRequestEvent; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.core.AuthCoreProvider; import pro.gravit.launchserver.auth.core.User; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/password/JsonPasswordVerifier.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/password/JsonPasswordVerifier.java index e43ae2a8..6b217028 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/password/JsonPasswordVerifier.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/password/JsonPasswordVerifier.java @@ -2,7 +2,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import java.io.InputStream; import java.io.InputStreamReader; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java index 83ce07e2..25caa43f 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java @@ -4,9 +4,9 @@ import io.jsonwebtoken.Jwts; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.events.request.GetSecureLevelInfoRequestEvent; -import pro.gravit.launcher.events.request.HardwareReportRequestEvent; -import pro.gravit.launcher.events.request.VerifySecureLevelKeyRequestEvent; +import pro.gravit.launcher.base.events.request.GetSecureLevelInfoRequestEvent; +import pro.gravit.launcher.base.events.request.HardwareReportRequestEvent; +import pro.gravit.launcher.base.events.request.VerifySecureLevelKeyRequestEvent; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.core.interfaces.UserHardware; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java index 1188dcab..239857a7 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/StdProtectHandler.java @@ -2,7 +2,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.protect.interfaces.ProfilesProtectHandler; import pro.gravit.launchserver.socket.Client; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/ProfilesProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/ProfilesProtectHandler.java index 52f151b1..f2b2d325 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/ProfilesProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/ProfilesProtectHandler.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.auth.protect.interfaces; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.socket.Client; public interface ProfilesProtectHandler { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/SecureProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/SecureProtectHandler.java index 55444083..c5de4fd1 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/SecureProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/interfaces/SecureProtectHandler.java @@ -1,8 +1,8 @@ package pro.gravit.launchserver.auth.protect.interfaces; -import pro.gravit.launcher.events.request.GetSecureLevelInfoRequestEvent; -import pro.gravit.launcher.events.request.SecurityReportRequestEvent; -import pro.gravit.launcher.events.request.VerifySecureLevelKeyRequestEvent; +import pro.gravit.launcher.base.events.request.GetSecureLevelInfoRequestEvent; +import pro.gravit.launcher.base.events.request.SecurityReportRequestEvent; +import pro.gravit.launcher.base.events.request.VerifySecureLevelKeyRequestEvent; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.secure.SecurityReportResponse; import pro.gravit.utils.helper.SecurityHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/JsonTextureProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/JsonTextureProvider.java index 4f31c526..9a93022b 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/JsonTextureProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/JsonTextureProvider.java @@ -3,7 +3,7 @@ import com.google.gson.reflect.TypeToken; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.profiles.Texture; +import pro.gravit.launcher.base.profiles.Texture; import pro.gravit.launchserver.HttpRequester; import pro.gravit.utils.helper.SecurityHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/NullTextureProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/NullTextureProvider.java index b5f785f1..2587a078 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/NullTextureProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/NullTextureProvider.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.auth.texture; -import pro.gravit.launcher.profiles.Texture; +import pro.gravit.launcher.base.profiles.Texture; import pro.gravit.utils.helper.VerifyHelper; import java.io.IOException; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/RequestTextureProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/RequestTextureProvider.java index 4d8885b2..c40ff1ec 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/RequestTextureProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/RequestTextureProvider.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.auth.texture; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.profiles.Texture; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.profiles.Texture; import pro.gravit.utils.helper.CommonHelper; import pro.gravit.utils.helper.IOHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/TextureProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/TextureProvider.java index 4519512a..d3cd82fd 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/TextureProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/TextureProvider.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.auth.texture; -import pro.gravit.launcher.profiles.Texture; +import pro.gravit.launcher.base.profiles.Texture; import pro.gravit.utils.ProviderMap; import java.io.IOException; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/VoidTextureProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/VoidTextureProvider.java index ad3f3387..612ac9cf 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/VoidTextureProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/VoidTextureProvider.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.auth.texture; -import pro.gravit.launcher.profiles.Texture; +import pro.gravit.launcher.base.profiles.Texture; import java.util.UUID; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java index 069a5e3c..3bf50c71 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java @@ -2,7 +2,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launcher.core.serialize.HOutput; import pro.gravit.launcher.core.serialize.stream.StreamObject; import pro.gravit.launchserver.binary.tasks.MainBuildTask; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JARLauncherBinary.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JARLauncherBinary.java index b7bf3e0f..4a1d28b5 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JARLauncherBinary.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JARLauncherBinary.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.binary; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.binary.tasks.*; 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 0d1f6e85..0be26b3a 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,8 +8,8 @@ import org.objectweb.asm.tree.AnnotationNode; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.FieldNode; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherConfig; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.LauncherConfig; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.asm.ClassMetadataReader; import pro.gravit.launchserver.asm.InjectClassAcceptor; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/Command.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/Command.java index b4f7f5a3..fcf67b0f 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/Command.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/Command.java @@ -3,9 +3,9 @@ import me.tongfei.progressbar.ProgressBar; import me.tongfei.progressbar.ProgressBarBuilder; import me.tongfei.progressbar.ProgressBarStyle; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.modern.Downloader; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.Downloader; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.LaunchServer; import pro.gravit.utils.command.CommandException; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadAssetCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadAssetCommand.java index 249ea173..ba005879 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadAssetCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadAssetCommand.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.modern.Downloader; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.Downloader; import pro.gravit.launchserver.HttpRequester; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java index 5ac22a87..b2e28cd2 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java @@ -3,9 +3,9 @@ import com.google.gson.JsonElement; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.ClientProfileVersions; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfileVersions; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; import pro.gravit.launchserver.helper.MakeProfileHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/IndexAssetCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/IndexAssetCommand.java index aec64e36..8c7fe611 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/IndexAssetCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/IndexAssetCommand.java @@ -3,7 +3,7 @@ import com.google.gson.JsonObject; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; import pro.gravit.utils.command.CommandException; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/MakeProfileCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/MakeProfileCommand.java index 78f6973d..a424593c 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/MakeProfileCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/MakeProfileCommand.java @@ -2,8 +2,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; import pro.gravit.launchserver.helper.MakeProfileHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/SaveProfilesCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/SaveProfilesCommand.java index c4609883..32e65634 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/SaveProfilesCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/SaveProfilesCommand.java @@ -2,8 +2,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; import pro.gravit.utils.helper.IOHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/modules/ModulesCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/modules/ModulesCommand.java index e535b365..7519711b 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/modules/ModulesCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/modules/ModulesCommand.java @@ -3,8 +3,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import pro.gravit.launcher.core.LauncherTrustManager; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; import pro.gravit.launchserver.launchermodules.LauncherModuleLoader; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ComponentCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ComponentCommand.java index 39fd07aa..4ff72e01 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ComponentCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/ComponentCommand.java @@ -2,7 +2,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; import pro.gravit.launchserver.components.Component; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/NotifyCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/NotifyCommand.java index abf0e80b..74bc8fa8 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/NotifyCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/NotifyCommand.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.command.service; -import pro.gravit.launcher.events.NotificationEvent; -import pro.gravit.launcher.request.WebSocketEvent; +import pro.gravit.launcher.base.events.NotificationEvent; +import pro.gravit.launcher.base.request.WebSocketEvent; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.command.Command; import pro.gravit.launchserver.socket.WebSocketService; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/SecurityCheckCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/SecurityCheckCommand.java index 95d6cf99..a18c19e7 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/SecurityCheckCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/SecurityCheckCommand.java @@ -2,7 +2,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.protect.AdvancedProtectHandler; import pro.gravit.launchserver.auth.protect.NoProtectHandler; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/TokenCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/TokenCommand.java index f6090469..35fdb687 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/TokenCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/service/TokenCommand.java @@ -3,7 +3,7 @@ import io.jsonwebtoken.Jwts; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.command.Command; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java index 8f01b866..66b0aeee 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java @@ -4,8 +4,8 @@ import io.netty.handler.logging.LogLevel; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherConfig; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.LauncherConfig; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.core.RejectAuthCoreProvider; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/helper/HttpHelper.java b/LaunchServer/src/main/java/pro/gravit/launchserver/helper/HttpHelper.java index 2e6a756a..3872fec2 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/helper/HttpHelper.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/helper/HttpHelper.java @@ -3,8 +3,8 @@ import com.google.gson.JsonElement; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.request.RequestException; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.request.RequestException; import java.io.IOException; import java.io.InputStream; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/helper/MakeProfileHelper.java b/LaunchServer/src/main/java/pro/gravit/launchserver/helper/MakeProfileHelper.java index 8bcac9bb..7f81329a 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/helper/MakeProfileHelper.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/helper/MakeProfileHelper.java @@ -1,12 +1,12 @@ package pro.gravit.launchserver.helper; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.ClientProfileBuilder; -import pro.gravit.launcher.profiles.ClientProfileVersions; -import pro.gravit.launcher.profiles.optional.OptionalFile; -import pro.gravit.launcher.profiles.optional.actions.OptionalActionFile; -import pro.gravit.launcher.profiles.optional.actions.OptionalActionJvmArgs; -import pro.gravit.launcher.profiles.optional.triggers.OSTrigger; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfileBuilder; +import pro.gravit.launcher.base.profiles.ClientProfileVersions; +import pro.gravit.launcher.base.profiles.optional.OptionalFile; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalActionFile; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalActionJvmArgs; +import pro.gravit.launcher.base.profiles.optional.triggers.OSTrigger; import pro.gravit.utils.helper.JVMHelper; import java.io.IOException; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/launchermodules/LauncherModuleLoader.java b/LaunchServer/src/main/java/pro/gravit/launchserver/launchermodules/LauncherModuleLoader.java index df68ff85..eb6ddcaf 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/launchermodules/LauncherModuleLoader.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/launchermodules/LauncherModuleLoader.java @@ -2,7 +2,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.asm.InjectClassAcceptor; 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 5b7c3c21..8d00596d 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java @@ -4,12 +4,12 @@ import io.jsonwebtoken.Jwts; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.ClientPermissions; -import pro.gravit.launcher.events.request.AuthRequestEvent; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.PlayerProfile; -import pro.gravit.launcher.request.auth.AuthRequest; -import pro.gravit.launcher.request.auth.password.*; +import pro.gravit.launcher.base.ClientPermissions; +import pro.gravit.launcher.base.events.request.AuthRequestEvent; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.PlayerProfile; +import pro.gravit.launcher.base.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.password.*; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthException; import pro.gravit.launchserver.auth.AuthProviderPair; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/ConfigManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/ConfigManager.java similarity index 93% rename from LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/ConfigManager.java rename to LaunchServer/src/main/java/pro/gravit/launchserver/manangers/ConfigManager.java index a1843aaf..fc5df469 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/ConfigManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/ConfigManager.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.runtime.managers; +package pro.gravit.launchserver.manangers; -import pro.gravit.launcher.config.JsonConfigurable; +import pro.gravit.launcher.base.config.JsonConfigurable; import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.helper.VerifyHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java index c3f4e575..07deb093 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/LaunchServerGsonManager.java @@ -2,16 +2,16 @@ import com.google.gson.GsonBuilder; import marcono1234.gson.recordadapter.RecordTypeAdapterFactory; -import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent; +import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent; import pro.gravit.launcher.core.managers.GsonManager; -import pro.gravit.launcher.modules.events.PreGsonPhase; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.optional.actions.OptionalAction; -import pro.gravit.launcher.profiles.optional.triggers.OptionalTrigger; -import pro.gravit.launcher.request.JsonResultSerializeAdapter; -import pro.gravit.launcher.request.WebSocketEvent; -import pro.gravit.launcher.request.auth.AuthRequest; -import pro.gravit.launcher.request.auth.GetAvailabilityAuthRequest; +import pro.gravit.launcher.base.modules.events.PreGsonPhase; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalAction; +import pro.gravit.launcher.base.profiles.optional.triggers.OptionalTrigger; +import pro.gravit.launcher.base.request.JsonResultSerializeAdapter; +import pro.gravit.launcher.base.request.WebSocketEvent; +import pro.gravit.launcher.base.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.GetAvailabilityAuthRequest; import pro.gravit.launchserver.auth.core.AuthCoreProvider; import pro.gravit.launchserver.auth.mix.MixProvider; import pro.gravit.launchserver.auth.password.PasswordVerifier; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/MirrorManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/MirrorManager.java index 07932e2d..ddbd1eb9 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/MirrorManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/MirrorManager.java @@ -3,7 +3,7 @@ import com.google.gson.JsonElement; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.utils.helper.IOHelper; import java.io.IOException; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerFullInitEvent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerFullInitEvent.java index b619935b..cc5b7361 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerFullInitEvent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerFullInitEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.modules.events; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModule; import pro.gravit.launchserver.LaunchServer; public class LaunchServerFullInitEvent extends LauncherModule.Event { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerInitPhase.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerInitPhase.java index da8903f1..773f8897 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerInitPhase.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerInitPhase.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.modules.events; -import pro.gravit.launcher.modules.events.InitPhase; +import pro.gravit.launcher.base.modules.events.InitPhase; import pro.gravit.launchserver.LaunchServer; public class LaunchServerInitPhase extends InitPhase { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerLauncherExeInit.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerLauncherExeInit.java index 48969876..5429f843 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerLauncherExeInit.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerLauncherExeInit.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.modules.events; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModule; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.binary.LauncherBinary; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerNettyFullInitEvent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerNettyFullInitEvent.java index dae7d45b..58f9695f 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerNettyFullInitEvent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerNettyFullInitEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.modules.events; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModule; import pro.gravit.launchserver.LaunchServer; public class LaunchServerNettyFullInitEvent extends LauncherModule.Event { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerPostInitPhase.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerPostInitPhase.java index e582bdf0..cb4ad282 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerPostInitPhase.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerPostInitPhase.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.modules.events; -import pro.gravit.launcher.modules.events.PostInitPhase; +import pro.gravit.launcher.base.modules.events.PostInitPhase; import pro.gravit.launchserver.LaunchServer; public class LaunchServerPostInitPhase extends PostInitPhase { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerProfilesSyncEvent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerProfilesSyncEvent.java index c49ff4a5..a8c1e89d 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerProfilesSyncEvent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerProfilesSyncEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.modules.events; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModule; import pro.gravit.launchserver.LaunchServer; public class LaunchServerProfilesSyncEvent extends LauncherModule.Event { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerUpdatesSyncEvent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerUpdatesSyncEvent.java index c8afddf8..811aae2f 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerUpdatesSyncEvent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/LaunchServerUpdatesSyncEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.modules.events; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModule; import pro.gravit.launchserver.LaunchServer; public class LaunchServerUpdatesSyncEvent extends LauncherModule.Event { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/NewLaunchServerInstanceEvent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/NewLaunchServerInstanceEvent.java index 1dc3a550..9ed2aaaf 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/NewLaunchServerInstanceEvent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/NewLaunchServerInstanceEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.modules.events; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModule; import pro.gravit.launchserver.LaunchServer; public class NewLaunchServerInstanceEvent extends LauncherModule.Event { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/security/SecurityReportModuleEvent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/security/SecurityReportModuleEvent.java index 8fb01c62..39c85369 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/security/SecurityReportModuleEvent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/events/security/SecurityReportModuleEvent.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.modules.events.security; -import pro.gravit.launcher.events.request.SecurityReportRequestEvent; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.base.events.request.SecurityReportRequestEvent; +import pro.gravit.launcher.base.modules.LauncherModule; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.secure.SecurityReportResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerCoreModule.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerCoreModule.java index 6e54d9bb..798572c9 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerCoreModule.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerCoreModule.java @@ -1,9 +1,9 @@ package pro.gravit.launchserver.modules.impl; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; -import pro.gravit.launcher.modules.events.InitPhase; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.events.InitPhase; import pro.gravit.utils.Version; public class LaunchServerCoreModule extends LauncherModule { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerInitContext.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerInitContext.java index f33f8b5e..c3e35225 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerInitContext.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerInitContext.java @@ -1,6 +1,6 @@ package pro.gravit.launchserver.modules.impl; -import pro.gravit.launcher.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherInitContext; import pro.gravit.launchserver.LaunchServer; public class LaunchServerInitContext implements LauncherInitContext { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java index 1149eaa6..47dc112e 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/modules/impl/LaunchServerModulesManager.java @@ -1,8 +1,8 @@ package pro.gravit.launchserver.modules.impl; import pro.gravit.launcher.core.LauncherTrustManager; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.impl.SimpleModuleManager; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.impl.SimpleModuleManager; import pro.gravit.launchserver.LaunchServer; import java.nio.file.Path; 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 32b4fdf4..b91c50f4 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket; -import pro.gravit.launcher.ClientPermissions; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.ClientPermissions; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.core.interfaces.UserHardware; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java index 03de2060..948b01be 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/WebSocketService.java @@ -8,11 +8,11 @@ import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.events.request.ErrorRequestEvent; -import pro.gravit.launcher.events.request.ExitRequestEvent; -import pro.gravit.launcher.request.WebSocketEvent; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.events.request.ErrorRequestEvent; +import pro.gravit.launcher.base.events.request.ExitRequestEvent; +import pro.gravit.launcher.base.request.WebSocketEvent; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.socket.handlers.WebSocketFrameHandler; import pro.gravit.launchserver.socket.response.SimpleResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/NettyWebAPIHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/NettyWebAPIHandler.java index 46fa2fd4..ac4c0057 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/NettyWebAPIHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/NettyWebAPIHandler.java @@ -7,7 +7,7 @@ import io.netty.handler.codec.http.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launchserver.socket.NettyConnectContext; import pro.gravit.utils.helper.IOHelper; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/SimpleResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/SimpleResponse.java index 87e15aed..28738232 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/SimpleResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/SimpleResponse.java @@ -1,8 +1,8 @@ package pro.gravit.launchserver.socket.response; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.events.request.ErrorRequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.events.request.ErrorRequestEvent; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.socket.WebSocketService; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/WebSocketServerResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/WebSocketServerResponse.java index d4a769d8..7d3814d8 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/WebSocketServerResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/WebSocketServerResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; import pro.gravit.launchserver.socket.Client; public interface WebSocketServerResponse extends WebSocketRequest { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AdditionalDataResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AdditionalDataResponse.java index b3a38e6b..a4a368b6 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AdditionalDataResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AdditionalDataResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.auth; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.AdditionalDataRequestEvent; +import pro.gravit.launcher.base.events.request.AdditionalDataRequestEvent; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.core.User; import pro.gravit.launchserver.auth.core.interfaces.user.UserSupportAdditionalData; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java index 58f1ea35..fc463437 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java @@ -3,8 +3,8 @@ import io.netty.channel.ChannelHandlerContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.events.request.AuthRequestEvent; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.events.request.AuthRequestEvent; +import pro.gravit.launcher.base.request.auth.AuthRequest; import pro.gravit.launchserver.auth.AuthException; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.manangers.AuthManager; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CheckServerResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CheckServerResponse.java index 947e5dcb..29aed1be 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CheckServerResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CheckServerResponse.java @@ -3,7 +3,7 @@ import io.netty.channel.ChannelHandlerContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.events.request.CheckServerRequestEvent; +import pro.gravit.launcher.base.events.request.CheckServerRequestEvent; import pro.gravit.launchserver.auth.AuthException; import pro.gravit.launchserver.auth.core.interfaces.session.UserSessionSupportHardware; import pro.gravit.launchserver.auth.core.interfaces.session.UserSessionSupportProperties; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CurrentUserResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CurrentUserResponse.java index d1aaa064..560cf1cd 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CurrentUserResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CurrentUserResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.auth; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.CurrentUserRequestEvent; +import pro.gravit.launcher.base.events.request.CurrentUserRequestEvent; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; 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 af5d4d42..6cd1647c 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 @@ -2,8 +2,8 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.events.request.ExitRequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.events.request.ExitRequestEvent; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.core.UserSession; import pro.gravit.launchserver.auth.core.interfaces.provider.AuthSupportExit; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/FetchClientProfileKeyResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/FetchClientProfileKeyResponse.java index 92f191f5..6a0d04a3 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/FetchClientProfileKeyResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/FetchClientProfileKeyResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.auth; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.FetchClientProfileKeyRequestEvent; +import pro.gravit.launcher.base.events.request.FetchClientProfileKeyRequestEvent; import pro.gravit.launchserver.auth.core.UserSession; import pro.gravit.launchserver.auth.core.interfaces.session.UserSessionSupportKeys; import pro.gravit.launchserver.socket.Client; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/GetAvailabilityAuthResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/GetAvailabilityAuthResponse.java index 913218c1..b5d24f81 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/GetAvailabilityAuthResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/GetAvailabilityAuthResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.auth; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent; +import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/JoinServerResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/JoinServerResponse.java index 72a480a2..d1238639 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/JoinServerResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/JoinServerResponse.java @@ -3,7 +3,7 @@ import io.netty.channel.ChannelHandlerContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.events.request.JoinServerRequestEvent; +import pro.gravit.launcher.base.events.request.JoinServerRequestEvent; import pro.gravit.launchserver.auth.AuthException; import pro.gravit.launchserver.auth.protect.interfaces.JoinServerProtectHandler; import pro.gravit.launchserver.socket.Client; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ProfilesResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ProfilesResponse.java index 45067b2e..39058b76 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ProfilesResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/ProfilesResponse.java @@ -1,8 +1,8 @@ package pro.gravit.launchserver.socket.response.auth; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.ProfilesRequestEvent; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.events.request.ProfilesRequestEvent; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.protect.interfaces.ProfilesProtectHandler; import pro.gravit.launchserver.socket.Client; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/RefreshTokenResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/RefreshTokenResponse.java index 892a4e3c..df02e059 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/RefreshTokenResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/RefreshTokenResponse.java @@ -1,8 +1,8 @@ package pro.gravit.launchserver.socket.response.auth; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.AuthRequestEvent; -import pro.gravit.launcher.events.request.RefreshTokenRequestEvent; +import pro.gravit.launcher.base.events.request.AuthRequestEvent; +import pro.gravit.launcher.base.events.request.RefreshTokenRequestEvent; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.manangers.AuthManager; import pro.gravit.launchserver.socket.Client; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/RestoreResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/RestoreResponse.java index fa720e5c..4e326b7a 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/RestoreResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/RestoreResponse.java @@ -1,9 +1,9 @@ package pro.gravit.launchserver.socket.response.auth; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.AuthRequestEvent; -import pro.gravit.launcher.events.request.LauncherRequestEvent; -import pro.gravit.launcher.events.request.RestoreRequestEvent; +import pro.gravit.launcher.base.events.request.AuthRequestEvent; +import pro.gravit.launcher.base.events.request.LauncherRequestEvent; +import pro.gravit.launcher.base.events.request.RestoreRequestEvent; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.core.AuthCoreProvider; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/SetProfileResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/SetProfileResponse.java index 423e4a68..ad1e37d5 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/SetProfileResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/SetProfileResponse.java @@ -1,8 +1,8 @@ package pro.gravit.launchserver.socket.response.auth; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.SetProfileRequestEvent; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.events.request.SetProfileRequestEvent; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.auth.protect.interfaces.ProfilesProtectHandler; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/cabinet/GetAssetUploadInfoResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/cabinet/GetAssetUploadInfoResponse.java index 60260f11..5136a389 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/cabinet/GetAssetUploadInfoResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/cabinet/GetAssetUploadInfoResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.cabinet; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.GetAssetUploadUrlRequestEvent; +import pro.gravit.launcher.base.events.request.GetAssetUploadUrlRequestEvent; import pro.gravit.launchserver.auth.core.interfaces.provider.AuthSupportAssetUpload; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/management/FeaturesResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/management/FeaturesResponse.java index 74ccf493..02323dd1 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/management/FeaturesResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/management/FeaturesResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.management; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.FeaturesRequestEvent; +import pro.gravit.launcher.base.events.request.FeaturesRequestEvent; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/management/GetPublicKeyResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/management/GetPublicKeyResponse.java index 398dc3e4..3e18caff 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/management/GetPublicKeyResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/management/GetPublicKeyResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.management; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.GetPublicKeyRequestEvent; +import pro.gravit.launcher.base.events.request.GetPublicKeyRequestEvent; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/BatchProfileByUsername.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/BatchProfileByUsername.java index 3193d940..bfdb81ac 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/BatchProfileByUsername.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/BatchProfileByUsername.java @@ -1,8 +1,8 @@ package pro.gravit.launchserver.socket.response.profile; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.BatchProfileByUsernameRequestEvent; -import pro.gravit.launcher.profiles.PlayerProfile; +import pro.gravit.launcher.base.events.request.BatchProfileByUsernameRequestEvent; +import pro.gravit.launcher.base.profiles.PlayerProfile; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java index 90f59088..9bf4ec16 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.profile; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.ProfileByUUIDRequestEvent; +import pro.gravit.launcher.base.events.request.ProfileByUUIDRequestEvent; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.core.User; import pro.gravit.launchserver.socket.Client; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUsername.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUsername.java index d19c301a..50b9efe6 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUsername.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUsername.java @@ -1,8 +1,8 @@ package pro.gravit.launchserver.socket.response.profile; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.ProfileByUsernameRequestEvent; -import pro.gravit.launcher.profiles.PlayerProfile; +import pro.gravit.launcher.base.events.request.ProfileByUsernameRequestEvent; +import pro.gravit.launcher.base.profiles.PlayerProfile; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/GetSecureLevelInfoResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/GetSecureLevelInfoResponse.java index defe4630..b3e3c99f 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/GetSecureLevelInfoResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/GetSecureLevelInfoResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.secure; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.GetSecureLevelInfoRequestEvent; +import pro.gravit.launcher.base.events.request.GetSecureLevelInfoRequestEvent; import pro.gravit.launchserver.auth.protect.interfaces.SecureProtectHandler; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/HardwareReportResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/HardwareReportResponse.java index b23e5ecb..785a42c3 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/HardwareReportResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/HardwareReportResponse.java @@ -1,8 +1,8 @@ package pro.gravit.launchserver.socket.response.secure; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.HardwareReportRequestEvent; -import pro.gravit.launcher.request.secure.HardwareReportRequest; +import pro.gravit.launcher.base.events.request.HardwareReportRequestEvent; +import pro.gravit.launcher.base.request.secure.HardwareReportRequest; import pro.gravit.launchserver.auth.protect.interfaces.HardwareProtectHandler; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/SecurityReportResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/SecurityReportResponse.java index de64309a..a7ff6784 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/SecurityReportResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/secure/SecurityReportResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.secure; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.SecurityReportRequestEvent; +import pro.gravit.launcher.base.events.request.SecurityReportRequestEvent; import pro.gravit.launchserver.auth.protect.interfaces.SecureProtectHandler; import pro.gravit.launchserver.modules.events.security.SecurityReportModuleEvent; import pro.gravit.launchserver.socket.Client; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/LauncherResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/LauncherResponse.java index 8849c61a..de468ed6 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/LauncherResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/LauncherResponse.java @@ -6,7 +6,7 @@ import io.netty.channel.ChannelHandlerContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import pro.gravit.launcher.events.request.LauncherRequestEvent; +import pro.gravit.launcher.base.events.request.LauncherRequestEvent; import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.socket.Client; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateListResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateListResponse.java index bda0328b..5d3d7d67 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateListResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateListResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.update; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.UpdateListRequestEvent; +import pro.gravit.launcher.base.events.request.UpdateListRequestEvent; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java index f1a3cd1e..9f92517d 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/update/UpdateResponse.java @@ -1,7 +1,7 @@ package pro.gravit.launchserver.socket.response.update; import io.netty.channel.ChannelHandlerContext; -import pro.gravit.launcher.events.request.UpdateRequestEvent; +import pro.gravit.launcher.base.events.request.UpdateRequestEvent; import pro.gravit.launcher.core.hasher.HashedDir; import pro.gravit.launchserver.auth.protect.interfaces.ProfilesProtectHandler; import pro.gravit.launchserver.config.LaunchServerConfig; diff --git a/LaunchServer/src/main/resources/pro/gravit/launchserver/defaults/proguard.cfg b/LaunchServer/src/main/resources/pro/gravit/launchserver/defaults/proguard.cfg index ca10f5fa..2f89b1a5 100644 --- a/LaunchServer/src/main/resources/pro/gravit/launchserver/defaults/proguard.cfg +++ b/LaunchServer/src/main/resources/pro/gravit/launchserver/defaults/proguard.cfg @@ -14,9 +14,9 @@ -keepattributes Signature -adaptresourcefilecontents META-INF/MANIFEST.MF --keeppackagenames com.mojang.**,net.minecraftforge.fml.**,cpw.mods.fml.**,com.google.gson.**,pro.gravit.repackage.**,org.fusesource.**, pro.gravit.launcher.api.**, pro.gravit.utils.**, pro.gravit.launcher.request.**, pro.gravit.launcher.events.**, pro.gravit.launcher.profiles.** +-keeppackagenames com.google.gson.**,pro.gravit.repackage.**,org.fusesource.**, pro.gravit.launcher.runtime.api.**, pro.gravit.launcher.base.api.**, pro.gravit.launcher.client.api.**, pro.gravit.utils.**, pro.gravit.launcher.base.request.**, pro.gravit.launcher.base.events.**, pro.gravit.launcher.base.profiles.** --keep class com.mojang.**,net.minecraftforge.fml.**,cpw.mods.fml.**,com.google.gson.**,pro.gravit.repackage.**,org.fusesource.**, pro.gravit.launcher.client.api.**, pro.gravit.utils.**, pro.gravit.launcher.request.**, pro.gravit.launcher.events.**, pro.gravit.launcher.profiles.**, pro.gravit.launcher.LauncherEngineWrapper { +-keep class com.mojang.**,net.minecraftforge.fml.**,cpw.mods.fml.**,com.google.gson.**,pro.gravit.repackage.**,org.fusesource.**, pro.gravit.launcher.client.api.**, pro.gravit.utils.**, pro.gravit.launcher.base.request.**, pro.gravit.launcher.base.events.**, pro.gravit.launcher.base.profiles.**, pro.gravit.launcher.runtime.LauncherEngineWrapper { *; } diff --git a/LaunchServer/src/test/java/pro/gravit/launchserver/ConfigurationTest.java b/LaunchServer/src/test/java/pro/gravit/launchserver/ConfigurationTest.java index 89ce58eb..bf2d51a5 100644 --- a/LaunchServer/src/test/java/pro/gravit/launchserver/ConfigurationTest.java +++ b/LaunchServer/src/test/java/pro/gravit/launchserver/ConfigurationTest.java @@ -4,7 +4,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launchserver.config.LaunchServerConfig; import pro.gravit.launchserver.config.LaunchServerRuntimeConfig; import pro.gravit.launchserver.impl.TestLaunchServerConfigManager; diff --git a/LaunchServer/src/test/java/pro/gravit/launchserver/StartLaunchServerTest.java b/LaunchServer/src/test/java/pro/gravit/launchserver/StartLaunchServerTest.java index 88b8762a..9c663b15 100644 --- a/LaunchServer/src/test/java/pro/gravit/launchserver/StartLaunchServerTest.java +++ b/LaunchServer/src/test/java/pro/gravit/launchserver/StartLaunchServerTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launchserver.config.LaunchServerConfig; import pro.gravit.launchserver.config.LaunchServerRuntimeConfig; import pro.gravit.launchserver.impl.TestLaunchServerConfigManager; diff --git a/Launcher/build.gradle b/Launcher/build.gradle index b2a0c82b..2aa41a79 100644 --- a/Launcher/build.gradle +++ b/Launcher/build.gradle @@ -1,8 +1,8 @@ apply plugin: 'org.openjfx.javafxplugin' apply plugin: 'com.github.johnrengelman.shadow' -String mainClassName = "pro.gravit.launcher.ClientLauncherWrapper" -String mainAgentName = "pro.gravit.launcher.LauncherAgent" +String mainClassName = "pro.gravit.launcher.start.ClientLauncherWrapper" +String mainAgentName = "pro.gravit.launcher.runtime.LauncherAgent" repositories { maven { @@ -50,11 +50,9 @@ dependencies { pack project(':LauncherAPI') - pack project(':LauncherModernCore') pack project(':LauncherClient') pack project(':LauncherStart') bundle group: 'com.github.oshi', name: 'oshi-core', version: rootProject['verOshiCore'] - pack group: 'io.netty', name: 'netty-codec-http', version: rootProject['verNetty'] } tasks.register('genRuntimeJS', Zip) { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngine.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/LauncherEngine.java similarity index 86% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngine.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/LauncherEngine.java index 9c4be3e3..8de18308 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngine.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/LauncherEngine.java @@ -1,31 +1,30 @@ -package pro.gravit.launcher.client.runtime; +package pro.gravit.launcher.runtime; -import pro.gravit.launcher.*; -import pro.gravit.launcher.client.BasicLauncherEventHandler; -import pro.gravit.launcher.client.ClientLauncherMethods; -import pro.gravit.launcher.client.LauncherAgent; -import pro.gravit.launcher.client.runtime.client.*; -import pro.gravit.launcher.client.runtime.client.events.ClientEngineInitPhase; -import pro.gravit.launcher.client.runtime.client.events.ClientExitPhase; -import pro.gravit.launcher.client.runtime.client.events.ClientPreGuiPhase; -import pro.gravit.launcher.client.runtime.console.GetPublicKeyCommand; -import pro.gravit.launcher.client.runtime.console.ModulesCommand; -import pro.gravit.launcher.client.runtime.console.SignDataCommand; -import pro.gravit.launcher.client.runtime.gui.NoRuntimeProvider; -import pro.gravit.launcher.client.runtime.gui.RuntimeProvider; -import pro.gravit.launcher.client.runtime.managers.ConsoleManager; -import pro.gravit.launcher.client.runtime.utils.NativeJVMHalt; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.LauncherConfig; +import pro.gravit.launcher.client.*; +import pro.gravit.launcher.runtime.client.*; +import pro.gravit.launcher.runtime.client.events.ClientEngineInitPhase; +import pro.gravit.launcher.client.events.ClientExitPhase; +import pro.gravit.launcher.runtime.client.events.ClientPreGuiPhase; +import pro.gravit.launcher.runtime.console.GetPublicKeyCommand; +import pro.gravit.launcher.runtime.console.ModulesCommand; +import pro.gravit.launcher.runtime.console.SignDataCommand; +import pro.gravit.launcher.runtime.gui.NoRuntimeProvider; +import pro.gravit.launcher.runtime.gui.RuntimeProvider; +import pro.gravit.launcher.runtime.managers.ConsoleManager; +import pro.gravit.launcher.client.utils.NativeJVMHalt; import pro.gravit.launcher.core.LauncherTrustManager; -import pro.gravit.launcher.modules.events.OfflineModeEvent; -import pro.gravit.launcher.modules.events.PreConfigPhase; -import pro.gravit.launcher.profiles.optional.actions.OptionalAction; -import pro.gravit.launcher.profiles.optional.triggers.OptionalTrigger; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.RequestException; -import pro.gravit.launcher.request.RequestService; -import pro.gravit.launcher.request.auth.*; -import pro.gravit.launcher.request.websockets.OfflineRequestService; -import pro.gravit.launcher.request.websockets.StdWebSocketService; +import pro.gravit.launcher.base.modules.events.OfflineModeEvent; +import pro.gravit.launcher.base.modules.events.PreConfigPhase; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalAction; +import pro.gravit.launcher.base.profiles.optional.triggers.OptionalTrigger; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.RequestException; +import pro.gravit.launcher.base.request.RequestService; +import pro.gravit.launcher.base.request.auth.*; +import pro.gravit.launcher.base.request.websockets.OfflineRequestService; +import pro.gravit.launcher.base.request.websockets.StdWebSocketService; import pro.gravit.launcher.start.RuntimeModuleManager; import pro.gravit.utils.helper.*; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngineWrapper.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/LauncherEngineWrapper.java similarity index 97% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngineWrapper.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/LauncherEngineWrapper.java index 01d588aa..b0cd6306 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/LauncherEngineWrapper.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/LauncherEngineWrapper.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.runtime; +package pro.gravit.launcher.runtime; import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.utils.helper.IOHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/NewLauncherSettings.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/NewLauncherSettings.java similarity index 73% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/NewLauncherSettings.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/NewLauncherSettings.java index bcb5c355..a58108ac 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/NewLauncherSettings.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/NewLauncherSettings.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.runtime; +package pro.gravit.launcher.runtime; -import pro.gravit.launcher.client.runtime.client.UserSettings; +import pro.gravit.launcher.runtime.client.UserSettings; import pro.gravit.launcher.core.LauncherNetworkAPI; import java.util.HashMap; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherProcess.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java similarity index 91% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherProcess.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java index 29239476..0a378b19 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherProcess.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java @@ -1,19 +1,21 @@ -package pro.gravit.launcher.client.runtime.client; +package pro.gravit.launcher.runtime.client; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherConfig; -import pro.gravit.launcher.client.runtime.LauncherEngine; -import pro.gravit.launcher.client.runtime.client.events.client.ClientProcessBuilderCreateEvent; -import pro.gravit.launcher.client.runtime.client.events.client.ClientProcessBuilderLaunchedEvent; -import pro.gravit.launcher.client.runtime.client.events.client.ClientProcessBuilderParamsWrittedEvent; -import pro.gravit.launcher.client.runtime.client.events.client.ClientProcessBuilderPreLaunchEvent; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.LauncherConfig; +import pro.gravit.launcher.client.ClientLauncherEntryPoint; +import pro.gravit.launcher.client.ClientParams; +import pro.gravit.launcher.runtime.LauncherEngine; +import pro.gravit.launcher.runtime.client.events.ClientProcessBuilderCreateEvent; +import pro.gravit.launcher.runtime.client.events.ClientProcessBuilderLaunchedEvent; +import pro.gravit.launcher.runtime.client.events.ClientProcessBuilderParamsWrittedEvent; +import pro.gravit.launcher.runtime.client.events.ClientProcessBuilderPreLaunchEvent; import pro.gravit.launcher.core.hasher.HashedDir; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.PlayerProfile; -import pro.gravit.launcher.profiles.optional.OptionalView; -import pro.gravit.launcher.profiles.optional.actions.OptionalAction; -import pro.gravit.launcher.profiles.optional.actions.OptionalActionJvmArgs; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.PlayerProfile; +import pro.gravit.launcher.base.profiles.optional.OptionalView; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalAction; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalActionJvmArgs; +import pro.gravit.launcher.base.request.Request; import pro.gravit.launcher.core.serialize.HOutput; import pro.gravit.utils.helper.*; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/DirBridge.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/DirBridge.java similarity index 97% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/DirBridge.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/DirBridge.java index 3167bfef..f5e6c4fa 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/DirBridge.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/DirBridge.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.runtime.client; +package pro.gravit.launcher.runtime.client; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.LogHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeGsonManager.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/RuntimeGsonManager.java similarity index 81% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeGsonManager.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/RuntimeGsonManager.java index 0ea95006..6f31c359 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeGsonManager.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/RuntimeGsonManager.java @@ -1,10 +1,10 @@ -package pro.gravit.launcher.client.runtime.client; +package pro.gravit.launcher.runtime.client; import com.google.gson.GsonBuilder; import pro.gravit.launcher.start.RuntimeModuleManager; import pro.gravit.launcher.core.managers.GsonManager; -import pro.gravit.launcher.modules.events.PreGsonPhase; -import pro.gravit.launcher.request.websockets.ClientWebSocketService; +import pro.gravit.launcher.base.modules.events.PreGsonPhase; +import pro.gravit.launcher.base.request.websockets.ClientWebSocketService; import pro.gravit.utils.UniversalJsonAdapter; public class RuntimeGsonManager extends GsonManager { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ServerPinger.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ServerPinger.java similarity index 98% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ServerPinger.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/ServerPinger.java index f0a83ea1..53f113b2 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/ServerPinger.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ServerPinger.java @@ -1,10 +1,10 @@ -package pro.gravit.launcher.client.runtime.client; +package pro.gravit.launcher.runtime.client; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.ClientProfileVersions; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfileVersions; import pro.gravit.launcher.core.serialize.HInput; import pro.gravit.launcher.core.serialize.HOutput; import pro.gravit.utils.helper.IOHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/UserSettings.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/UserSettings.java similarity index 74% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/UserSettings.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/UserSettings.java index 6a9b0c9d..37f4a105 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/UserSettings.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/UserSettings.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.runtime.client; +package pro.gravit.launcher.runtime.client; import pro.gravit.utils.ProviderMap; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientEngineInitPhase.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientEngineInitPhase.java similarity index 53% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientEngineInitPhase.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientEngineInitPhase.java index 1a54cc43..51f78965 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientEngineInitPhase.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientEngineInitPhase.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.client.events; +package pro.gravit.launcher.runtime.client.events; -import pro.gravit.launcher.client.runtime.LauncherEngine; -import pro.gravit.launcher.modules.events.InitPhase; +import pro.gravit.launcher.runtime.LauncherEngine; +import pro.gravit.launcher.base.modules.events.InitPhase; public class ClientEngineInitPhase extends InitPhase { public final LauncherEngine engine; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientGuiPhase.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientGuiPhase.java similarity index 57% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientGuiPhase.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientGuiPhase.java index daee9373..54fe9305 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientGuiPhase.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientGuiPhase.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.client.events; +package pro.gravit.launcher.runtime.client.events; -import pro.gravit.launcher.client.runtime.gui.RuntimeProvider; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.runtime.gui.RuntimeProvider; +import pro.gravit.launcher.base.modules.LauncherModule; public class ClientGuiPhase extends LauncherModule.Event { public final RuntimeProvider runtimeProvider; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientPreGuiPhase.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientPreGuiPhase.java similarity index 57% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientPreGuiPhase.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientPreGuiPhase.java index e3bce78d..39572c9b 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientPreGuiPhase.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientPreGuiPhase.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.client.events; +package pro.gravit.launcher.runtime.client.events; -import pro.gravit.launcher.client.runtime.gui.RuntimeProvider; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.runtime.gui.RuntimeProvider; +import pro.gravit.launcher.base.modules.LauncherModule; public class ClientPreGuiPhase extends LauncherModule.Event { public RuntimeProvider runtimeProvider; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderCreateEvent.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderCreateEvent.java similarity index 59% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderCreateEvent.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderCreateEvent.java index 7df12606..d0d1ebc7 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderCreateEvent.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderCreateEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.client.events.client; +package pro.gravit.launcher.runtime.client.events; -import pro.gravit.launcher.client.runtime.client.ClientLauncherProcess; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.runtime.client.ClientLauncherProcess; +import pro.gravit.launcher.base.modules.LauncherModule; public class ClientProcessBuilderCreateEvent extends LauncherModule.Event { public final ClientLauncherProcess processBuilder; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderLaunchedEvent.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderLaunchedEvent.java similarity index 59% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderLaunchedEvent.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderLaunchedEvent.java index 5383f328..3d9559fd 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderLaunchedEvent.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderLaunchedEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.client.events.client; +package pro.gravit.launcher.runtime.client.events; -import pro.gravit.launcher.client.runtime.client.ClientLauncherProcess; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.runtime.client.ClientLauncherProcess; +import pro.gravit.launcher.base.modules.LauncherModule; public class ClientProcessBuilderLaunchedEvent extends LauncherModule.Event { public final ClientLauncherProcess processBuilder; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderParamsWrittedEvent.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderParamsWrittedEvent.java similarity index 57% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderParamsWrittedEvent.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderParamsWrittedEvent.java index 469d92ad..c3a808e8 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderParamsWrittedEvent.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderParamsWrittedEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.client.events.client; +package pro.gravit.launcher.runtime.client.events; -import pro.gravit.launcher.client.runtime.client.ClientLauncherProcess; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.runtime.client.ClientLauncherProcess; +import pro.gravit.launcher.base.modules.LauncherModule; public class ClientProcessBuilderParamsWrittedEvent extends LauncherModule.Event { public final ClientLauncherProcess process; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderPreLaunchEvent.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderPreLaunchEvent.java similarity index 59% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderPreLaunchEvent.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderPreLaunchEvent.java index 188bd42d..ce013aa2 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessBuilderPreLaunchEvent.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/events/ClientProcessBuilderPreLaunchEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.client.events.client; +package pro.gravit.launcher.runtime.client.events; -import pro.gravit.launcher.client.runtime.client.ClientLauncherProcess; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.runtime.client.ClientLauncherProcess; +import pro.gravit.launcher.base.modules.LauncherModule; public class ClientProcessBuilderPreLaunchEvent extends LauncherModule.Event { public final ClientLauncherProcess processBuilder; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/GetPublicKeyCommand.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/console/GetPublicKeyCommand.java similarity index 86% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/GetPublicKeyCommand.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/console/GetPublicKeyCommand.java index 7a63a5eb..2d2e1ec1 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/GetPublicKeyCommand.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/console/GetPublicKeyCommand.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.runtime.console; +package pro.gravit.launcher.runtime.console; -import pro.gravit.launcher.client.runtime.LauncherEngine; +import pro.gravit.launcher.runtime.LauncherEngine; import pro.gravit.utils.command.Command; import pro.gravit.utils.helper.LogHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/ModulesCommand.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/console/ModulesCommand.java similarity index 86% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/ModulesCommand.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/console/ModulesCommand.java index e4d42437..060903e9 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/ModulesCommand.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/console/ModulesCommand.java @@ -1,10 +1,10 @@ -package pro.gravit.launcher.client.runtime.console; +package pro.gravit.launcher.runtime.console; -import pro.gravit.launcher.client.runtime.LauncherEngine; -import pro.gravit.launcher.client.runtime.managers.ConsoleManager; +import pro.gravit.launcher.runtime.LauncherEngine; +import pro.gravit.launcher.runtime.managers.ConsoleManager; import pro.gravit.launcher.core.LauncherTrustManager; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; import pro.gravit.utils.command.Command; import pro.gravit.utils.helper.LogHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/SignDataCommand.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/console/SignDataCommand.java similarity index 88% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/SignDataCommand.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/console/SignDataCommand.java index f74051cb..7be082d0 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/SignDataCommand.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/console/SignDataCommand.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.runtime.console; +package pro.gravit.launcher.runtime.console; -import pro.gravit.launcher.client.runtime.LauncherEngine; +import pro.gravit.launcher.runtime.LauncherEngine; import pro.gravit.utils.command.Command; import pro.gravit.utils.helper.LogHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/UnlockCommand.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/console/UnlockCommand.java similarity index 82% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/UnlockCommand.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/console/UnlockCommand.java index 4e1677c5..424949fb 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/UnlockCommand.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/console/UnlockCommand.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.console; +package pro.gravit.launcher.runtime.console; -import pro.gravit.launcher.client.runtime.managers.ConsoleManager; -import pro.gravit.launcher.client.runtime.managers.SettingsManager; +import pro.gravit.launcher.runtime.managers.ConsoleManager; +import pro.gravit.launcher.runtime.managers.SettingsManager; import pro.gravit.utils.command.Command; import pro.gravit.utils.helper.LogHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/test/PrintHardwareInfoCommand.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/console/test/PrintHardwareInfoCommand.java similarity index 95% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/test/PrintHardwareInfoCommand.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/console/test/PrintHardwareInfoCommand.java index 3c4a3112..675026f1 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/console/test/PrintHardwareInfoCommand.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/console/test/PrintHardwareInfoCommand.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.runtime.console.test; +package pro.gravit.launcher.runtime.console.test; -import pro.gravit.launcher.client.runtime.utils.HWIDProvider; +import pro.gravit.launcher.runtime.utils.HWIDProvider; import pro.gravit.utils.command.Command; import pro.gravit.utils.helper.LogHelper; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/ClientRuntimeProvider.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/debug/ClientRuntimeProvider.java similarity index 91% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/ClientRuntimeProvider.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/debug/ClientRuntimeProvider.java index 254bbce9..cac5dc09 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/ClientRuntimeProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/debug/ClientRuntimeProvider.java @@ -1,17 +1,17 @@ -package pro.gravit.launcher.client.runtime.debug; +package pro.gravit.launcher.runtime.debug; -import pro.gravit.launcher.ClientPermissions; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.client.api.AuthService; -import pro.gravit.launcher.client.api.ClientService; -import pro.gravit.launcher.client.runtime.LauncherEngine; -import pro.gravit.launcher.client.runtime.gui.RuntimeProvider; -import pro.gravit.launcher.events.request.AuthRequestEvent; -import pro.gravit.launcher.events.request.ProfilesRequestEvent; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.auth.AuthRequest; -import pro.gravit.launcher.request.update.ProfilesRequest; +import pro.gravit.launcher.base.ClientPermissions; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.api.AuthService; +import pro.gravit.launcher.base.api.ClientService; +import pro.gravit.launcher.runtime.LauncherEngine; +import pro.gravit.launcher.runtime.gui.RuntimeProvider; +import pro.gravit.launcher.base.events.request.AuthRequestEvent; +import pro.gravit.launcher.base.events.request.ProfilesRequestEvent; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.update.ProfilesRequest; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.launch.*; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugLauncherTrustManager.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/debug/DebugLauncherTrustManager.java similarity index 94% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugLauncherTrustManager.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/debug/DebugLauncherTrustManager.java index 3be634d1..cfebabde 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugLauncherTrustManager.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/debug/DebugLauncherTrustManager.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.runtime.debug; +package pro.gravit.launcher.runtime.debug; import pro.gravit.launcher.core.LauncherTrustManager; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugMain.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/debug/DebugMain.java similarity index 84% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugMain.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/debug/DebugMain.java index 39b33d2f..1d3ee6c3 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/debug/DebugMain.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/debug/DebugMain.java @@ -1,19 +1,19 @@ -package pro.gravit.launcher.client.runtime.debug; +package pro.gravit.launcher.runtime.debug; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherConfig; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.LauncherConfig; import pro.gravit.launcher.client.ClientLauncherMethods; -import pro.gravit.launcher.client.runtime.LauncherEngine; -import pro.gravit.launcher.client.runtime.client.RuntimeLauncherCoreModule; -import pro.gravit.launcher.client.runtime.managers.ConsoleManager; +import pro.gravit.launcher.runtime.LauncherEngine; +import pro.gravit.launcher.client.RuntimeLauncherCoreModule; +import pro.gravit.launcher.runtime.managers.ConsoleManager; import pro.gravit.launcher.start.RuntimeModuleManager; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.events.OfflineModeEvent; -import pro.gravit.launcher.modules.events.PreConfigPhase; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.RequestService; -import pro.gravit.launcher.request.websockets.OfflineRequestService; -import pro.gravit.launcher.request.websockets.StdWebSocketService; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.events.OfflineModeEvent; +import pro.gravit.launcher.base.modules.events.PreConfigPhase; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.RequestService; +import pro.gravit.launcher.base.request.websockets.OfflineRequestService; +import pro.gravit.launcher.base.request.websockets.StdWebSocketService; import pro.gravit.utils.helper.LogHelper; import java.lang.invoke.MethodHandles; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/NoRuntimeProvider.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/gui/NoRuntimeProvider.java similarity index 89% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/NoRuntimeProvider.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/gui/NoRuntimeProvider.java index 46ea445c..cb44fbab 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/NoRuntimeProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/gui/NoRuntimeProvider.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.runtime.gui; +package pro.gravit.launcher.runtime.gui; import javax.swing.*; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/RuntimeProvider.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/gui/RuntimeProvider.java similarity index 72% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/RuntimeProvider.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/gui/RuntimeProvider.java index 08f12cb2..2a99899d 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/gui/RuntimeProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/gui/RuntimeProvider.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.runtime.gui; +package pro.gravit.launcher.runtime.gui; public interface RuntimeProvider { void run(String[] args); diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/ConsoleManager.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/managers/ConsoleManager.java similarity index 85% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/ConsoleManager.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/managers/ConsoleManager.java index 0a13e180..67fc9e0f 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/ConsoleManager.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/managers/ConsoleManager.java @@ -1,10 +1,10 @@ -package pro.gravit.launcher.client.runtime.managers; +package pro.gravit.launcher.runtime.managers; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.client.runtime.LauncherEngine; -import pro.gravit.launcher.client.runtime.client.events.ClientUnlockConsoleEvent; -import pro.gravit.launcher.client.runtime.console.UnlockCommand; -import pro.gravit.launcher.client.runtime.console.test.PrintHardwareInfoCommand; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.runtime.LauncherEngine; +import pro.gravit.launcher.client.events.ClientUnlockConsoleEvent; +import pro.gravit.launcher.runtime.console.UnlockCommand; +import pro.gravit.launcher.runtime.console.test.PrintHardwareInfoCommand; import pro.gravit.utils.command.CommandHandler; import pro.gravit.utils.command.JLineCommandHandler; import pro.gravit.utils.command.StdCommandHandler; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/SettingsManager.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/managers/SettingsManager.java similarity index 79% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/SettingsManager.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/managers/SettingsManager.java index bff7307b..86ea4813 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/managers/SettingsManager.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/managers/SettingsManager.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.client.runtime.managers; +package pro.gravit.launcher.runtime.managers; -import pro.gravit.launcher.client.runtime.NewLauncherSettings; -import pro.gravit.launcher.client.runtime.client.DirBridge; -import pro.gravit.launcher.config.JsonConfigurable; +import pro.gravit.launcher.runtime.NewLauncherSettings; +import pro.gravit.launcher.runtime.client.DirBridge; +import pro.gravit.launcher.base.config.JsonConfigurable; import pro.gravit.utils.helper.LogHelper; public class SettingsManager extends JsonConfigurable { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/HWIDProvider.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/utils/HWIDProvider.java similarity index 96% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/HWIDProvider.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/utils/HWIDProvider.java index 4e1c8d4c..9154a793 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/HWIDProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/utils/HWIDProvider.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.client.runtime.utils; +package pro.gravit.launcher.runtime.utils; import oshi.SystemInfo; import oshi.hardware.*; import oshi.software.os.OperatingSystem; -import pro.gravit.launcher.request.secure.HardwareReportRequest; +import pro.gravit.launcher.base.request.secure.HardwareReportRequest; import java.util.List; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/LauncherUpdater.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/utils/LauncherUpdater.java similarity index 92% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/LauncherUpdater.java rename to Launcher/src/main/java/pro/gravit/launcher/runtime/utils/LauncherUpdater.java index f4998402..27d9edee 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/utils/LauncherUpdater.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/utils/LauncherUpdater.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.client.runtime.utils; +package pro.gravit.launcher.runtime.utils; -import pro.gravit.launcher.client.runtime.LauncherEngine; +import pro.gravit.launcher.runtime.LauncherEngine; import pro.gravit.launcher.core.LauncherInject; -import pro.gravit.launcher.request.update.LauncherRequest; +import pro.gravit.launcher.base.request.update.LauncherRequest; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.helper.SecurityHelper; @@ -22,7 +22,7 @@ import java.util.Arrays; import java.util.List; -import static pro.gravit.launcher.modern.Downloader.makeSSLSocketFactory; +import static pro.gravit.launcher.base.Downloader.makeSSLSocketFactory; public class LauncherUpdater { @LauncherInject("launcher.certificatePinning") diff --git a/LauncherAPI/build.gradle b/LauncherAPI/build.gradle index d50a567e..d66ee2a7 100644 --- a/LauncherAPI/build.gradle +++ b/LauncherAPI/build.gradle @@ -3,7 +3,6 @@ dependencies { api project(':LauncherCore') - compileOnly group: 'io.netty', name: 'netty-codec-http', version: rootProject['verNetty'] testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit'] } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/ClientPermissions.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/ClientPermissions.java similarity index 99% rename from LauncherAPI/src/main/java/pro/gravit/launcher/ClientPermissions.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/ClientPermissions.java index 6edb6178..bfa23a50 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/ClientPermissions.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/ClientPermissions.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.base; import pro.gravit.launcher.core.LauncherNetworkAPI; diff --git a/LauncherModernCore/src/main/java/pro/gravit/launcher/modern/Downloader.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/Downloader.java similarity index 99% rename from LauncherModernCore/src/main/java/pro/gravit/launcher/modern/Downloader.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/Downloader.java index 1d7e052d..fa8035de 100644 --- a/LauncherModernCore/src/main/java/pro/gravit/launcher/modern/Downloader.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/Downloader.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.modern; +package pro.gravit.launcher.base; import pro.gravit.launcher.core.CertificatePinningTrustManager; import pro.gravit.launcher.core.LauncherInject; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/Launcher.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/Launcher.java similarity index 97% rename from LauncherAPI/src/main/java/pro/gravit/launcher/Launcher.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/Launcher.java index 261053be..2c7e98b4 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/Launcher.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/Launcher.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.base; import pro.gravit.launcher.core.managers.GsonManager; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launcher.core.serialize.HInput; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.JVMHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/LauncherConfig.java similarity index 97% rename from LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/LauncherConfig.java index 4b923236..b0f92c46 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/LauncherConfig.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/LauncherConfig.java @@ -1,10 +1,10 @@ -package pro.gravit.launcher; +package pro.gravit.launcher.base; import pro.gravit.launcher.core.LauncherInject; import pro.gravit.launcher.core.LauncherInjectionConstructor; import pro.gravit.launcher.core.LauncherTrustManager; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModulesManager; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModulesManager; import pro.gravit.launcher.core.serialize.HInput; import pro.gravit.launcher.core.serialize.HOutput; import pro.gravit.launcher.core.serialize.stream.StreamObject; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/AuthService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/AuthService.java similarity index 80% rename from LauncherAPI/src/main/java/pro/gravit/launcher/client/api/AuthService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/api/AuthService.java index f6d99e5a..70750c57 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/AuthService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/AuthService.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.api; +package pro.gravit.launcher.base.api; -import pro.gravit.launcher.ClientPermissions; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.ClientPermissions; +import pro.gravit.launcher.base.profiles.ClientProfile; import java.util.List; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ClientService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/ClientService.java similarity index 93% rename from LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ClientService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/api/ClientService.java index f7964574..6228e8ea 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ClientService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/ClientService.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.api; +package pro.gravit.launcher.base.api; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.JVMHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ConfigService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/ConfigService.java similarity index 88% rename from LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ConfigService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/api/ConfigService.java index afa438f7..52809b6e 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/ConfigService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/ConfigService.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.api; +package pro.gravit.launcher.base.api; public class ConfigService { public static boolean disableLogging; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/KeyService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/KeyService.java similarity index 84% rename from LauncherAPI/src/main/java/pro/gravit/launcher/client/api/KeyService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/api/KeyService.java index 4b3eac7e..69354de3 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/client/api/KeyService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/KeyService.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.api; +package pro.gravit.launcher.base.api; import java.security.interfaces.ECPublicKey; import java.security.interfaces.RSAPublicKey; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/config/JsonConfigurable.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/config/JsonConfigurable.java similarity index 93% rename from LauncherAPI/src/main/java/pro/gravit/launcher/config/JsonConfigurable.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/config/JsonConfigurable.java index 482258d0..de468bf9 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/config/JsonConfigurable.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/config/JsonConfigurable.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.config; +package pro.gravit.launcher.base.config; import java.lang.reflect.Type; import java.nio.file.Path; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/config/JsonConfigurableInterface.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/config/JsonConfigurableInterface.java similarity index 96% rename from LauncherAPI/src/main/java/pro/gravit/launcher/config/JsonConfigurableInterface.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/config/JsonConfigurableInterface.java index 65c15c92..39686bbb 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/config/JsonConfigurableInterface.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/config/JsonConfigurableInterface.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.config; +package pro.gravit.launcher.base.config; import com.google.gson.Gson; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/config/SimpleConfig.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/config/SimpleConfig.java similarity index 96% rename from LauncherAPI/src/main/java/pro/gravit/launcher/config/SimpleConfig.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/config/SimpleConfig.java index 1ac1398c..78d3a380 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/config/SimpleConfig.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/config/SimpleConfig.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.config; +package pro.gravit.launcher.base.config; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/config/SimpleConfigurable.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/config/SimpleConfigurable.java similarity index 95% rename from LauncherAPI/src/main/java/pro/gravit/launcher/config/SimpleConfigurable.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/config/SimpleConfigurable.java index 7306728f..01def3d9 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/config/SimpleConfigurable.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/config/SimpleConfigurable.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.config; +package pro.gravit.launcher.base.config; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/ExtendedTokenRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/ExtendedTokenRequestEvent.java similarity index 78% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/ExtendedTokenRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/ExtendedTokenRequestEvent.java index 084d4a72..228392ae 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/ExtendedTokenRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/ExtendedTokenRequestEvent.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.events; +package pro.gravit.launcher.base.events; public interface ExtendedTokenRequestEvent { String getExtendedTokenName(); diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/NotificationEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/NotificationEvent.java similarity index 89% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/NotificationEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/NotificationEvent.java index 3b492876..51e9e19a 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/NotificationEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/NotificationEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.events; +package pro.gravit.launcher.base.events; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.request.WebSocketEvent; +import pro.gravit.launcher.base.request.WebSocketEvent; public class NotificationEvent implements WebSocketEvent { @LauncherNetworkAPI diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/RequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/RequestEvent.java similarity index 81% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/RequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/RequestEvent.java index 627ec74b..89c11b24 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/RequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/RequestEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.events; +package pro.gravit.launcher.base.events; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.request.WebSocketEvent; +import pro.gravit.launcher.base.request.WebSocketEvent; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AdditionalDataRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/AdditionalDataRequestEvent.java similarity index 77% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AdditionalDataRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/AdditionalDataRequestEvent.java index a0680b10..2308702b 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AdditionalDataRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/AdditionalDataRequestEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import java.util.Map; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AssetUploadInfoRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/AssetUploadInfoRequestEvent.java similarity index 83% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AssetUploadInfoRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/AssetUploadInfoRequestEvent.java index 34446fcc..1b2046cb 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AssetUploadInfoRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/AssetUploadInfoRequestEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import java.util.Set; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AuthRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/AuthRequestEvent.java similarity index 93% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AuthRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/AuthRequestEvent.java index 0a614634..a03007d3 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/AuthRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/AuthRequestEvent.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.ClientPermissions; +import pro.gravit.launcher.base.ClientPermissions; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.profiles.PlayerProfile; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.profiles.PlayerProfile; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/BatchProfileByUsernameRequestEvent.java similarity index 76% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/BatchProfileByUsernameRequestEvent.java index 1bf0aad0..7acc3677 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/BatchProfileByUsernameRequestEvent.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.profiles.PlayerProfile; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.profiles.PlayerProfile; public class BatchProfileByUsernameRequestEvent extends RequestEvent { @LauncherNetworkAPI diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/CheckServerRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/CheckServerRequestEvent.java similarity index 83% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/CheckServerRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/CheckServerRequestEvent.java index c66ee020..17576643 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/CheckServerRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/CheckServerRequestEvent.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.profiles.PlayerProfile; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.profiles.PlayerProfile; import java.util.Map; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/CurrentUserRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/CurrentUserRequestEvent.java similarity index 68% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/CurrentUserRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/CurrentUserRequestEvent.java index e2aa68ba..f9c67018 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/CurrentUserRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/CurrentUserRequestEvent.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.ClientPermissions; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.profiles.PlayerProfile; +import pro.gravit.launcher.base.ClientPermissions; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.profiles.PlayerProfile; public class CurrentUserRequestEvent extends RequestEvent { public final UserInfo userInfo; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ErrorRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ErrorRequestEvent.java similarity index 80% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ErrorRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ErrorRequestEvent.java index 9bb510d8..5fad1217 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ErrorRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ErrorRequestEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ExitRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ExitRequestEvent.java similarity index 76% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ExitRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ExitRequestEvent.java index 084615c4..f1acc2ee 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ExitRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ExitRequestEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; public class ExitRequestEvent extends RequestEvent { public final ExitReason reason; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/FeaturesRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/FeaturesRequestEvent.java similarity index 77% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/FeaturesRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/FeaturesRequestEvent.java index d6151b19..cec02ffc 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/FeaturesRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/FeaturesRequestEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import java.util.Map; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/FetchClientProfileKeyRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/FetchClientProfileKeyRequestEvent.java similarity index 91% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/FetchClientProfileKeyRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/FetchClientProfileKeyRequestEvent.java index 82958bac..c93fa7a9 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/FetchClientProfileKeyRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/FetchClientProfileKeyRequestEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import java.security.PrivateKey; import java.security.PublicKey; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAssetUploadUrlRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetAssetUploadUrlRequestEvent.java similarity index 83% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAssetUploadUrlRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetAssetUploadUrlRequestEvent.java index 9d4a7e66..a911df7b 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAssetUploadUrlRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetAssetUploadUrlRequestEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; public class GetAssetUploadUrlRequestEvent extends RequestEvent { public static final String FEATURE_NAME = "assetupload"; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetAvailabilityAuthRequestEvent.java similarity index 94% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetAvailabilityAuthRequestEvent.java index 629c82a4..efe0fbca 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetAvailabilityAuthRequestEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import pro.gravit.utils.TypeSerializeInterface; import java.util.List; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetPublicKeyRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetPublicKeyRequestEvent.java similarity index 87% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetPublicKeyRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetPublicKeyRequestEvent.java index aef691ca..068e5388 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetPublicKeyRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetPublicKeyRequestEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import java.security.interfaces.ECPublicKey; import java.security.interfaces.RSAPublicKey; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetSecureLevelInfoRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetSecureLevelInfoRequestEvent.java similarity index 83% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetSecureLevelInfoRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetSecureLevelInfoRequestEvent.java index 2b8fa051..cd583424 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetSecureLevelInfoRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/GetSecureLevelInfoRequestEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; public class GetSecureLevelInfoRequestEvent extends RequestEvent { public final byte[] verifySecureKey; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/HardwareReportRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/HardwareReportRequestEvent.java similarity index 81% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/HardwareReportRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/HardwareReportRequestEvent.java index e9198109..e0126fdb 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/HardwareReportRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/HardwareReportRequestEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.ExtendedTokenRequestEvent; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.ExtendedTokenRequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; public class HardwareReportRequestEvent extends RequestEvent implements ExtendedTokenRequestEvent { public String extendedToken; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/JoinServerRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/JoinServerRequestEvent.java similarity index 82% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/JoinServerRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/JoinServerRequestEvent.java index 519c2c8d..3edef722 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/JoinServerRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/JoinServerRequestEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/LauncherRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/LauncherRequestEvent.java similarity index 91% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/LauncherRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/LauncherRequestEvent.java index 9802973b..1cd8cc56 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/LauncherRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/LauncherRequestEvent.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.ExtendedTokenRequestEvent; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.ExtendedTokenRequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ProfileByUUIDRequestEvent.java similarity index 80% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ProfileByUUIDRequestEvent.java index 33c9aa43..dbdd3cfb 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ProfileByUUIDRequestEvent.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.profiles.PlayerProfile; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.profiles.PlayerProfile; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ProfileByUsernameRequestEvent.java similarity index 79% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ProfileByUsernameRequestEvent.java index 6675cdc7..3e532500 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ProfileByUsernameRequestEvent.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.profiles.PlayerProfile; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.profiles.PlayerProfile; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfilesRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ProfilesRequestEvent.java similarity index 78% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfilesRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ProfilesRequestEvent.java index 626f282e..bf182554 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/ProfilesRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/ProfilesRequestEvent.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.profiles.ClientProfile; import java.util.List; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/RefreshTokenRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/RefreshTokenRequestEvent.java similarity index 75% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/RefreshTokenRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/RefreshTokenRequestEvent.java index 0f1a5806..73a910a1 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/RefreshTokenRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/RefreshTokenRequestEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; public class RefreshTokenRequestEvent extends RequestEvent { public AuthRequestEvent.OAuthRequestEvent oauth; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/RestoreRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/RestoreRequestEvent.java similarity index 87% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/RestoreRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/RestoreRequestEvent.java index 6c9dd5a0..748a7e46 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/RestoreRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/RestoreRequestEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import java.util.List; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/SecurityReportRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/SecurityReportRequestEvent.java similarity index 88% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/SecurityReportRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/SecurityReportRequestEvent.java index 2c9af856..ba7c1a91 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/SecurityReportRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/SecurityReportRequestEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; public class SecurityReportRequestEvent extends RequestEvent { public final ReportAction action; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/SetProfileRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/SetProfileRequestEvent.java similarity index 76% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/SetProfileRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/SetProfileRequestEvent.java index 7dd5cbe1..b3a92dbb 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/SetProfileRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/SetProfileRequestEvent.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.profiles.ClientProfile; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateListRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/UpdateListRequestEvent.java similarity index 83% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateListRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/UpdateListRequestEvent.java index 7cfbc2ba..ba5962dc 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateListRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/UpdateListRequestEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import java.util.HashSet; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/UpdateRequestEvent.java similarity index 89% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/UpdateRequestEvent.java index 8c98b284..18ec2229 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/UpdateRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/UpdateRequestEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; import pro.gravit.launcher.core.hasher.HashedDir; public class UpdateRequestEvent extends RequestEvent { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/VerifySecureLevelKeyRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/VerifySecureLevelKeyRequestEvent.java similarity index 86% rename from LauncherAPI/src/main/java/pro/gravit/launcher/events/request/VerifySecureLevelKeyRequestEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/VerifySecureLevelKeyRequestEvent.java index 2c818107..754f3020 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/VerifySecureLevelKeyRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/events/request/VerifySecureLevelKeyRequestEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.events.request; +package pro.gravit.launcher.base.events.request; -import pro.gravit.launcher.events.ExtendedTokenRequestEvent; -import pro.gravit.launcher.events.RequestEvent; +import pro.gravit.launcher.base.events.ExtendedTokenRequestEvent; +import pro.gravit.launcher.base.events.RequestEvent; public class VerifySecureLevelKeyRequestEvent extends RequestEvent implements ExtendedTokenRequestEvent { public boolean needHardwareInfo; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherInitContext.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherInitContext.java similarity index 50% rename from LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherInitContext.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherInitContext.java index 7738c826..6edbb6ce 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherInitContext.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherInitContext.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.modules; +package pro.gravit.launcher.base.modules; public interface LauncherInitContext { } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModule.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModule.java similarity index 99% rename from LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModule.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModule.java index 26eee8be..6e1d2f68 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModule.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModule.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.modules; +package pro.gravit.launcher.base.modules; import pro.gravit.launcher.core.LauncherTrustManager; import pro.gravit.utils.Version; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModuleInfo.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModuleInfo.java similarity index 97% rename from LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModuleInfo.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModuleInfo.java index 0237a9ee..5b9e484b 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModuleInfo.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModuleInfo.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.modules; +package pro.gravit.launcher.base.modules; import pro.gravit.utils.Version; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModulesContext.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesContext.java similarity index 77% rename from LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModulesContext.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesContext.java index 317e2d31..5710af91 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModulesContext.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesContext.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.modules; +package pro.gravit.launcher.base.modules; public interface LauncherModulesContext { LauncherModulesManager getModulesManager(); diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModulesManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesManager.java similarity index 97% rename from LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModulesManager.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesManager.java index 0ac63a2c..4d3a30be 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModulesManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesManager.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.modules; +package pro.gravit.launcher.base.modules; import pro.gravit.utils.Version; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/ModulesConfigManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/ModulesConfigManager.java similarity index 87% rename from LauncherAPI/src/main/java/pro/gravit/launcher/modules/ModulesConfigManager.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/ModulesConfigManager.java index 570059a7..ee1364ce 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/ModulesConfigManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/ModulesConfigManager.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.modules; +package pro.gravit.launcher.base.modules; -import pro.gravit.launcher.config.SimpleConfigurable; +import pro.gravit.launcher.base.config.SimpleConfigurable; import java.nio.file.Path; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/ClosePhase.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/ClosePhase.java new file mode 100644 index 00000000..43235a4f --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/ClosePhase.java @@ -0,0 +1,6 @@ +package pro.gravit.launcher.base.modules.events; + +import pro.gravit.launcher.base.modules.LauncherModule; + +public class ClosePhase extends LauncherModule.Event { +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/InitPhase.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/InitPhase.java new file mode 100644 index 00000000..e2d18caf --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/InitPhase.java @@ -0,0 +1,6 @@ +package pro.gravit.launcher.base.modules.events; + +import pro.gravit.launcher.base.modules.LauncherModule; + +public class InitPhase extends LauncherModule.Event { +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/OfflineModeEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/OfflineModeEvent.java similarity index 54% rename from LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/OfflineModeEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/OfflineModeEvent.java index 28a92579..9c083864 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/OfflineModeEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/OfflineModeEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.modules.events; +package pro.gravit.launcher.base.modules.events; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.request.RequestService; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.request.RequestService; public class OfflineModeEvent extends LauncherModule.Event { public RequestService service; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/PostInitPhase.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/PostInitPhase.java new file mode 100644 index 00000000..7fe2de69 --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/PostInitPhase.java @@ -0,0 +1,6 @@ +package pro.gravit.launcher.base.modules.events; + +import pro.gravit.launcher.base.modules.LauncherModule; + +public class PostInitPhase extends LauncherModule.Event { +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/PreConfigPhase.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/PreConfigPhase.java new file mode 100644 index 00000000..5d5e1e06 --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/PreConfigPhase.java @@ -0,0 +1,6 @@ +package pro.gravit.launcher.base.modules.events; + +import pro.gravit.launcher.base.modules.LauncherModule; + +public class PreConfigPhase extends LauncherModule.Event { +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/PreGsonPhase.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/PreGsonPhase.java similarity index 69% rename from LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/PreGsonPhase.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/PreGsonPhase.java index b47f2a6b..470a6fbf 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/PreGsonPhase.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/events/PreGsonPhase.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.modules.events; +package pro.gravit.launcher.base.modules.events; import com.google.gson.GsonBuilder; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModule; public class PreGsonPhase extends LauncherModule.Event { public final GsonBuilder gsonBuilder; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleContext.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleContext.java similarity index 71% rename from LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleContext.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleContext.java index b6b2348d..2547f594 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleContext.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleContext.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.modules.impl; +package pro.gravit.launcher.base.modules.impl; -import pro.gravit.launcher.modules.LauncherModulesContext; -import pro.gravit.launcher.modules.LauncherModulesManager; -import pro.gravit.launcher.modules.ModulesConfigManager; +import pro.gravit.launcher.base.modules.LauncherModulesContext; +import pro.gravit.launcher.base.modules.LauncherModulesManager; +import pro.gravit.launcher.base.modules.ModulesConfigManager; public class SimpleModuleContext implements LauncherModulesContext { public final LauncherModulesManager modulesManager; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleManager.java similarity index 98% rename from LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleManager.java index 6156b709..97bf724f 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleManager.java @@ -1,8 +1,7 @@ -package pro.gravit.launcher.modules.impl; +package pro.gravit.launcher.base.modules.impl; import pro.gravit.launcher.core.LauncherTrustManager; -import pro.gravit.launcher.client.runtime.managers.SimpleModulesConfigManager; -import pro.gravit.launcher.modules.*; +import pro.gravit.launcher.base.modules.*; import pro.gravit.utils.PublicURLClassLoader; import pro.gravit.utils.Version; import pro.gravit.utils.helper.IOHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/SimpleModulesConfigManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModulesConfigManager.java similarity index 87% rename from LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/SimpleModulesConfigManager.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModulesConfigManager.java index 3a57e209..9ac9b5df 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/client/runtime/managers/SimpleModulesConfigManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModulesConfigManager.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.managers; +package pro.gravit.launcher.base.modules.impl; -import pro.gravit.launcher.config.SimpleConfigurable; -import pro.gravit.launcher.modules.ModulesConfigManager; +import pro.gravit.launcher.base.config.SimpleConfigurable; +import pro.gravit.launcher.base.modules.ModulesConfigManager; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/ClientProfile.java similarity index 98% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/ClientProfile.java index 19850f00..810e96b0 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/ClientProfile.java @@ -1,11 +1,11 @@ -package pro.gravit.launcher.profiles; +package pro.gravit.launcher.base.profiles; import com.google.gson.*; import pro.gravit.launcher.core.LauncherNetworkAPI; import pro.gravit.launcher.core.hasher.FileNameMatcher; -import pro.gravit.launcher.profiles.optional.OptionalDepend; -import pro.gravit.launcher.profiles.optional.OptionalFile; -import pro.gravit.launcher.profiles.optional.triggers.OptionalTrigger; +import pro.gravit.launcher.base.profiles.optional.OptionalDepend; +import pro.gravit.launcher.base.profiles.optional.OptionalFile; +import pro.gravit.launcher.base.profiles.optional.triggers.OptionalTrigger; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.VerifyHelper; import pro.gravit.utils.launch.LaunchOptions; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfileBuilder.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/ClientProfileBuilder.java similarity index 98% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfileBuilder.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/ClientProfileBuilder.java index 5e6a09d6..a518db5c 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfileBuilder.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/ClientProfileBuilder.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.profiles; +package pro.gravit.launcher.base.profiles; -import pro.gravit.launcher.profiles.optional.OptionalFile; +import pro.gravit.launcher.base.profiles.optional.OptionalFile; import java.util.*; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfileVersions.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/ClientProfileVersions.java similarity index 97% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfileVersions.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/ClientProfileVersions.java index e1c70b82..5d21aced 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfileVersions.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/ClientProfileVersions.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.profiles; +package pro.gravit.launcher.base.profiles; public class ClientProfileVersions { private ClientProfileVersions() { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/PlayerProfile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/PlayerProfile.java similarity index 97% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/PlayerProfile.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/PlayerProfile.java index b08cff5d..e0190993 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/PlayerProfile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/PlayerProfile.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.profiles; +package pro.gravit.launcher.base.profiles; import pro.gravit.utils.helper.IOHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/Texture.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/Texture.java similarity index 98% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/Texture.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/Texture.java index 1e4a637e..7f917e85 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/Texture.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/Texture.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.profiles; +package pro.gravit.launcher.base.profiles; import pro.gravit.launcher.core.serialize.HOutput; import pro.gravit.launcher.core.serialize.stream.StreamObject; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalDepend.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/OptionalDepend.java similarity index 72% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalDepend.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/OptionalDepend.java index 55c7c0a5..53feb0ee 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalDepend.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/OptionalDepend.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.profiles.optional; +package pro.gravit.launcher.base.profiles.optional; import pro.gravit.launcher.core.LauncherNetworkAPI; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/OptionalFile.java similarity index 87% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/OptionalFile.java index 1884e443..4d49cf23 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/OptionalFile.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.profiles.optional; +package pro.gravit.launcher.base.profiles.optional; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.profiles.optional.actions.OptionalAction; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalAction; import java.util.List; import java.util.Objects; @@ -18,7 +18,7 @@ public class OptionalFile { @LauncherNetworkAPI public String info; @LauncherNetworkAPI - public List triggersList; + public List triggersList; @LauncherNetworkAPI public OptionalDepend[] dependenciesFile; @LauncherNetworkAPI diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalView.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/OptionalView.java similarity index 97% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalView.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/OptionalView.java index 25fdb266..d257215e 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalView.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/OptionalView.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.profiles.optional; +package pro.gravit.launcher.base.profiles.optional; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.optional.actions.OptionalAction; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalAction; import java.util.HashMap; import java.util.HashSet; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalAction.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalAction.java similarity index 91% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalAction.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalAction.java index aabc8ccc..dd2a7437 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalAction.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalAction.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.profiles.optional.actions; +package pro.gravit.launcher.base.profiles.optional.actions; import pro.gravit.utils.ProviderMap; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionClassPath.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionClassPath.java similarity index 87% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionClassPath.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionClassPath.java index a9093ff2..51a09abf 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionClassPath.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionClassPath.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.profiles.optional.actions; +package pro.gravit.launcher.base.profiles.optional.actions; public class OptionalActionClassPath extends OptionalAction { public String[] args; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionClientArgs.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionClientArgs.java similarity index 81% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionClientArgs.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionClientArgs.java index 90bf980d..be164f6c 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionClientArgs.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionClientArgs.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.profiles.optional.actions; +package pro.gravit.launcher.base.profiles.optional.actions; import java.util.List; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionFile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionFile.java similarity index 95% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionFile.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionFile.java index 9f831635..00b0c3e8 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionFile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionFile.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.profiles.optional.actions; +package pro.gravit.launcher.base.profiles.optional.actions; import pro.gravit.launcher.core.hasher.HashedDir; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionJvmArgs.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionJvmArgs.java similarity index 80% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionJvmArgs.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionJvmArgs.java index 328a224c..900e78bc 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/actions/OptionalActionJvmArgs.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/actions/OptionalActionJvmArgs.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.profiles.optional.actions; +package pro.gravit.launcher.base.profiles.optional.actions; import java.util.List; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/ArchTrigger.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/ArchTrigger.java similarity index 70% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/ArchTrigger.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/ArchTrigger.java index b507186a..19ea42f6 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/ArchTrigger.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/ArchTrigger.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.profiles.optional.triggers; +package pro.gravit.launcher.base.profiles.optional.triggers; -import pro.gravit.launcher.profiles.optional.OptionalFile; +import pro.gravit.launcher.base.profiles.optional.OptionalFile; import pro.gravit.utils.helper.JVMHelper; public class ArchTrigger extends OptionalTrigger { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/JavaTrigger.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/JavaTrigger.java similarity index 89% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/JavaTrigger.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/JavaTrigger.java index 46c08852..aa5e356f 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/JavaTrigger.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/JavaTrigger.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.profiles.optional.triggers; +package pro.gravit.launcher.base.profiles.optional.triggers; -import pro.gravit.launcher.profiles.optional.OptionalFile; +import pro.gravit.launcher.base.profiles.optional.OptionalFile; import pro.gravit.utils.helper.JavaHelper; public class JavaTrigger extends OptionalTrigger { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OSTrigger.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/OSTrigger.java similarity index 73% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OSTrigger.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/OSTrigger.java index edbd4590..00bcd3a1 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OSTrigger.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/OSTrigger.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.profiles.optional.triggers; +package pro.gravit.launcher.base.profiles.optional.triggers; -import pro.gravit.launcher.profiles.optional.OptionalFile; +import pro.gravit.launcher.base.profiles.optional.OptionalFile; import pro.gravit.utils.helper.JVMHelper; public class OSTrigger extends OptionalTrigger { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OptionalTrigger.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/OptionalTrigger.java similarity index 88% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OptionalTrigger.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/OptionalTrigger.java index 8ba54011..36419867 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OptionalTrigger.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/OptionalTrigger.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.profiles.optional.triggers; +package pro.gravit.launcher.base.profiles.optional.triggers; -import pro.gravit.launcher.profiles.optional.OptionalFile; +import pro.gravit.launcher.base.profiles.optional.OptionalFile; import pro.gravit.utils.ProviderMap; public abstract class OptionalTrigger { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OptionalTriggerContext.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/OptionalTriggerContext.java similarity index 62% rename from LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OptionalTriggerContext.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/OptionalTriggerContext.java index 46598ff2..cb6b3839 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/triggers/OptionalTriggerContext.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/profiles/optional/triggers/OptionalTriggerContext.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.profiles.optional.triggers; +package pro.gravit.launcher.base.profiles.optional.triggers; -import pro.gravit.launcher.ClientPermissions; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.PlayerProfile; +import pro.gravit.launcher.base.ClientPermissions; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.PlayerProfile; import pro.gravit.utils.helper.JavaHelper; public interface OptionalTriggerContext { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/JsonResultSerializeAdapter.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/JsonResultSerializeAdapter.java similarity index 93% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/JsonResultSerializeAdapter.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/JsonResultSerializeAdapter.java index 3a46e1d3..b70471b6 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/JsonResultSerializeAdapter.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/JsonResultSerializeAdapter.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.request; +package pro.gravit.launcher.base.request; import com.google.gson.*; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/PingRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/PingRequest.java similarity index 76% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/PingRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/PingRequest.java index ee526029..249e567f 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/PingRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/PingRequest.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.request; +package pro.gravit.launcher.base.request; public final class PingRequest extends Request { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/Request.java similarity index 94% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/Request.java index 593e309b..d91f646f 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/Request.java @@ -1,14 +1,14 @@ -package pro.gravit.launcher.request; +package pro.gravit.launcher.base.request; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.request.AuthRequestEvent; -import pro.gravit.launcher.events.request.CurrentUserRequestEvent; -import pro.gravit.launcher.events.request.RefreshTokenRequestEvent; -import pro.gravit.launcher.events.request.RestoreRequestEvent; -import pro.gravit.launcher.request.auth.RefreshTokenRequest; -import pro.gravit.launcher.request.auth.RestoreRequest; -import pro.gravit.launcher.request.websockets.StdWebSocketService; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.events.request.AuthRequestEvent; +import pro.gravit.launcher.base.events.request.CurrentUserRequestEvent; +import pro.gravit.launcher.base.events.request.RefreshTokenRequestEvent; +import pro.gravit.launcher.base.events.request.RestoreRequestEvent; +import pro.gravit.launcher.base.request.auth.RefreshTokenRequest; +import pro.gravit.launcher.base.request.auth.RestoreRequest; +import pro.gravit.launcher.base.request.websockets.StdWebSocketService; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; import pro.gravit.utils.helper.LogHelper; import java.util.*; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/RequestException.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/RequestException.java similarity index 92% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/RequestException.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/RequestException.java index 93285c79..429b0c73 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/RequestException.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/RequestException.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.request; +package pro.gravit.launcher.base.request; import java.io.IOException; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/RequestService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/RequestService.java similarity index 96% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/RequestService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/RequestService.java index 41142326..bad2ebd1 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/RequestService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/RequestService.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.request; +package pro.gravit.launcher.base.request; import java.io.IOException; import java.util.concurrent.CompletableFuture; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/WebSocketEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/WebSocketEvent.java similarity index 83% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/WebSocketEvent.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/WebSocketEvent.java index 59d259d4..f72b8113 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/WebSocketEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/WebSocketEvent.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.request; +package pro.gravit.launcher.base.request; import pro.gravit.utils.TypeSerializeInterface; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AdditionalDataRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/AdditionalDataRequest.java similarity index 70% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AdditionalDataRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/AdditionalDataRequest.java index 32d10863..56e4037c 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AdditionalDataRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/AdditionalDataRequest.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.auth; +package pro.gravit.launcher.base.request.auth; -import pro.gravit.launcher.events.request.AdditionalDataRequestEvent; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.events.request.AdditionalDataRequestEvent; +import pro.gravit.launcher.base.request.Request; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/AuthRequest.java similarity index 88% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/AuthRequest.java index da3081c2..5cbc489f 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/AuthRequest.java @@ -1,10 +1,10 @@ -package pro.gravit.launcher.request.auth; +package pro.gravit.launcher.base.request.auth; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.request.AuthRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.auth.password.*; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.events.request.AuthRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.auth.password.*; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; import pro.gravit.utils.ProviderMap; public final class AuthRequest extends Request implements WebSocketRequest { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/CheckServerRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/CheckServerRequest.java similarity index 80% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/CheckServerRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/CheckServerRequest.java index 998fb903..aa23f58c 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/CheckServerRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/CheckServerRequest.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.request.auth; +package pro.gravit.launcher.base.request.auth; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.request.CheckServerRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.events.request.CheckServerRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; import pro.gravit.utils.helper.VerifyHelper; public final class CheckServerRequest extends Request implements WebSocketRequest { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/CurrentUserRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/CurrentUserRequest.java new file mode 100644 index 00000000..0ed74fa0 --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/CurrentUserRequest.java @@ -0,0 +1,11 @@ +package pro.gravit.launcher.base.request.auth; + +import pro.gravit.launcher.base.events.request.CurrentUserRequestEvent; +import pro.gravit.launcher.base.request.Request; + +public class CurrentUserRequest extends Request { + @Override + public String getType() { + return "currentUser"; + } +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/ExitRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/ExitRequest.java similarity index 77% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/ExitRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/ExitRequest.java index 240c27a3..d0c2c3bf 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/ExitRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/ExitRequest.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.auth; +package pro.gravit.launcher.base.request.auth; -import pro.gravit.launcher.events.request.ExitRequestEvent; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.events.request.ExitRequestEvent; +import pro.gravit.launcher.base.request.Request; public class ExitRequest extends Request { public final boolean exitAll; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/FetchClientProfileKeyRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/FetchClientProfileKeyRequest.java similarity index 56% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/FetchClientProfileKeyRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/FetchClientProfileKeyRequest.java index 32fcf698..96104ce8 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/FetchClientProfileKeyRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/FetchClientProfileKeyRequest.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.auth; +package pro.gravit.launcher.base.request.auth; -import pro.gravit.launcher.events.request.FetchClientProfileKeyRequestEvent; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.events.request.FetchClientProfileKeyRequestEvent; +import pro.gravit.launcher.base.request.Request; public class FetchClientProfileKeyRequest extends Request { public FetchClientProfileKeyRequest() { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/GetAvailabilityAuthRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/GetAvailabilityAuthRequest.java similarity index 61% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/GetAvailabilityAuthRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/GetAvailabilityAuthRequest.java index 15092d2a..75e856f6 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/GetAvailabilityAuthRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/GetAvailabilityAuthRequest.java @@ -1,12 +1,12 @@ -package pro.gravit.launcher.request.auth; +package pro.gravit.launcher.base.request.auth; -import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.auth.details.AuthLoginOnlyDetails; -import pro.gravit.launcher.request.auth.details.AuthPasswordDetails; -import pro.gravit.launcher.request.auth.details.AuthTotpDetails; -import pro.gravit.launcher.request.auth.details.AuthWebViewDetails; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.auth.details.AuthLoginOnlyDetails; +import pro.gravit.launcher.base.request.auth.details.AuthPasswordDetails; +import pro.gravit.launcher.base.request.auth.details.AuthTotpDetails; +import pro.gravit.launcher.base.request.auth.details.AuthWebViewDetails; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; import pro.gravit.utils.ProviderMap; public class GetAvailabilityAuthRequest extends Request implements WebSocketRequest { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/GetPublicKeyRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/GetPublicKeyRequest.java similarity index 54% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/GetPublicKeyRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/GetPublicKeyRequest.java index 5119696c..3e6ae226 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/GetPublicKeyRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/GetPublicKeyRequest.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.auth; +package pro.gravit.launcher.base.request.auth; -import pro.gravit.launcher.events.request.GetPublicKeyRequestEvent; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.events.request.GetPublicKeyRequestEvent; +import pro.gravit.launcher.base.request.Request; public class GetPublicKeyRequest extends Request { public GetPublicKeyRequest() { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/JoinServerRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/JoinServerRequest.java similarity index 81% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/JoinServerRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/JoinServerRequest.java index 685c171d..41232121 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/JoinServerRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/JoinServerRequest.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.request.auth; +package pro.gravit.launcher.base.request.auth; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.request.JoinServerRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.events.request.JoinServerRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; import pro.gravit.utils.helper.VerifyHelper; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/RefreshTokenRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/RefreshTokenRequest.java similarity index 68% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/RefreshTokenRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/RefreshTokenRequest.java index 0daa585e..5b48a8cb 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/RefreshTokenRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/RefreshTokenRequest.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.auth; +package pro.gravit.launcher.base.request.auth; -import pro.gravit.launcher.events.request.RefreshTokenRequestEvent; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.events.request.RefreshTokenRequestEvent; +import pro.gravit.launcher.base.request.Request; public class RefreshTokenRequest extends Request { public String authId; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/RestoreRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/RestoreRequest.java similarity index 78% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/RestoreRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/RestoreRequest.java index d23942b9..ff7b6471 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/RestoreRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/RestoreRequest.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.auth; +package pro.gravit.launcher.base.request.auth; -import pro.gravit.launcher.events.request.RestoreRequestEvent; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.events.request.RestoreRequestEvent; +import pro.gravit.launcher.base.request.Request; import java.util.Map; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/SetProfileRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/SetProfileRequest.java similarity index 57% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/SetProfileRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/SetProfileRequest.java index 9948243c..8e99693f 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/SetProfileRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/SetProfileRequest.java @@ -1,10 +1,10 @@ -package pro.gravit.launcher.request.auth; +package pro.gravit.launcher.base.request.auth; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.request.SetProfileRequestEvent; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.events.request.SetProfileRequestEvent; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; public class SetProfileRequest extends Request implements WebSocketRequest { @LauncherNetworkAPI diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthLoginOnlyDetails.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthLoginOnlyDetails.java similarity index 57% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthLoginOnlyDetails.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthLoginOnlyDetails.java index 01b049b4..a5813a17 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthLoginOnlyDetails.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthLoginOnlyDetails.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.request.auth.details; +package pro.gravit.launcher.base.request.auth.details; -import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent; +import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent; public class AuthLoginOnlyDetails implements GetAvailabilityAuthRequestEvent.AuthAvailabilityDetails { @Override diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthPasswordDetails.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthPasswordDetails.java similarity index 57% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthPasswordDetails.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthPasswordDetails.java index 1f1022fb..825fa36f 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthPasswordDetails.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthPasswordDetails.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.request.auth.details; +package pro.gravit.launcher.base.request.auth.details; -import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent; +import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent; public class AuthPasswordDetails implements GetAvailabilityAuthRequestEvent.AuthAvailabilityDetails { @Override diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthTotpDetails.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthTotpDetails.java similarity index 77% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthTotpDetails.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthTotpDetails.java index df0c5ce2..80c4048e 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthTotpDetails.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthTotpDetails.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.request.auth.details; +package pro.gravit.launcher.base.request.auth.details; -import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent; +import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent; public class AuthTotpDetails implements GetAvailabilityAuthRequestEvent.AuthAvailabilityDetails { public final String alg; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthWebViewDetails.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthWebViewDetails.java similarity index 85% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthWebViewDetails.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthWebViewDetails.java index 25d30cec..3090d251 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/details/AuthWebViewDetails.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/details/AuthWebViewDetails.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.request.auth.details; +package pro.gravit.launcher.base.request.auth.details; -import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent; +import pro.gravit.launcher.base.events.request.GetAvailabilityAuthRequestEvent; public class AuthWebViewDetails implements GetAvailabilityAuthRequestEvent.AuthAvailabilityDetails { public final String url; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/Auth2FAPassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/Auth2FAPassword.java similarity index 81% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/Auth2FAPassword.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/Auth2FAPassword.java index d6b7baa5..05672942 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/Auth2FAPassword.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/Auth2FAPassword.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.request.auth.password; +package pro.gravit.launcher.base.request.auth.password; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; public class Auth2FAPassword implements AuthRequest.AuthPasswordInterface { public AuthRequest.AuthPasswordInterface firstPassword; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthAESPassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthAESPassword.java similarity index 76% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthAESPassword.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthAESPassword.java index 545cd5a3..7ecfb921 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthAESPassword.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthAESPassword.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.auth.password; +package pro.gravit.launcher.base.request.auth.password; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; public class AuthAESPassword implements AuthRequest.AuthPasswordInterface { @LauncherNetworkAPI diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthCodePassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthCodePassword.java similarity index 69% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthCodePassword.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthCodePassword.java index d9595e34..5b3c6e03 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthCodePassword.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthCodePassword.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.request.auth.password; +package pro.gravit.launcher.base.request.auth.password; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; public class AuthCodePassword implements AuthRequest.AuthPasswordInterface { public final String code; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthMultiPassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthMultiPassword.java similarity index 79% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthMultiPassword.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthMultiPassword.java index ddc9871c..829b57dd 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthMultiPassword.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthMultiPassword.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.request.auth.password; +package pro.gravit.launcher.base.request.auth.password; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; import java.util.List; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthOAuthPassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthOAuthPassword.java similarity index 87% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthOAuthPassword.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthOAuthPassword.java index 9c72e5b0..810f8aaf 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthOAuthPassword.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthOAuthPassword.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.request.auth.password; +package pro.gravit.launcher.base.request.auth.password; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; public class AuthOAuthPassword implements AuthRequest.AuthPasswordInterface { public final String accessToken; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthPlainPassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthPlainPassword.java similarity index 75% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthPlainPassword.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthPlainPassword.java index 1f0714b1..41f4caf4 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthPlainPassword.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthPlainPassword.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.auth.password; +package pro.gravit.launcher.base.request.auth.password; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; public class AuthPlainPassword implements AuthRequest.AuthPasswordInterface { @LauncherNetworkAPI diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthRSAPassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthRSAPassword.java similarity index 72% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthRSAPassword.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthRSAPassword.java index cf126905..aeae77bb 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthRSAPassword.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthRSAPassword.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.request.auth.password; +package pro.gravit.launcher.base.request.auth.password; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; public class AuthRSAPassword implements AuthRequest.AuthPasswordInterface { public final byte[] password; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthSignaturePassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthSignaturePassword.java similarity index 78% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthSignaturePassword.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthSignaturePassword.java index 7a2f4eae..cb3ccbe0 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthSignaturePassword.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthSignaturePassword.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.request.auth.password; +package pro.gravit.launcher.base.request.auth.password; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; public class AuthSignaturePassword implements AuthRequest.AuthPasswordInterface { public byte[] signature; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthTOTPPassword.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthTOTPPassword.java similarity index 60% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthTOTPPassword.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthTOTPPassword.java index 96679d29..4ddccec6 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/password/AuthTOTPPassword.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/auth/password/AuthTOTPPassword.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.request.auth.password; +package pro.gravit.launcher.base.request.auth.password; -import pro.gravit.launcher.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.AuthRequest; public class AuthTOTPPassword implements AuthRequest.AuthPasswordInterface { public String totp; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/cabinet/AssetUploadInfoRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/cabinet/AssetUploadInfoRequest.java new file mode 100644 index 00000000..be28f937 --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/cabinet/AssetUploadInfoRequest.java @@ -0,0 +1,11 @@ +package pro.gravit.launcher.base.request.cabinet; + +import pro.gravit.launcher.base.events.request.AssetUploadInfoRequestEvent; +import pro.gravit.launcher.base.request.Request; + +public class AssetUploadInfoRequest extends Request { + @Override + public String getType() { + return "assetUploadInfo"; + } +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/cabinet/GetAssetUploadUrl.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/cabinet/GetAssetUploadUrl.java similarity index 63% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/cabinet/GetAssetUploadUrl.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/cabinet/GetAssetUploadUrl.java index 56d9d976..fb1ef584 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/cabinet/GetAssetUploadUrl.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/cabinet/GetAssetUploadUrl.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.cabinet; +package pro.gravit.launcher.base.request.cabinet; -import pro.gravit.launcher.events.request.GetAssetUploadUrlRequestEvent; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.events.request.GetAssetUploadUrlRequestEvent; +import pro.gravit.launcher.base.request.Request; public class GetAssetUploadUrl extends Request { public String name; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/management/FeaturesRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/management/FeaturesRequest.java new file mode 100644 index 00000000..3e3ced73 --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/management/FeaturesRequest.java @@ -0,0 +1,11 @@ +package pro.gravit.launcher.base.request.management; + +import pro.gravit.launcher.base.events.request.FeaturesRequestEvent; +import pro.gravit.launcher.base.request.Request; + +public class FeaturesRequest extends Request { + @Override + public String getType() { + return "features"; + } +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/GetSecureLevelInfoRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/GetSecureLevelInfoRequest.java similarity index 50% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/GetSecureLevelInfoRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/GetSecureLevelInfoRequest.java index 47eb594e..b788d807 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/GetSecureLevelInfoRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/GetSecureLevelInfoRequest.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.secure; +package pro.gravit.launcher.base.request.secure; -import pro.gravit.launcher.events.request.GetSecureLevelInfoRequestEvent; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.events.request.GetSecureLevelInfoRequestEvent; +import pro.gravit.launcher.base.request.Request; public class GetSecureLevelInfoRequest extends Request { @Override diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/HardwareReportRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/HardwareReportRequest.java similarity index 89% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/HardwareReportRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/HardwareReportRequest.java index 1b7e2cb9..ebe1434f 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/HardwareReportRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/HardwareReportRequest.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.secure; +package pro.gravit.launcher.base.request.secure; -import pro.gravit.launcher.events.request.HardwareReportRequestEvent; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.events.request.HardwareReportRequestEvent; +import pro.gravit.launcher.base.request.Request; import java.util.Base64; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/SecurityReportRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/SecurityReportRequest.java similarity index 93% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/SecurityReportRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/SecurityReportRequest.java index 6048353a..eb4e2fc4 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/SecurityReportRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/SecurityReportRequest.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.secure; +package pro.gravit.launcher.base.request.secure; -import pro.gravit.launcher.events.request.SecurityReportRequestEvent; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.events.request.SecurityReportRequestEvent; +import pro.gravit.launcher.base.request.Request; public final class SecurityReportRequest extends Request { public final String reportType; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/VerifySecureLevelKeyRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/VerifySecureLevelKeyRequest.java similarity index 69% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/VerifySecureLevelKeyRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/VerifySecureLevelKeyRequest.java index b1d0bdb9..31b3e70c 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/secure/VerifySecureLevelKeyRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/secure/VerifySecureLevelKeyRequest.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.request.secure; +package pro.gravit.launcher.base.request.secure; -import pro.gravit.launcher.events.request.VerifySecureLevelKeyRequestEvent; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.events.request.VerifySecureLevelKeyRequestEvent; +import pro.gravit.launcher.base.request.Request; public class VerifySecureLevelKeyRequest extends Request { public final byte[] publicKey; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/LauncherRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/LauncherRequest.java similarity index 80% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/update/LauncherRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/LauncherRequest.java index 4e8d0be7..f84bd812 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/LauncherRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/LauncherRequest.java @@ -1,11 +1,11 @@ -package pro.gravit.launcher.request.update; +package pro.gravit.launcher.base.request.update; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.request.LauncherRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.RequestService; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.events.request.LauncherRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.RequestService; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.helper.SecurityHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/ProfilesRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/ProfilesRequest.java new file mode 100644 index 00000000..758831b4 --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/ProfilesRequest.java @@ -0,0 +1,13 @@ +package pro.gravit.launcher.base.request.update; + +import pro.gravit.launcher.base.events.request.ProfilesRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; + +public final class ProfilesRequest extends Request implements WebSocketRequest { + + @Override + public String getType() { + return "profiles"; + } +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/UpdateListRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/UpdateListRequest.java new file mode 100644 index 00000000..1406e132 --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/UpdateListRequest.java @@ -0,0 +1,13 @@ +package pro.gravit.launcher.base.request.update; + +import pro.gravit.launcher.base.events.request.UpdateListRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; + +public final class UpdateListRequest extends Request implements WebSocketRequest { + + @Override + public String getType() { + return "updateList"; + } +} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/UpdateRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/UpdateRequest.java similarity index 62% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/update/UpdateRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/UpdateRequest.java index b851b55c..f4ad831e 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/UpdateRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/update/UpdateRequest.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.request.update; +package pro.gravit.launcher.base.request.update; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.request.UpdateRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.events.request.UpdateRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; public final class UpdateRequest extends Request implements WebSocketRequest { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/uuid/BatchProfileByUsernameRequest.java similarity index 79% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/uuid/BatchProfileByUsernameRequest.java index 8f4f3c4f..65509418 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/uuid/BatchProfileByUsernameRequest.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.request.uuid; +package pro.gravit.launcher.base.request.uuid; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.request.BatchProfileByUsernameRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.events.request.BatchProfileByUsernameRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; import pro.gravit.utils.helper.IOHelper; import java.io.IOException; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUUIDRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/uuid/ProfileByUUIDRequest.java similarity index 66% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUUIDRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/uuid/ProfileByUUIDRequest.java index ea95fa98..cebec5a4 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUUIDRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/uuid/ProfileByUUIDRequest.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.request.uuid; +package pro.gravit.launcher.base.request.uuid; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.request.ProfileByUUIDRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.events.request.ProfileByUUIDRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; import java.util.Objects; import java.util.UUID; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUsernameRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/uuid/ProfileByUsernameRequest.java similarity index 63% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUsernameRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/uuid/ProfileByUsernameRequest.java index 784f710f..4638b574 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/ProfileByUsernameRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/uuid/ProfileByUsernameRequest.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.request.uuid; +package pro.gravit.launcher.base.request.uuid; import pro.gravit.launcher.core.LauncherNetworkAPI; -import pro.gravit.launcher.events.request.ProfileByUsernameRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.websockets.WebSocketRequest; +import pro.gravit.launcher.base.events.request.ProfileByUsernameRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.websockets.WebSocketRequest; public final class ProfileByUsernameRequest extends Request implements WebSocketRequest { @LauncherNetworkAPI diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java new file mode 100644 index 00000000..7f65dadf --- /dev/null +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java @@ -0,0 +1,112 @@ +package pro.gravit.launcher.base.request.websockets; + +import pro.gravit.launcher.base.Downloader; +import pro.gravit.utils.helper.LogHelper; + +import javax.net.ssl.SSLException; +import java.io.IOException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.WebSocket; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateException; +import java.time.Duration; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Consumer; + +public abstract class ClientJSONPoint implements WebSocket.Listener { + private static final AtomicInteger counter = new AtomicInteger(); + private final URI uri; + public boolean isClosed; + private final WebSocket.Builder webSocketBuilder; + protected HttpClient httpClient; + protected WebSocket webSocket; + protected boolean ssl = false; + protected int port; + private final Object syncObject = new Object(); + private volatile StringBuilder builder = new StringBuilder(); + + public ClientJSONPoint(final String uri) throws SSLException { + this(URI.create(uri)); + } + + public ClientJSONPoint(URI uri) { + this.uri = uri; + String protocol = uri.getScheme(); + if (!"ws".equals(protocol) && !"wss".equals(protocol)) { + throw new IllegalArgumentException("Unsupported protocol: " + protocol); + } + if ("wss".equals(protocol)) { + ssl = true; + } + if (uri.getPort() == -1) { + if ("ws".equals(protocol)) port = 80; + else port = 443; + } else port = uri.getPort(); + try { + httpClient = HttpClient.newBuilder() + .sslContext(Downloader.makeSSLContext()).build(); + webSocketBuilder = httpClient.newWebSocketBuilder().connectTimeout(Duration.ofSeconds(30)); + } catch (NoSuchAlgorithmException | CertificateException | KeyStoreException | IOException | + KeyManagementException e) { + throw new RuntimeException(e); + } + } + + public void open() throws Exception { + webSocket = webSocketBuilder.buildAsync(uri, this).get(); + } + + public void openAsync(Runnable onConnect, Consumer onFail) { + webSocketBuilder.buildAsync(uri, this).thenAccept((e) -> { + this.webSocket = e; + onConnect.run(); + }).exceptionally((ex) -> { + onFail.accept(ex); + return null; + }); + } + + @Override + public CompletionStage onText(WebSocket webSocket, CharSequence data, boolean last) { + synchronized (syncObject) { + builder.append(data); + if(last) { + String message = builder.toString(); + builder = new StringBuilder(); + onMessage(message); + } + } + return WebSocket.Listener.super.onText(webSocket, data, last); + } + + @Override + public CompletionStage onClose(WebSocket webSocket, int statusCode, String reason) { + onDisconnect(statusCode, reason); + return WebSocket.Listener.super.onClose(webSocket, statusCode, reason); + } + + @Override + public void onError(WebSocket webSocket, Throwable error) { + LogHelper.error(error); + WebSocket.Listener.super.onError(webSocket, error); + } + + public void send(String text) { + webSocket.sendText(text, true); + } + + abstract void onMessage(String message); + + abstract void onDisconnect(int statusCode, String reason); + + abstract void onOpen(); + + public void close() throws InterruptedException { + webSocket.abort(); + } + +} \ No newline at end of file diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientWebSocketService.java similarity index 85% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientWebSocketService.java index 5d18b124..e5564f37 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientWebSocketService.java @@ -1,18 +1,18 @@ -package pro.gravit.launcher.request.websockets; +package pro.gravit.launcher.base.request.websockets; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.events.NotificationEvent; -import pro.gravit.launcher.events.request.*; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.events.NotificationEvent; +import pro.gravit.launcher.base.events.request.*; import pro.gravit.launcher.core.hasher.HashedEntry; import pro.gravit.launcher.core.hasher.HashedEntryAdapter; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.optional.actions.OptionalAction; -import pro.gravit.launcher.profiles.optional.triggers.OptionalTrigger; -import pro.gravit.launcher.request.WebSocketEvent; -import pro.gravit.launcher.request.auth.AuthRequest; -import pro.gravit.launcher.request.auth.GetAvailabilityAuthRequest; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalAction; +import pro.gravit.launcher.base.profiles.optional.triggers.OptionalTrigger; +import pro.gravit.launcher.base.request.WebSocketEvent; +import pro.gravit.launcher.base.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.GetAvailabilityAuthRequest; import pro.gravit.utils.ProviderMap; import pro.gravit.utils.UniversalJsonAdapter; import pro.gravit.utils.helper.LogHelper; @@ -67,9 +67,9 @@ void onMessage(String message) { public abstract void eventHandle(T event); @Override - void onDisconnect() { - LogHelper.info("WebSocket client disconnect"); - if (onCloseCallback != null) onCloseCallback.onClose(0, "unsupported param", !isClosed); + void onDisconnect(int statusCode, String reason) { + LogHelper.info("WebSocket disconnected: %d: %s", statusCode, reason); + if (onCloseCallback != null) onCloseCallback.onClose(statusCode, reason, !isClosed); } @Override @@ -122,13 +122,13 @@ public void waitIfNotConnected() { public void sendObject(Object obj) throws IOException { waitIfNotConnected(); - if (ch == null || !ch.isActive()) reconnectCallback.onReconnect(); + if (webSocket == null || webSocket.isInputClosed()) reconnectCallback.onReconnect(); send(gson.toJson(obj, WebSocketRequest.class)); } public void sendObject(Object obj, Type type) throws IOException { waitIfNotConnected(); - if (ch == null || !ch.isActive()) reconnectCallback.onReconnect(); + if (webSocket == null || webSocket.isInputClosed()) reconnectCallback.onReconnect(); send(gson.toJson(obj, type)); } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/OfflineRequestService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/OfflineRequestService.java similarity index 88% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/OfflineRequestService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/OfflineRequestService.java index 66fb69e5..d995b73d 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/OfflineRequestService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/OfflineRequestService.java @@ -1,10 +1,10 @@ -package pro.gravit.launcher.request.websockets; +package pro.gravit.launcher.base.request.websockets; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.RequestException; -import pro.gravit.launcher.request.RequestService; -import pro.gravit.launcher.request.WebSocketEvent; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.RequestException; +import pro.gravit.launcher.base.request.RequestService; +import pro.gravit.launcher.base.request.WebSocketEvent; import pro.gravit.utils.helper.LogHelper; import java.util.HashSet; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StdWebSocketService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/StdWebSocketService.java similarity index 92% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StdWebSocketService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/StdWebSocketService.java index c4946129..fe6dade9 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StdWebSocketService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/StdWebSocketService.java @@ -1,11 +1,11 @@ -package pro.gravit.launcher.request.websockets; +package pro.gravit.launcher.base.request.websockets; -import pro.gravit.launcher.events.RequestEvent; -import pro.gravit.launcher.events.request.ErrorRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.RequestException; -import pro.gravit.launcher.request.RequestService; -import pro.gravit.launcher.request.WebSocketEvent; +import pro.gravit.launcher.base.events.RequestEvent; +import pro.gravit.launcher.base.events.request.ErrorRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.RequestException; +import pro.gravit.launcher.base.request.RequestService; +import pro.gravit.launcher.base.request.WebSocketEvent; import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/VoidRequestService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/VoidRequestService.java similarity index 76% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/VoidRequestService.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/VoidRequestService.java index 4d098833..0e26a494 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/VoidRequestService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/VoidRequestService.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.request.websockets; +package pro.gravit.launcher.base.request.websockets; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.RequestException; -import pro.gravit.launcher.request.RequestService; -import pro.gravit.launcher.request.WebSocketEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.RequestException; +import pro.gravit.launcher.base.request.RequestService; +import pro.gravit.launcher.base.request.WebSocketEvent; import java.util.concurrent.CompletableFuture; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/WebSocketRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/WebSocketRequest.java similarity index 72% rename from LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/WebSocketRequest.java rename to LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/WebSocketRequest.java index 05d3e899..69389897 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/WebSocketRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/WebSocketRequest.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.request.websockets; +package pro.gravit.launcher.base.request.websockets; import pro.gravit.utils.TypeSerializeInterface; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/ClosePhase.java b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/ClosePhase.java deleted file mode 100644 index b924d4c0..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/ClosePhase.java +++ /dev/null @@ -1,6 +0,0 @@ -package pro.gravit.launcher.modules.events; - -import pro.gravit.launcher.modules.LauncherModule; - -public class ClosePhase extends LauncherModule.Event { -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/InitPhase.java b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/InitPhase.java deleted file mode 100644 index b4f24adb..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/InitPhase.java +++ /dev/null @@ -1,6 +0,0 @@ -package pro.gravit.launcher.modules.events; - -import pro.gravit.launcher.modules.LauncherModule; - -public class InitPhase extends LauncherModule.Event { -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/PostInitPhase.java b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/PostInitPhase.java deleted file mode 100644 index 88d097a5..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/PostInitPhase.java +++ /dev/null @@ -1,6 +0,0 @@ -package pro.gravit.launcher.modules.events; - -import pro.gravit.launcher.modules.LauncherModule; - -public class PostInitPhase extends LauncherModule.Event { -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/PreConfigPhase.java b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/PreConfigPhase.java deleted file mode 100644 index 01630a53..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/events/PreConfigPhase.java +++ /dev/null @@ -1,6 +0,0 @@ -package pro.gravit.launcher.modules.events; - -import pro.gravit.launcher.modules.LauncherModule; - -public class PreConfigPhase extends LauncherModule.Event { -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/CurrentUserRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/CurrentUserRequest.java deleted file mode 100644 index 4a4437f5..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/CurrentUserRequest.java +++ /dev/null @@ -1,11 +0,0 @@ -package pro.gravit.launcher.request.auth; - -import pro.gravit.launcher.events.request.CurrentUserRequestEvent; -import pro.gravit.launcher.request.Request; - -public class CurrentUserRequest extends Request { - @Override - public String getType() { - return "currentUser"; - } -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/cabinet/AssetUploadInfoRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/cabinet/AssetUploadInfoRequest.java deleted file mode 100644 index 3827e762..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/cabinet/AssetUploadInfoRequest.java +++ /dev/null @@ -1,11 +0,0 @@ -package pro.gravit.launcher.request.cabinet; - -import pro.gravit.launcher.events.request.AssetUploadInfoRequestEvent; -import pro.gravit.launcher.request.Request; - -public class AssetUploadInfoRequest extends Request { - @Override - public String getType() { - return "assetUploadInfo"; - } -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/management/FeaturesRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/management/FeaturesRequest.java deleted file mode 100644 index d203cdff..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/management/FeaturesRequest.java +++ /dev/null @@ -1,11 +0,0 @@ -package pro.gravit.launcher.request.management; - -import pro.gravit.launcher.events.request.FeaturesRequestEvent; -import pro.gravit.launcher.request.Request; - -public class FeaturesRequest extends Request { - @Override - public String getType() { - return "features"; - } -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/ProfilesRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/ProfilesRequest.java deleted file mode 100644 index 06f28ebc..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/ProfilesRequest.java +++ /dev/null @@ -1,13 +0,0 @@ -package pro.gravit.launcher.request.update; - -import pro.gravit.launcher.events.request.ProfilesRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.websockets.WebSocketRequest; - -public final class ProfilesRequest extends Request implements WebSocketRequest { - - @Override - public String getType() { - return "profiles"; - } -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/UpdateListRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/UpdateListRequest.java deleted file mode 100644 index 463b58ed..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/update/UpdateListRequest.java +++ /dev/null @@ -1,13 +0,0 @@ -package pro.gravit.launcher.request.update; - -import pro.gravit.launcher.events.request.UpdateListRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.websockets.WebSocketRequest; - -public final class UpdateListRequest extends Request implements WebSocketRequest { - - @Override - public String getType() { - return "updateList"; - } -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java deleted file mode 100644 index 0afe1267..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java +++ /dev/null @@ -1,155 +0,0 @@ -package pro.gravit.launcher.request.websockets; - -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.*; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.SocketChannel; -import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.http.EmptyHttpHeaders; -import io.netty.handler.codec.http.HttpClientCodec; -import io.netty.handler.codec.http.HttpObjectAggregator; -import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame; -import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; -import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory; -import io.netty.handler.codec.http.websocketx.WebSocketVersion; -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslContextBuilder; -import pro.gravit.launcher.core.CertificatePinningTrustManager; -import pro.gravit.launcher.core.LauncherInject; -import pro.gravit.utils.helper.LogHelper; - -import javax.net.ssl.SSLException; -import java.io.IOException; -import java.net.URI; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Consumer; - -public abstract class ClientJSONPoint { - private static final AtomicInteger counter = new AtomicInteger(); - private static final ThreadFactory threadFactory = (runnable) -> { - Thread t = new Thread(runnable); - t.setName(String.format("Netty Thread #%d", counter.incrementAndGet())); - t.setDaemon(true); - return t; - }; - private static final EventLoopGroup group = new NioEventLoopGroup(threadFactory); - @LauncherInject("launcher.certificatePinning") - private static boolean isCertificatePinning; - protected final Bootstrap bootstrap = new Bootstrap(); - private final URI uri; - public boolean isClosed; - protected Channel ch; - protected WebSocketClientHandler webSocketClientHandler; - protected boolean ssl = false; - protected int port; - - public ClientJSONPoint(final String uri) throws SSLException { - this(URI.create(uri)); - } - - public ClientJSONPoint(URI uri) throws SSLException { - this.uri = uri; - String protocol = uri.getScheme(); - if (!"ws".equals(protocol) && !"wss".equals(protocol)) { - throw new IllegalArgumentException("Unsupported protocol: " + protocol); - } - if ("wss".equals(protocol)) { - ssl = true; - } - if (uri.getPort() == -1) { - if ("ws".equals(protocol)) port = 80; - else port = 443; - } else port = uri.getPort(); - final SslContext sslCtx; - if (ssl) { - SslContextBuilder sslContextBuilder = SslContextBuilder.forClient(); - if (isCertificatePinning) { - try { - sslContextBuilder.trustManager(CertificatePinningTrustManager.getTrustManager()); - } catch (KeyStoreException | NoSuchAlgorithmException | IOException | CertificateException e) { - LogHelper.error(e); - sslContextBuilder.trustManager(); - } - } - sslCtx = sslContextBuilder.build(); - } else sslCtx = null; - bootstrap.group(group) - .channel(NioSocketChannel.class) - .handler(new ChannelInitializer() { - @Override - public void initChannel(SocketChannel ch) { - ChannelPipeline pipeline = ch.pipeline(); - if (sslCtx != null) { - pipeline.addLast(sslCtx.newHandler(ch.alloc(), uri.getHost(), port)); - } - pipeline.addLast("http-codec", new HttpClientCodec()); - pipeline.addLast("aggregator", new HttpObjectAggregator(65536)); - pipeline.addLast("ws-handler", webSocketClientHandler); - } - }); - } - - public void open() throws Exception { - //System.out.println("WebSocket Client connecting"); - webSocketClientHandler = - new WebSocketClientHandler( - WebSocketClientHandshakerFactory.newHandshaker( - uri, WebSocketVersion.V13, null, false, EmptyHttpHeaders.INSTANCE, 12800000), this); - ch = bootstrap.connect(uri.getHost(), port).sync().channel(); - webSocketClientHandler.handshakeFuture().sync(); - } - - public void openAsync(Runnable onConnect, Consumer onFail) { - //System.out.println("WebSocket Client connecting"); - webSocketClientHandler = - new WebSocketClientHandler( - WebSocketClientHandshakerFactory.newHandshaker( - uri, WebSocketVersion.V13, null, false, EmptyHttpHeaders.INSTANCE, 12800000), this); - ChannelFuture future = bootstrap.connect(uri.getHost(), port); - future.addListener((l) -> { - if (l.isSuccess()) { - ch = future.channel(); - webSocketClientHandler.handshakeFuture().addListener((e) -> { - if (e.isSuccess()) { - onConnect.run(); - } else { - onFail.accept(webSocketClientHandler.handshakeFuture().cause()); - } - }); - } else { - onFail.accept(future.cause()); - } - }); - } - - public void send(String text) { - LogHelper.dev("Send: %s", text); - ch.writeAndFlush(new TextWebSocketFrame(text), ch.voidPromise()); - } - - abstract void onMessage(String message); - - abstract void onDisconnect(); - - abstract void onOpen(); - - public void close() throws InterruptedException { - //System.out.println("WebSocket Client sending close"); - isClosed = true; - if (ch != null && ch.isActive()) { - ch.writeAndFlush(new CloseWebSocketFrame(), ch.voidPromise()); - ch.closeFuture().sync(); - } - - group.shutdownGracefully(); - } - - public void eval(final String text) { - ch.writeAndFlush(new TextWebSocketFrame(text), ch.voidPromise()); - } - -} \ No newline at end of file diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/WebSocketClientHandler.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/WebSocketClientHandler.java deleted file mode 100644 index 99739729..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/WebSocketClientHandler.java +++ /dev/null @@ -1,89 +0,0 @@ -package pro.gravit.launcher.request.websockets; - -import io.netty.channel.*; -import io.netty.handler.codec.http.FullHttpResponse; -import io.netty.handler.codec.http.websocketx.*; -import io.netty.util.CharsetUtil; -import pro.gravit.utils.helper.LogHelper; - -import java.util.concurrent.TimeUnit; - -public class WebSocketClientHandler extends SimpleChannelInboundHandler { - - private final WebSocketClientHandshaker handshaker; - private final ClientJSONPoint clientJSONPoint; - private ChannelPromise handshakeFuture; - - public WebSocketClientHandler(final WebSocketClientHandshaker handshaker, ClientJSONPoint clientJSONPoint) { - this.handshaker = handshaker; - this.clientJSONPoint = clientJSONPoint; - } - - public ChannelFuture handshakeFuture() { - return handshakeFuture; - } - - @Override - public void handlerAdded(final ChannelHandlerContext ctx) { - handshakeFuture = ctx.newPromise(); - } - - @Override - public void channelActive(final ChannelHandlerContext ctx) { - handshaker.handshake(ctx.channel()); - clientJSONPoint.onOpen(); - ctx.executor().scheduleWithFixedDelay(() -> ctx.channel().writeAndFlush(new PingWebSocketFrame()), 20L, 20L, TimeUnit.SECONDS); - } - - @Override - public void channelInactive(final ChannelHandlerContext ctx) { - //System.out.println("WebSocket Client disconnected!"); - clientJSONPoint.onDisconnect(); - } - - @Override - protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { - final Channel ch = ctx.channel(); - if (!handshaker.isHandshakeComplete()) { - // web socket client connected - handshaker.finishHandshake(ch, (FullHttpResponse) msg); - handshakeFuture.setSuccess(); - return; - } - - if (msg instanceof FullHttpResponse response) { - throw new Exception("Unexpected FullHttpResponse (getStatus=" + response.status() + ", content=" - + response.content().toString(CharsetUtil.UTF_8) + ')'); - } - - final WebSocketFrame frame = (WebSocketFrame) msg; - if (frame instanceof TextWebSocketFrame textFrame) { - if (LogHelper.isDevEnabled()) { - LogHelper.dev("Message: %s", textFrame.text()); - } - clientJSONPoint.onMessage(textFrame.text()); - // uncomment to print request - // logger.info(textFrame.text()); - } else if ((frame instanceof PingWebSocketFrame)) { - frame.content().retain(); - ch.writeAndFlush(new PongWebSocketFrame(frame.content()), ch.voidPromise()); - //return; - } else if (frame instanceof PongWebSocketFrame) { - } else if (frame instanceof CloseWebSocketFrame) - ch.close(); - else if (frame instanceof BinaryWebSocketFrame) { - // uncomment to print request - // logger.info(frame.content().toString()); - } - } - - @Override - public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) { - if (!handshakeFuture.isDone()) { - handshakeFuture.setFailure(cause); - } else { - LogHelper.error(cause); - } - ctx.close(); - } -} \ No newline at end of file diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/ClientVersionTest.java b/LauncherAPI/src/test/java/pro/gravit/launcher/ClientVersionTest.java index 205b495a..81ff8a28 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/ClientVersionTest.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/ClientVersionTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfile; public class ClientVersionTest { @Test diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/ModulesTest.java b/LauncherAPI/src/test/java/pro/gravit/launcher/ModulesTest.java index c228df09..0f9ea313 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/ModulesTest.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/ModulesTest.java @@ -7,8 +7,8 @@ import pro.gravit.launcher.impl.*; import pro.gravit.launcher.impl.event.CancelEvent; import pro.gravit.launcher.impl.event.NormalEvent; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.impl.SimpleModuleManager; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.impl.SimpleModuleManager; import java.nio.file.Path; diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/PermissionTest.java b/LauncherAPI/src/test/java/pro/gravit/launcher/PermissionTest.java index 74baf10c..581b5015 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/PermissionTest.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/PermissionTest.java @@ -2,6 +2,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import pro.gravit.launcher.base.ClientPermissions; public class PermissionTest { @Test diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Cyclic2DependModule.java b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Cyclic2DependModule.java index fa321bce..3d144bec 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Cyclic2DependModule.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Cyclic2DependModule.java @@ -1,8 +1,8 @@ package pro.gravit.launcher.impl; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; import pro.gravit.utils.Version; public class Cyclic2DependModule extends LauncherModule { diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/CyclicDependModule.java b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/CyclicDependModule.java index c13d8b58..090ce42a 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/CyclicDependModule.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/CyclicDependModule.java @@ -1,8 +1,8 @@ package pro.gravit.launcher.impl; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; import pro.gravit.utils.Version; public class CyclicDependModule extends LauncherModule { diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend1Module.java b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend1Module.java index a3f046b7..99da57e2 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend1Module.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend1Module.java @@ -1,9 +1,9 @@ package pro.gravit.launcher.impl; import org.junit.jupiter.api.Assertions; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; import pro.gravit.utils.Version; public class Depend1Module extends LauncherModule { diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend2Module.java b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend2Module.java index 2b50e4c1..466053d6 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend2Module.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend2Module.java @@ -1,9 +1,9 @@ package pro.gravit.launcher.impl; import org.junit.jupiter.api.Assertions; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; import pro.gravit.utils.Version; public class Depend2Module extends LauncherModule { diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend3Module.java b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend3Module.java index 3e63503a..bf264cc8 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend3Module.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/Depend3Module.java @@ -1,8 +1,8 @@ package pro.gravit.launcher.impl; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; public class Depend3Module extends LauncherModule { public Depend3Module() { diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/InternalModule.java b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/InternalModule.java index 1cbe663e..acd36fca 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/InternalModule.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/InternalModule.java @@ -1,8 +1,8 @@ package pro.gravit.launcher.impl; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; public class InternalModule extends LauncherModule { public InternalModule() { diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/MainModule.java b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/MainModule.java index 22248da6..e4993574 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/MainModule.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/MainModule.java @@ -1,9 +1,9 @@ package pro.gravit.launcher.impl; import org.junit.jupiter.api.Assertions; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; import pro.gravit.utils.Version; public class MainModule extends LauncherModule { diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/ProvidedModule.java b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/ProvidedModule.java index dd201374..68fb5c0c 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/ProvidedModule.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/ProvidedModule.java @@ -1,8 +1,8 @@ package pro.gravit.launcher.impl; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; import pro.gravit.utils.Version; public class ProvidedModule extends LauncherModule implements VirtualInterface { diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/TestModule.java b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/TestModule.java index 9f247324..18500f2b 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/TestModule.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/TestModule.java @@ -2,9 +2,9 @@ import pro.gravit.launcher.impl.event.CancelEvent; import pro.gravit.launcher.impl.event.NormalEvent; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; public class TestModule extends LauncherModule { diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/event/CancelEvent.java b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/event/CancelEvent.java index 4220f5f1..adb68520 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/event/CancelEvent.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/event/CancelEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.impl.event; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModule; public class CancelEvent extends LauncherModule.Event { } diff --git a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/event/NormalEvent.java b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/event/NormalEvent.java index 210b88e2..84bc7d62 100644 --- a/LauncherAPI/src/test/java/pro/gravit/launcher/impl/event/NormalEvent.java +++ b/LauncherAPI/src/test/java/pro/gravit/launcher/impl/event/NormalEvent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.impl.event; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModule; public class NormalEvent extends LauncherModule.Event { public boolean passed; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/BasicLauncherEventHandler.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/BasicLauncherEventHandler.java index 8b36651f..87d03fa9 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/BasicLauncherEventHandler.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/BasicLauncherEventHandler.java @@ -1,12 +1,12 @@ package pro.gravit.launcher.client; import pro.gravit.launcher.client.api.DialogService; -import pro.gravit.launcher.events.ExtendedTokenRequestEvent; -import pro.gravit.launcher.events.NotificationEvent; -import pro.gravit.launcher.events.request.SecurityReportRequestEvent; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.RequestService; -import pro.gravit.launcher.request.WebSocketEvent; +import pro.gravit.launcher.base.events.ExtendedTokenRequestEvent; +import pro.gravit.launcher.base.events.NotificationEvent; +import pro.gravit.launcher.base.events.request.SecurityReportRequestEvent; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.RequestService; +import pro.gravit.launcher.base.request.WebSocketEvent; import pro.gravit.utils.helper.LogHelper; public class BasicLauncherEventHandler implements RequestService.EventHandler { diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientGsonManager.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientGsonManager.java similarity index 75% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientGsonManager.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/ClientGsonManager.java index 9a503091..7a4ce733 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientGsonManager.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientGsonManager.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.client.runtime.client; +package pro.gravit.launcher.client; import com.google.gson.GsonBuilder; import pro.gravit.launcher.core.managers.GsonManager; -import pro.gravit.launcher.modules.events.PreGsonPhase; -import pro.gravit.launcher.request.websockets.ClientWebSocketService; +import pro.gravit.launcher.base.modules.events.PreGsonPhase; +import pro.gravit.launcher.base.request.websockets.ClientWebSocketService; public class ClientGsonManager extends GsonManager { private final ClientModuleManager moduleManager; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherCoreModule.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherCoreModule.java similarity index 59% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherCoreModule.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherCoreModule.java index 5dd32863..9cfe8ddc 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherCoreModule.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherCoreModule.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.client.runtime.client; +package pro.gravit.launcher.client; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; import pro.gravit.utils.Version; public class ClientLauncherCoreModule extends LauncherModule { diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherEntryPoint.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java similarity index 93% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherEntryPoint.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java index 9d3d6134..cc0a1b28 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientLauncherEntryPoint.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherEntryPoint.java @@ -1,28 +1,26 @@ -package pro.gravit.launcher.client.runtime.client; +package pro.gravit.launcher.client; -import pro.gravit.launcher.*; -import pro.gravit.launcher.client.BasicLauncherEventHandler; -import pro.gravit.launcher.client.ClientLauncherMethods; -import pro.gravit.launcher.client.LauncherAgent; -import pro.gravit.launcher.client.api.AuthService; -import pro.gravit.launcher.client.api.ClientService; -import pro.gravit.launcher.client.api.KeyService; -import pro.gravit.launcher.client.runtime.client.events.client.*; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.LauncherConfig; +import pro.gravit.launcher.base.api.AuthService; +import pro.gravit.launcher.base.api.ClientService; +import pro.gravit.launcher.base.api.KeyService; +import pro.gravit.launcher.client.events.*; import pro.gravit.launcher.core.hasher.FileNameMatcher; import pro.gravit.launcher.core.hasher.HashedDir; import pro.gravit.launcher.core.hasher.HashedEntry; -import pro.gravit.launcher.modules.events.PreConfigPhase; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.ClientProfileVersions; -import pro.gravit.launcher.profiles.optional.actions.OptionalAction; -import pro.gravit.launcher.profiles.optional.actions.OptionalActionClassPath; -import pro.gravit.launcher.profiles.optional.actions.OptionalActionClientArgs; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.RequestException; -import pro.gravit.launcher.request.RequestService; -import pro.gravit.launcher.request.websockets.StdWebSocketService; +import pro.gravit.launcher.base.modules.events.PreConfigPhase; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfileVersions; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalAction; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalActionClassPath; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalActionClientArgs; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.RequestException; +import pro.gravit.launcher.base.request.RequestService; +import pro.gravit.launcher.base.request.websockets.StdWebSocketService; import pro.gravit.launcher.core.serialize.HInput; -import pro.gravit.launcher.client.runtime.utils.DirWatcher; +import pro.gravit.launcher.client.utils.DirWatcher; import pro.gravit.utils.helper.*; import pro.gravit.utils.launch.*; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherMethods.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherMethods.java index 2774a122..09d8aef5 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherMethods.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientLauncherMethods.java @@ -1,29 +1,25 @@ package pro.gravit.launcher.client; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.client.events.ClientExitPhase; import pro.gravit.launcher.core.LauncherTrustManager; -import pro.gravit.launcher.client.runtime.client.ClientGsonManager; -import pro.gravit.launcher.client.runtime.client.ClientLauncherEntryPoint; -import pro.gravit.launcher.client.runtime.client.ClientModuleManager; -import pro.gravit.launcher.client.runtime.client.ClientParams; -import pro.gravit.launcher.client.runtime.client.events.ClientExitPhase; -import pro.gravit.launcher.events.request.*; -import pro.gravit.launcher.modules.LauncherModulesManager; -import pro.gravit.launcher.modules.events.OfflineModeEvent; -import pro.gravit.launcher.profiles.optional.actions.OptionalAction; -import pro.gravit.launcher.profiles.optional.triggers.OptionalTrigger; -import pro.gravit.launcher.request.RequestException; -import pro.gravit.launcher.request.RequestService; -import pro.gravit.launcher.request.auth.*; -import pro.gravit.launcher.request.auth.details.AuthLoginOnlyDetails; -import pro.gravit.launcher.request.management.FeaturesRequest; -import pro.gravit.launcher.request.secure.GetSecureLevelInfoRequest; -import pro.gravit.launcher.request.secure.SecurityReportRequest; -import pro.gravit.launcher.request.update.LauncherRequest; -import pro.gravit.launcher.request.uuid.ProfileByUUIDRequest; -import pro.gravit.launcher.request.uuid.ProfileByUsernameRequest; -import pro.gravit.launcher.request.websockets.OfflineRequestService; -import pro.gravit.launcher.client.runtime.utils.NativeJVMHalt; +import pro.gravit.launcher.base.events.request.*; +import pro.gravit.launcher.base.modules.LauncherModulesManager; +import pro.gravit.launcher.base.modules.events.OfflineModeEvent; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalAction; +import pro.gravit.launcher.base.profiles.optional.triggers.OptionalTrigger; +import pro.gravit.launcher.base.request.RequestException; +import pro.gravit.launcher.base.request.RequestService; +import pro.gravit.launcher.base.request.auth.*; +import pro.gravit.launcher.base.request.auth.details.AuthLoginOnlyDetails; +import pro.gravit.launcher.base.request.management.FeaturesRequest; +import pro.gravit.launcher.base.request.secure.GetSecureLevelInfoRequest; +import pro.gravit.launcher.base.request.secure.SecurityReportRequest; +import pro.gravit.launcher.base.request.update.LauncherRequest; +import pro.gravit.launcher.base.request.uuid.ProfileByUUIDRequest; +import pro.gravit.launcher.base.request.uuid.ProfileByUsernameRequest; +import pro.gravit.launcher.base.request.websockets.OfflineRequestService; +import pro.gravit.launcher.client.utils.NativeJVMHalt; import pro.gravit.utils.helper.JVMHelper; import java.security.cert.X509Certificate; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientModuleManager.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientModuleManager.java similarity index 82% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientModuleManager.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/ClientModuleManager.java index e89b8af5..03a6f14e 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientModuleManager.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientModuleManager.java @@ -1,9 +1,9 @@ -package pro.gravit.launcher.client.runtime.client; +package pro.gravit.launcher.client; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launcher.core.LauncherTrustManager; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.impl.SimpleModuleManager; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.impl.SimpleModuleManager; import java.nio.file.Path; import java.util.Collections; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientParams.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientParams.java similarity index 88% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientParams.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/ClientParams.java index e8047887..ee8381d9 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/ClientParams.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientParams.java @@ -1,14 +1,14 @@ -package pro.gravit.launcher.client.runtime.client; +package pro.gravit.launcher.client; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.events.request.AuthRequestEvent; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.events.request.AuthRequestEvent; import pro.gravit.launcher.core.hasher.HashedDir; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.ClientProfileVersions; -import pro.gravit.launcher.profiles.PlayerProfile; -import pro.gravit.launcher.profiles.optional.actions.OptionalAction; -import pro.gravit.launcher.profiles.optional.actions.OptionalActionClientArgs; -import pro.gravit.launcher.request.Request; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfileVersions; +import pro.gravit.launcher.base.profiles.PlayerProfile; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalAction; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalActionClientArgs; +import pro.gravit.launcher.base.request.Request; import pro.gravit.utils.Version; import java.util.*; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/LauncherAgent.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/LauncherAgent.java index 27924bba..0683af97 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/LauncherAgent.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/LauncherAgent.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.client; -import pro.gravit.launcher.client.runtime.utils.NativeJVMHalt; +import pro.gravit.launcher.client.utils.NativeJVMHalt; import pro.gravit.utils.helper.LogHelper; import java.io.File; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeLauncherCoreModule.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/RuntimeLauncherCoreModule.java similarity index 59% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeLauncherCoreModule.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/RuntimeLauncherCoreModule.java index 6b948c01..a4366843 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/RuntimeLauncherCoreModule.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/RuntimeLauncherCoreModule.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.client.runtime.client; +package pro.gravit.launcher.client; -import pro.gravit.launcher.modules.LauncherInitContext; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.LauncherModuleInfo; +import pro.gravit.launcher.base.modules.LauncherInitContext; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModuleInfo; import pro.gravit.utils.Version; public class RuntimeLauncherCoreModule extends LauncherModule { diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/api/CertificateService.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/CertificateService.java index 222c8de6..3c6a6e56 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/api/CertificateService.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/CertificateService.java @@ -2,7 +2,7 @@ import pro.gravit.launcher.client.ClientLauncherMethods; import pro.gravit.launcher.core.LauncherTrustManager; -import pro.gravit.launcher.client.runtime.utils.ApiBridgeService; +import pro.gravit.launcher.client.utils.ApiBridgeService; import java.security.cert.X509Certificate; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/api/DialogService.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/DialogService.java index 0132ef3d..aa26756f 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/api/DialogService.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/api/DialogService.java @@ -1,6 +1,6 @@ package pro.gravit.launcher.client.api; -import pro.gravit.launcher.events.NotificationEvent; +import pro.gravit.launcher.base.events.NotificationEvent; import java.util.function.Consumer; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientExitPhase.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientExitPhase.java similarity index 57% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientExitPhase.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientExitPhase.java index 199bf0e4..ddad537c 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientExitPhase.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientExitPhase.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.runtime.client.events; +package pro.gravit.launcher.client.events; -import pro.gravit.launcher.modules.events.ClosePhase; +import pro.gravit.launcher.base.modules.events.ClosePhase; public class ClientExitPhase extends ClosePhase { public final int code; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessClassLoaderEvent.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessClassLoaderEvent.java similarity index 76% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessClassLoaderEvent.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessClassLoaderEvent.java index 7d193807..7ece2912 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessClassLoaderEvent.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessClassLoaderEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.client.events.client; +package pro.gravit.launcher.client.events; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.utils.launch.ClassLoaderControl; import pro.gravit.utils.launch.Launch; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessInitPhase.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessInitPhase.java similarity index 51% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessInitPhase.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessInitPhase.java index a7f27384..82a1c556 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessInitPhase.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessInitPhase.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.client.events.client; +package pro.gravit.launcher.client.events; -import pro.gravit.launcher.client.runtime.client.ClientParams; -import pro.gravit.launcher.modules.events.InitPhase; +import pro.gravit.launcher.client.ClientParams; +import pro.gravit.launcher.base.modules.events.InitPhase; public class ClientProcessInitPhase extends InitPhase { public final ClientParams params; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessLaunchEvent.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessLaunchEvent.java similarity index 53% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessLaunchEvent.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessLaunchEvent.java index 5954e801..9646c6d5 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessLaunchEvent.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessLaunchEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.client.events.client; +package pro.gravit.launcher.client.events; -import pro.gravit.launcher.client.runtime.client.ClientParams; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.client.ClientParams; +import pro.gravit.launcher.base.modules.LauncherModule; public class ClientProcessLaunchEvent extends LauncherModule.Event { public final ClientParams params; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessPreInvokeMainClassEvent.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessPreInvokeMainClassEvent.java similarity index 66% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessPreInvokeMainClassEvent.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessPreInvokeMainClassEvent.java index c84e7904..ef32888d 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessPreInvokeMainClassEvent.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessPreInvokeMainClassEvent.java @@ -1,8 +1,8 @@ -package pro.gravit.launcher.client.runtime.client.events.client; +package pro.gravit.launcher.client.events; -import pro.gravit.launcher.client.runtime.client.ClientParams; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.profiles.ClientProfile; +import pro.gravit.launcher.client.ClientParams; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.profiles.ClientProfile; import java.util.Collection; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessReadyEvent.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessReadyEvent.java similarity index 51% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessReadyEvent.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessReadyEvent.java index 87399ece..9df4dfad 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/client/events/client/ClientProcessReadyEvent.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientProcessReadyEvent.java @@ -1,7 +1,7 @@ -package pro.gravit.launcher.client.runtime.client.events.client; +package pro.gravit.launcher.client.events; -import pro.gravit.launcher.client.runtime.client.ClientParams; -import pro.gravit.launcher.modules.events.PostInitPhase; +import pro.gravit.launcher.client.ClientParams; +import pro.gravit.launcher.base.modules.events.PostInitPhase; public class ClientProcessReadyEvent extends PostInitPhase { public final ClientParams params; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientUnlockConsoleEvent.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientUnlockConsoleEvent.java similarity index 70% rename from Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientUnlockConsoleEvent.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientUnlockConsoleEvent.java index 814b5729..e73361fe 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/runtime/client/events/ClientUnlockConsoleEvent.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/events/ClientUnlockConsoleEvent.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.runtime.client.events; +package pro.gravit.launcher.client.events; -import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.base.modules.LauncherModule; import pro.gravit.utils.command.CommandHandler; public class ClientUnlockConsoleEvent extends LauncherModule.Event { diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/ApiBridgeService.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/utils/ApiBridgeService.java similarity index 88% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/ApiBridgeService.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/utils/ApiBridgeService.java index ce675a57..f4defa2d 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/ApiBridgeService.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/utils/ApiBridgeService.java @@ -1,6 +1,6 @@ -package pro.gravit.launcher.client.runtime.utils; +package pro.gravit.launcher.client.utils; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launcher.core.LauncherTrustManager; import java.security.cert.X509Certificate; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/DirWatcher.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/utils/DirWatcher.java similarity index 98% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/DirWatcher.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/utils/DirWatcher.java index a3ab7053..5184035a 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/DirWatcher.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/utils/DirWatcher.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.runtime.utils; +package pro.gravit.launcher.client.utils; import pro.gravit.launcher.client.ClientLauncherMethods; import pro.gravit.launcher.core.hasher.FileNameMatcher; diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/NativeJVMHalt.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/utils/NativeJVMHalt.java similarity index 94% rename from LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/NativeJVMHalt.java rename to LauncherClient/src/main/java/pro/gravit/launcher/client/utils/NativeJVMHalt.java index c442c264..03fae4f3 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/runtime/utils/NativeJVMHalt.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/utils/NativeJVMHalt.java @@ -1,4 +1,4 @@ -package pro.gravit.launcher.client.runtime.utils; +package pro.gravit.launcher.client.utils; import pro.gravit.utils.helper.LogHelper; diff --git a/LauncherStart/src/main/java/pro/gravit/launcher/start/ClientLauncherWrapper.java b/LauncherStart/src/main/java/pro/gravit/launcher/start/ClientLauncherWrapper.java index a068b3db..82791f3f 100644 --- a/LauncherStart/src/main/java/pro/gravit/launcher/start/ClientLauncherWrapper.java +++ b/LauncherStart/src/main/java/pro/gravit/launcher/start/ClientLauncherWrapper.java @@ -1,9 +1,7 @@ package pro.gravit.launcher.start; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherConfig; -import pro.gravit.launcher.client.runtime.client.DirBridge; -import pro.gravit.launcher.client.runtime.utils.DirWatcher; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.LauncherConfig; import pro.gravit.launcher.core.LauncherInject; import pro.gravit.utils.Version; import pro.gravit.utils.helper.*; @@ -105,16 +103,12 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep context.executePath = IOHelper.resolveJavaBin(context.javaVersion.jvmDir); String pathLauncher = IOHelper.getCodeSource(ClientLauncherWrapper.class).toString(); - context.mainClass = "pro.gravit.launcher.LauncherEngineWrapper"; + context.mainClass = "pro.gravit.launcher.runtime.LauncherEngineWrapper"; context.memoryLimit = launcherMemoryLimit; context.classpath.add(pathLauncher); context.jvmProperties.put(LogHelper.DEBUG_PROPERTY, Boolean.toString(LogHelper.isDebugEnabled())); context.jvmProperties.put(LogHelper.STACKTRACE_PROPERTY, Boolean.toString(LogHelper.isStacktraceEnabled())); context.jvmProperties.put(LogHelper.DEV_PROPERTY, Boolean.toString(LogHelper.isDevEnabled())); - context.addSystemProperty(DirBridge.CUSTOMDIR_PROPERTY); - context.addSystemProperty(DirBridge.USE_CUSTOMDIR_PROPERTY); - context.addSystemProperty(DirBridge.USE_OPTDIR_PROPERTY); - context.addSystemProperty(DirWatcher.IGN_OVERFLOW); context.jvmModules.add("javafx.base"); context.jvmModules.add("javafx.graphics"); context.jvmModules.add("javafx.fxml"); diff --git a/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java b/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java index 8f5a350c..ab9640cf 100644 --- a/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java +++ b/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java @@ -1,9 +1,9 @@ package pro.gravit.launcher.start; -import pro.gravit.launcher.Launcher; +import pro.gravit.launcher.base.Launcher; import pro.gravit.launcher.core.LauncherTrustManager; -import pro.gravit.launcher.modules.LauncherModule; -import pro.gravit.launcher.modules.impl.SimpleModuleManager; +import pro.gravit.launcher.base.modules.LauncherModule; +import pro.gravit.launcher.base.modules.impl.SimpleModuleManager; import java.nio.file.Path; import java.util.Collections; 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 77faaa45..a1c7e6d5 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java @@ -1,22 +1,22 @@ package pro.gravit.launcher.server; -import pro.gravit.launcher.Launcher; -import pro.gravit.launcher.LauncherConfig; -import pro.gravit.launcher.client.api.AuthService; -import pro.gravit.launcher.client.api.ClientService; -import pro.gravit.launcher.client.api.ConfigService; -import pro.gravit.launcher.client.api.KeyService; -import pro.gravit.launcher.config.JsonConfigurable; -import pro.gravit.launcher.events.request.AuthRequestEvent; -import pro.gravit.launcher.events.request.ProfilesRequestEvent; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.optional.actions.OptionalAction; -import pro.gravit.launcher.profiles.optional.triggers.OptionalTrigger; -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.update.ProfilesRequest; -import pro.gravit.launcher.request.websockets.StdWebSocketService; +import pro.gravit.launcher.base.Launcher; +import pro.gravit.launcher.base.LauncherConfig; +import pro.gravit.launcher.base.api.AuthService; +import pro.gravit.launcher.base.api.ClientService; +import pro.gravit.launcher.base.api.ConfigService; +import pro.gravit.launcher.base.api.KeyService; +import pro.gravit.launcher.base.config.JsonConfigurable; +import pro.gravit.launcher.base.events.request.AuthRequestEvent; +import pro.gravit.launcher.base.events.request.ProfilesRequestEvent; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.optional.actions.OptionalAction; +import pro.gravit.launcher.base.profiles.optional.triggers.OptionalTrigger; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.auth.AuthRequest; +import pro.gravit.launcher.base.request.auth.GetAvailabilityAuthRequest; +import pro.gravit.launcher.base.request.update.ProfilesRequest; +import pro.gravit.launcher.base.request.websockets.StdWebSocketService; import pro.gravit.launcher.server.authlib.InstallAuthlib; import pro.gravit.launcher.server.setup.ServerWrapperSetup; import pro.gravit.utils.helper.IOHelper; diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapperGsonManager.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapperGsonManager.java index 3c20fe6b..48b5f35d 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapperGsonManager.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapperGsonManager.java @@ -2,7 +2,7 @@ import com.google.gson.GsonBuilder; import pro.gravit.launcher.core.managers.GsonManager; -import pro.gravit.launcher.request.websockets.ClientWebSocketService; +import pro.gravit.launcher.base.request.websockets.ClientWebSocketService; public class ServerWrapperGsonManager extends GsonManager { diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java index 9f2e24da..336f4889 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java @@ -1,11 +1,11 @@ package pro.gravit.launcher.server.setup; -import pro.gravit.launcher.events.request.GetPublicKeyRequestEvent; -import pro.gravit.launcher.profiles.ClientProfile; -import pro.gravit.launcher.profiles.ClientProfileVersions; -import pro.gravit.launcher.request.Request; -import pro.gravit.launcher.request.auth.GetPublicKeyRequest; -import pro.gravit.launcher.request.websockets.StdWebSocketService; +import pro.gravit.launcher.base.events.request.GetPublicKeyRequestEvent; +import pro.gravit.launcher.base.profiles.ClientProfile; +import pro.gravit.launcher.base.profiles.ClientProfileVersions; +import pro.gravit.launcher.base.request.Request; +import pro.gravit.launcher.base.request.auth.GetPublicKeyRequest; +import pro.gravit.launcher.base.request.websockets.StdWebSocketService; import pro.gravit.launcher.server.ServerWrapper; import pro.gravit.utils.PublicURLClassLoader; import pro.gravit.utils.helper.IOHelper; diff --git a/build.gradle b/build.gradle index 30340061..a586a61d 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.5.3' +version = '5.6.0-SNAPSHOT' apply from: 'props.gradle' diff --git a/modules b/modules index 9b1740cc..ee11966e 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 9b1740ccc426de8a8ac332545c64afbe9c17f89f +Subproject commit ee11966e12eaa7de3b4dfe07c8425da5deee1f16 diff --git a/settings.gradle b/settings.gradle index 9566cd8d..dfdf4434 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,7 +1,6 @@ rootProject.name = 'GravitLauncher' include 'Launcher' -include 'LauncherModernCore' include 'LauncherCore' include 'LauncherAPI' include 'LauncherClient' From f321b8bd2764e90e5167530605b2643c0d2e4fd4 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Fri, 29 Dec 2023 16:37:14 +0700 Subject: [PATCH 08/23] [FIX] ExitResponse, update SimpleModuleManager --- .../socket/response/auth/ExitResponse.java | 5 +- .../launcher/base/modules/LauncherModule.java | 4 ++ .../base/modules/LauncherModulesContext.java | 4 ++ .../modules/impl/SimpleModuleContext.java | 11 +++ .../modules/impl/SimpleModuleManager.java | 23 +++++- .../request/websockets/ClientJSONPoint.java | 2 + .../launcher/client/ClientModuleManager.java | 6 ++ LauncherModernCore/build.gradle | 72 ------------------- .../launcher/start/RuntimeModuleManager.java | 5 ++ .../server/setup/ServerWrapperSetup.java | 5 +- 10 files changed, 61 insertions(+), 76 deletions(-) delete mode 100644 LauncherModernCore/build.gradle 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 6cd1647c..37394753 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 @@ -43,6 +43,10 @@ public void execute(ChannelHandlerContext ctx, Client client) { return; } if (username == null) { + if(!client.isAuth || client.auth == null) { + sendError("You are not authorized"); + return; + } { WebSocketFrameHandler handler = ctx.pipeline().get(WebSocketFrameHandler.class); if (handler == null) { @@ -65,7 +69,6 @@ public void execute(ChannelHandlerContext ctx, Client client) { } sendResult(new ExitRequestEvent(ExitRequestEvent.ExitReason.CLIENT)); } - sendResult(new ExitRequestEvent(ExitRequestEvent.ExitReason.CLIENT)); } else { service.forEachActiveChannels(((channel, webSocketFrameHandler) -> { Client client1 = webSocketFrameHandler.getClient(); diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModule.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModule.java index 6e1d2f68..86d032b8 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModule.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModule.java @@ -83,6 +83,10 @@ protected final T requireModule(Class cl return module; } + protected LauncherModulesContext getContext() { + return context; + } + private void requireModule(LauncherModule module, Version minVersion, String requiredModuleName) { if (module == null) throw new RuntimeException(String.format("Module %s required %s v%s or higher", moduleInfo.name, requiredModuleName, minVersion.getVersionString())); diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesContext.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesContext.java index 5710af91..b648faa8 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesContext.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/LauncherModulesContext.java @@ -1,7 +1,11 @@ package pro.gravit.launcher.base.modules; +import java.net.URL; + public interface LauncherModulesContext { LauncherModulesManager getModulesManager(); ModulesConfigManager getModulesConfigManager(); + + void addURL(URL url); } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleContext.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleContext.java index 2547f594..2d1bc257 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleContext.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleContext.java @@ -4,6 +4,8 @@ import pro.gravit.launcher.base.modules.LauncherModulesManager; import pro.gravit.launcher.base.modules.ModulesConfigManager; +import java.net.URL; + public class SimpleModuleContext implements LauncherModulesContext { public final LauncherModulesManager modulesManager; public final ModulesConfigManager configManager; @@ -13,6 +15,15 @@ public SimpleModuleContext(LauncherModulesManager modulesManager, ModulesConfigM this.configManager = configManager; } + @Override + public void addURL(URL url) { + if(modulesManager instanceof SimpleModuleManager s) { + s.addUrlToClassLoader(url); + } else { + throw new UnsupportedOperationException(); + } + } + @Override public LauncherModulesManager getModulesManager() { return modulesManager; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleManager.java index 97bf724f..db3668a4 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/modules/impl/SimpleModuleManager.java @@ -11,6 +11,7 @@ import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.net.URL; +import java.net.URLClassLoader; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; @@ -32,9 +33,13 @@ public class SimpleModuleManager implements LauncherModulesManager { protected final ModulesConfigManager modulesConfigManager; protected final Path modulesDir; protected final LauncherTrustManager trustManager; - protected final PublicURLClassLoader classLoader = new PublicURLClassLoader(new URL[]{}, SimpleModuleManager.class.getClassLoader()); + protected final ModulesClassLoader classLoader = createClassLoader(); protected LauncherInitContext initContext; + protected ModulesClassLoader createClassLoader() { + return new ModulesClassLoader(new URL[]{}, SimpleModuleManager.class.getClassLoader()); + } + public SimpleModuleManager(Path modulesDir, Path configDir) { modulesConfigManager = new SimpleModulesConfigManager(configDir); context = new SimpleModuleContext(this, modulesConfigManager); @@ -268,6 +273,10 @@ public ModulesConfigManager getConfigManager() { return modulesConfigManager; } + void addUrlToClassLoader(URL url) { + classLoader.addURL(url); + } + protected final class ModulesVisitor extends SimpleFileVisitor { private ModulesVisitor() { } @@ -279,4 +288,16 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO return super.visitFile(file, attrs); } } + + protected static class ModulesClassLoader extends URLClassLoader { + + public ModulesClassLoader(URL[] urls, ClassLoader parent) { + super("MODULES", urls, parent); + } + + @Override + public void addURL(URL url) { + super.addURL(url); + } + } } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java index 7f65dadf..73f1d9dc 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java @@ -14,6 +14,7 @@ import java.security.cert.CertificateException; import java.time.Duration; import java.util.concurrent.CompletionStage; +import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; @@ -27,6 +28,7 @@ public abstract class ClientJSONPoint implements WebSocket.Listener { protected boolean ssl = false; protected int port; private final Object syncObject = new Object(); + private final Object sendSyncObject = new Object(); private volatile StringBuilder builder = new StringBuilder(); public ClientJSONPoint(final String uri) throws SSLException { diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientModuleManager.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientModuleManager.java index 03a6f14e..b516523f 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientModuleManager.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientModuleManager.java @@ -5,6 +5,7 @@ import pro.gravit.launcher.base.modules.LauncherModule; import pro.gravit.launcher.base.modules.impl.SimpleModuleManager; +import java.net.URL; import java.nio.file.Path; import java.util.Collections; import java.util.List; @@ -33,6 +34,11 @@ public List getModules() { return Collections.unmodifiableList(modules); } + @Override + protected ModulesClassLoader createClassLoader() { + return null; + } + @Override public boolean verifyClassCheckResult(LauncherTrustManager.CheckClassResult result) { return result.type == LauncherTrustManager.CheckClassResultType.SUCCESS; diff --git a/LauncherModernCore/build.gradle b/LauncherModernCore/build.gradle deleted file mode 100644 index 879f4a48..00000000 --- a/LauncherModernCore/build.gradle +++ /dev/null @@ -1,72 +0,0 @@ -sourceCompatibility = '17' -targetCompatibility = '17' - -dependencies { - api project(':LauncherCore') -} - -test { - useJUnitPlatform() - testLogging { - events "passed", "skipped", "failed" - } -} -jar { - archiveClassifier.set('clean') - manifest.attributes("Multi-Release": "true") -} - -tasks.register('sourcesJar', Jar) { - from sourceSets.main.allJava - archiveClassifier.set('sources') -} - -tasks.register('javadocJar', Jar) { - from javadoc - archiveClassifier.set('javadoc') -} - -publishing { - publications { - launchermoderncore(MavenPublication) { - artifactId = 'launcher-modern-core' - artifact(jar) { - classifier "" - } - artifact sourcesJar - artifact javadocJar - pom { - name = 'GravitLauncher Core Utils with Java 17+' - description = 'GravitLauncher Core Utils' - url = 'https://gravitlauncher.com' - licenses { - license { - name = 'GNU General Public License, Version 3.0' - url = 'https://www.gnu.org/licenses/gpl-3.0.html' - } - } - developers { - developer { - id = 'gravita' - name = 'Gravita' - email = 'gravita@gravit.pro' - } - developer { - id = 'zaxar163' - name = 'Zaxar163' - email = 'zahar.vcherachny@yandex.ru' - } - } - scm { - connection = 'scm:git:https://github.com/GravitLauncher/Launcher.git' - developerConnection = 'scm:git:ssh://git@github.com:GravitLauncher/Launcher.git' - url = 'https://gravitlauncher.com/' - } - } - } - } -} - -signing { - sign publishing.publications.launchermoderncore -} diff --git a/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java b/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java index ab9640cf..efbc127f 100644 --- a/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java +++ b/LauncherStart/src/main/java/pro/gravit/launcher/start/RuntimeModuleManager.java @@ -38,6 +38,11 @@ public boolean verifyClassCheckResult(LauncherTrustManager.CheckClassResult resu return result.type == LauncherTrustManager.CheckClassResultType.SUCCESS; } + @Override + protected ModulesClassLoader createClassLoader() { + return null; + } + public void callWrapper(ClientLauncherWrapper.ClientLauncherWrapperContext context) { for (LauncherModule module : modules) { if (module instanceof ClientWrapperModule) { diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java index 336f4889..79f655a7 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/setup/ServerWrapperSetup.java @@ -15,6 +15,7 @@ import java.io.IOException; import java.io.Writer; import java.net.URL; +import java.net.URLClassLoader; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -22,7 +23,7 @@ public class ServerWrapperSetup { public ServerWrapperCommands commands; - public PublicURLClassLoader urlClassLoader; + public URLClassLoader urlClassLoader; public ServerWrapperSetup() throws IOException { commands = new ServerWrapperCommands(); @@ -37,7 +38,7 @@ public void run() throws Exception { String agentClassName; try (JarFile file = new JarFile(jarPath.toFile())) { URL jarURL = jarPath.toUri().toURL(); - urlClassLoader = new PublicURLClassLoader(new URL[]{jarURL}); + urlClassLoader = new URLClassLoader(new URL[]{jarURL}); LogHelper.info("Check server jar MainClass"); mainClassName = file.getManifest().getMainAttributes().getValue("Main-Class"); agentClassName = file.getManifest().getMainAttributes().getValue("Premain-Class"); From 449798d52bd46b64fd82238fef217bc76c0a6c5e Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Fri, 29 Dec 2023 17:07:03 +0700 Subject: [PATCH 09/23] [FIX] ServerWrapper --- .../base/request/websockets/ClientJSONPoint.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java index 73f1d9dc..0cc63d33 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/request/websockets/ClientJSONPoint.java @@ -1,6 +1,7 @@ package pro.gravit.launcher.base.request.websockets; import pro.gravit.launcher.base.Downloader; +import pro.gravit.launcher.core.LauncherInject; import pro.gravit.utils.helper.LogHelper; import javax.net.ssl.SSLException; @@ -19,6 +20,8 @@ import java.util.function.Consumer; public abstract class ClientJSONPoint implements WebSocket.Listener { + @LauncherInject("launcher.certificatePinning") + private static boolean isCertificatePinning; private static final AtomicInteger counter = new AtomicInteger(); private final URI uri; public boolean isClosed; @@ -49,8 +52,11 @@ public ClientJSONPoint(URI uri) { else port = 443; } else port = uri.getPort(); try { - httpClient = HttpClient.newBuilder() - .sslContext(Downloader.makeSSLContext()).build(); + var httpClientBuilder = HttpClient.newBuilder(); + if(isCertificatePinning) { + httpClientBuilder = httpClientBuilder.sslContext(Downloader.makeSSLContext()); + } + httpClient = httpClientBuilder.build(); webSocketBuilder = httpClient.newWebSocketBuilder().connectTimeout(Duration.ofSeconds(30)); } catch (NoSuchAlgorithmException | CertificateException | KeyStoreException | IOException | KeyManagementException e) { From 90f6d002d14a688bc3037685f803cb5921e2095e Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:17:59 +0700 Subject: [PATCH 10/23] [FIX] Wayland support --- .../gravit/launcher/runtime/client/ClientLauncherProcess.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java index 0a378b19..001502ca 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java @@ -177,7 +177,7 @@ public void start(boolean pipeOutput) throws IOException, InterruptedException { var env = processBuilder.environment(); // https://github.com/Admicos/minecraft-wayland/issues/55 env.put("__GL_THREADED_OPTIMIZATIONS", "0"); - if(params.lwjglGlfwWayland) { + if(params.lwjglGlfwWayland && !params.profile.hasFlag(ClientProfile.CompatibilityFlags.WAYLAND_USE_CUSTOM_GLFW)) { env.remove("DISPLAY"); // No X11 } } From 8e82f5cd847d17b6ecd4941b93daa61b437e5751 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sun, 7 Jan 2024 20:15:29 +0700 Subject: [PATCH 11/23] [FEATURE][EXPERIMENTAL] Parse java args method --- .../pro/gravit/utils/helper/CommonHelper.java | 163 +++++++++++++++++- .../gravit/utils/launch/LaunchOptions.java | 5 +- 2 files changed, 160 insertions(+), 8 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java index 1d5d7ac9..a286c248 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/CommonHelper.java @@ -2,13 +2,11 @@ import com.google.gson.*; import pro.gravit.utils.command.CommandException; +import pro.gravit.utils.launch.LaunchOptions; import javax.script.ScriptEngine; import java.lang.reflect.Type; -import java.util.Base64; -import java.util.Collection; -import java.util.LinkedList; -import java.util.Locale; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -56,6 +54,21 @@ public static String replace(String source, String... params) { return source; } + public static String replace(Map replaceMap, String arg) { + for(var e : replaceMap.entrySet()) { + arg = arg.replace(e.getKey(), e.getValue()); + } + return arg; + } + + public static List replace(Map replaceMap, List args) { + List updatedList = new ArrayList<>(args.size()); + for(var e : args) { + updatedList.add(replace(replaceMap, e)); + } + return updatedList; + } + public static String[] parseCommand(CharSequence line) throws CommandException { boolean quoted = false; boolean wasQuoted = false; @@ -111,6 +124,148 @@ public static GsonBuilder newBuilder() { ByteArrayToBase64TypeAdapter.INSTANCE); } + + public static ArgsParseResult parseJavaArgs(List args) { + List classpath = new ArrayList<>(); + List jvmArgs = new ArrayList<>(); + List runArgs = new ArrayList<>(); + String jarFile = null; + String mainClass = null; + String mainModule = null; + LaunchOptions.ModuleConf conf = new LaunchOptions.ModuleConf(); + var prevArgType = PrevArgType.NONE; + boolean runArgsBoolean = false; + boolean first = false; + for(var arg : args) { + if(runArgsBoolean) { + runArgs.add(arg); + continue; + } + if(!first) { + if(!arg.startsWith("-")) { + continue; + } + first = true; + } + switch (prevArgType) { + case NONE -> { + + } + case MODULE_PATH -> { + char c = ':'; + int i = arg.indexOf(c); + if(i<0) { + c = ';'; + } + String[] l = arg.split(Character.toString(c)); + conf.modulePath.addAll(Arrays.asList(l)); + prevArgType = PrevArgType.NONE; + continue; + } + case CLASSPATH -> { + char c = ':'; + int i = arg.indexOf(c); + if(i<0) { + c = ';'; + } + String[] l = arg.split(Character.toString(c)); + classpath.addAll(Arrays.asList(l)); + prevArgType = PrevArgType.POST_CLASSPATH; + continue; + } + case ADD_MODULES -> { + String[] l = arg.split(","); + conf.modules.addAll(Arrays.asList(l)); + prevArgType = PrevArgType.NONE; + continue; + } + case ADD_OPENS -> { + String[] l = arg.split("="); + conf.opens.put(l[0], l[1]); + prevArgType = PrevArgType.NONE; + continue; + } + case ADD_EXPORTS -> { + String[] l = arg.split("="); + conf.exports.put(l[0], l[1]); + prevArgType = PrevArgType.NONE; + continue; + } + case ADD_READS -> { + String[] l = arg.split("="); + if(l.length != 2) { + continue; + } + conf.reads.put(l[0], l[1]); + prevArgType = PrevArgType.NONE; + continue; + } + case MODULE -> { + String[] l = arg.split("/"); + mainModule = l[0]; + mainClass = l[1]; + runArgsBoolean = true; + prevArgType = PrevArgType.NONE; + continue; + } + case POST_CLASSPATH -> { + mainClass = arg; + runArgsBoolean = true; + prevArgType = PrevArgType.NONE; + continue; + } + case JAR -> { + jarFile = arg; + runArgsBoolean = true; + prevArgType = PrevArgType.NONE; + continue; + } + } + if(arg.equals("--module-path") || arg.equals("-p")) { + prevArgType = PrevArgType.MODULE_PATH; + continue; + } + if(arg.equals("--classpath") || arg.equals("-cp")) { + prevArgType = PrevArgType.CLASSPATH; + continue; + } + if(arg.equals("--add-modules")) { + prevArgType = PrevArgType.ADD_MODULES; + continue; + } + if(arg.equals("--add-opens")) { + prevArgType = PrevArgType.ADD_OPENS; + continue; + } + if(arg.equals("--add-exports")) { + prevArgType = PrevArgType.ADD_EXPORTS; + continue; + } + if(arg.equals("--add-reads")) { + prevArgType = PrevArgType.ADD_READS; + continue; + } + if(arg.equals("--module") || arg.equals("-m")) { + prevArgType = PrevArgType.MODULE; + continue; + } + if(arg.equals("-jar")) { + prevArgType = PrevArgType.JAR; + continue; + } + jvmArgs.add(arg); + } + return new ArgsParseResult(conf, classpath, jvmArgs, mainClass, mainModule, jarFile, args); + } + + public record ArgsParseResult(LaunchOptions.ModuleConf conf, List classpath, List jvmArgs, String mainClass, String mainModule, String jarFile, List args) { + + } + + private enum PrevArgType { + NONE, MODULE_PATH, ADD_MODULES, ADD_OPENS, ADD_EXPORTS, ADD_READS, CLASSPATH, POST_CLASSPATH, JAR, MAINCLASS, MODULE; + } + private static class ByteArrayToBase64TypeAdapter implements JsonSerializer, JsonDeserializer { private static final ByteArrayToBase64TypeAdapter INSTANCE = new ByteArrayToBase64TypeAdapter(); private final Base64.Decoder decoder = Base64.getUrlDecoder(); diff --git a/LauncherCore/src/main/java/pro/gravit/utils/launch/LaunchOptions.java b/LauncherCore/src/main/java/pro/gravit/utils/launch/LaunchOptions.java index fa95d0d8..ddabd56c 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/launch/LaunchOptions.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/launch/LaunchOptions.java @@ -1,9 +1,6 @@ package pro.gravit.utils.launch; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class LaunchOptions { public boolean enableHacks; From b3eb0ebb9805eb31771600f3c374c2b391bd6cad Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sun, 7 Jan 2024 20:18:15 +0700 Subject: [PATCH 12/23] [FIX] Support arch i586 in release file --- .../src/main/java/pro/gravit/utils/helper/JVMHelper.java | 2 +- .../src/main/java/pro/gravit/utils/helper/JavaHelper.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java index a7cdb354..ba1bbf85 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JVMHelper.java @@ -46,7 +46,7 @@ private JVMHelper() { public static ARCH getArch(String arch) { if (arch.equals("amd64") || arch.equals("x86-64") || arch.equals("x86_64")) return ARCH.X86_64; - if (arch.equals("i386") || arch.equals("i686") || arch.equals("x86")) return ARCH.X86; + if (arch.equals("i386") || arch.equals("i586") || arch.equals("i686") || arch.equals("x86")) return ARCH.X86; if (arch.startsWith("armv8") || arch.startsWith("aarch64")) return ARCH.ARM64; if (arch.startsWith("arm") || arch.startsWith("aarch32")) return ARCH.ARM32; throw new InternalError(String.format("Unsupported arch '%s'", arch)); diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java index 2bfb54cf..e73cec59 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java @@ -257,7 +257,6 @@ public static JavaVersion getByPath(Path jvmDir) { arch = JVMHelper.getArch(archProperty); } } catch (Throwable ignored) { - arch = null; } String modulesProperty = getProperty(properties, "MODULES"); if(modulesProperty != null) { From f1bc0ea28ab51db113bec265ddd640f5f467f210 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Tue, 9 Jan 2024 16:59:15 +0700 Subject: [PATCH 13/23] [ANY] Update modules --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index ee11966e..0f9d89dd 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit ee11966e12eaa7de3b4dfe07c8425da5deee1f16 +Subproject commit 0f9d89dd2a0110e62f9ba6fa9f8cb5442c069b4b From 82bf2fdf56df308915186fb91223353d9f5a287e Mon Sep 17 00:00:00 2001 From: dima_dencep Date: Fri, 12 Jan 2024 16:02:02 +0700 Subject: [PATCH 14/23] [FIX] proguard (#694) --- .../components/ProGuardComponent.java | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java index 520a80f4..f30ab0b4 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java @@ -9,21 +9,23 @@ import pro.gravit.utils.command.SubCommand; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.JVMHelper; +import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.helper.SecurityHelper; import pro.gravit.utils.helper.UnpackHelper; -import proguard.Configuration; -import proguard.ConfigurationParser; -import proguard.ProGuard; import java.io.*; +import java.nio.file.FileVisitOption; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.security.SecureRandom; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; @@ -191,7 +193,6 @@ public String getName() { public Path process(Path inputFile) throws IOException { Path outputJar = server.launcherBinary.nextLowerPath(this); if (component.enabled) { - Configuration proguard_cfg = new Configuration(); if (!checkJMods(IOHelper.JVM_DIR.resolve("jmods"))) { throw new RuntimeException("Java path: %s is not JDK! Please install JDK".formatted(IOHelper.JVM_DIR)); } @@ -204,12 +205,34 @@ public Path process(Path inputFile) throws IOException { } else { throw new RuntimeException("JavaFX jmods not found. May be install OpenJFX?"); } - ConfigurationParser parser = new ConfigurationParser(proguardConf.buildConfig(inputFile, outputJar, jfxPath == null ? new Path[0] : new Path[]{jfxPath}), - proguardConf.proguard.toFile(), System.getProperties()); try { - parser.parse(proguard_cfg); - ProGuard proGuard = new ProGuard(proguard_cfg); - proGuard.execute(); + List args = new ArrayList<>(); + args.add(IOHelper.resolveJavaBin(IOHelper.JVM_DIR).toAbsolutePath().toString()); + args.add("-cp"); + try(Stream files = Files.walk(Path.of("libraries"), FileVisitOption.FOLLOW_LINKS)) { + args.add(files + .filter(e -> e.getFileName().toString().endsWith(".jar")) + .map(path -> path.toAbsolutePath().toString()) + .collect(Collectors.joining(File.pathSeparator)) + ); + } + args.add("proguard.ProGuard"); + proguardConf.buildConfig(args, inputFile, outputJar, jfxPath == null ? new Path[0] : new Path[]{jfxPath}); + + Process process = new ProcessBuilder() + .command(args) + .inheritIO() + .directory(proguardConf.proguard.toFile()) + .start(); + + try { + process.waitFor(); + } catch (InterruptedException ignored) { + + } + if (process.exitValue() != 0) { + throw new RuntimeException("ProGuard process return %d".formatted(process.exitValue())); + } } catch (Exception e) { logger.error(e); } @@ -256,8 +279,7 @@ private static String generateString(SecureRandom rand, String lowString, String return sb.toString(); } - public String[] buildConfig(Path inputJar, Path outputJar, Path[] jfxPath) { - List confStrs = new ArrayList<>(); + public void buildConfig(List confStrs, Path inputJar, Path outputJar, Path[] jfxPath) { prepare(false); if (component.mappings) confStrs.add("-printmapping '" + mappings.toFile().getName() + "'"); @@ -279,7 +301,6 @@ public String[] buildConfig(Path inputJar, Path outputJar, Path[] jfxPath) { .forEach(confStrs::add); confStrs.add("-classobfuscationdictionary '" + words.toFile().getName() + "'"); confStrs.add("@".concat(config.toFile().getName())); - return confStrs.toArray(new String[0]); } private void genConfig(boolean force) throws IOException { From 4251725467713c011a4e1706232fb1e43917260a Mon Sep 17 00:00:00 2001 From: Gravit'a <12893402+gravit0@users.noreply.github.com> Date: Sat, 13 Jan 2024 18:42:42 +0700 Subject: [PATCH 15/23] [ANY] Update modules --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 0f9d89dd..00dc29cc 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 0f9d89dd2a0110e62f9ba6fa9f8cb5442c069b4b +Subproject commit 00dc29cc69b07fd79c9f17e5678fb9b4d00e7bc7 From f2b92c2bbd64681a72c7d409d79f55b82ad49fde Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sun, 14 Jan 2024 17:21:58 +0700 Subject: [PATCH 16/23] [FIX] Update mirror link --- .../pro/gravit/launchserver/config/LaunchServerConfig.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java index 66b0aeee..7c23e551 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java @@ -27,7 +27,9 @@ import static java.util.concurrent.TimeUnit.SECONDS; public final class LaunchServerConfig { - private final static List oldMirrorList = List.of("https://mirror.gravit.pro/5.2.x/", "https://mirror.gravit.pro/5.3.x/", "https://mirror.gravitlauncher.com/5.2.x/", "https://mirror.gravitlauncher.com/5.3.x/", "https://mirror.gravitlauncher.com/5.4.x/"); + private final static List oldMirrorList = List.of("https://mirror.gravit.pro/5.2.x/", "https://mirror.gravit.pro/5.3.x/", + "https://mirror.gravitlauncher.com/5.2.x/", "https://mirror.gravitlauncher.com/5.3.x/", "https://mirror.gravitlauncher.com/5.4.x/", + "https://mirror.gravitlauncher.com/5.5.x/"); private transient final Logger logger = LogManager.getLogger(); public String projectName; public String[] mirrors; @@ -49,7 +51,7 @@ public final class LaunchServerConfig { public static LaunchServerConfig getDefault(LaunchServer.LaunchServerEnv env) { LaunchServerConfig newConfig = new LaunchServerConfig(); - newConfig.mirrors = new String[]{"https://mirror.gravitlauncher.com/5.5.x/", "https://gravit-launcher-mirror.storage.googleapis.com/"}; + newConfig.mirrors = new String[]{"https://mirror.gravitlauncher.com/5.6.x/", "https://gravit-launcher-mirror.storage.googleapis.com/"}; newConfig.launch4j = new LaunchServerConfig.ExeConf(); newConfig.launch4j.enabled = false; newConfig.launch4j.copyright = "© GravitLauncher Team"; From efe967587c48f71edb7bc677bf623e14523c4f79 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sun, 14 Jan 2024 17:25:55 +0700 Subject: [PATCH 17/23] [FIX] Finally remove launch4j --- .../pro/gravit/launchserver/LaunchServer.java | 9 +---- .../binary/EXEL4JLauncherBinary.java | 17 --------- .../binary/tasks/exe/Launch4JTask.java | 38 ------------------- .../config/LaunchServerConfig.java | 34 ----------------- 4 files changed, 1 insertion(+), 97 deletions(-) delete mode 100644 LaunchServer/src/main/java/pro/gravit/launchserver/binary/EXEL4JLauncherBinary.java delete mode 100644 LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java index 17264082..f1ffda57 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java @@ -9,7 +9,6 @@ import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.core.RejectAuthCoreProvider; -import pro.gravit.launchserver.binary.EXEL4JLauncherBinary; import pro.gravit.launchserver.binary.EXELauncherBinary; import pro.gravit.launchserver.binary.JARLauncherBinary; import pro.gravit.launchserver.binary.LauncherBinary; @@ -299,12 +298,6 @@ private LauncherBinary binary() { if(event.binary != null) { return event.binary; } - try { - Class.forName("net.sf.launch4j.Builder"); - if (config.launch4j.enabled) return new EXEL4JLauncherBinary(this); - } catch (ClassNotFoundException ignored) { - logger.warn("Launch4J isn't in classpath."); - } return new EXELauncherBinary(this); } @@ -392,7 +385,7 @@ public void syncLauncherBinaries() throws IOException { // Syncing launcher EXE binary logger.info("Syncing launcher EXE binary file"); - if (!launcherEXEBinary.sync() && config.launch4j.enabled) + if (!launcherEXEBinary.sync()) logger.warn("Missing launcher EXE binary file"); } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/EXEL4JLauncherBinary.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/EXEL4JLauncherBinary.java deleted file mode 100644 index 26a2b457..00000000 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/EXEL4JLauncherBinary.java +++ /dev/null @@ -1,17 +0,0 @@ -package pro.gravit.launchserver.binary; - -import pro.gravit.launchserver.LaunchServer; -import pro.gravit.launchserver.binary.tasks.exe.Launch4JTask; - -public final class EXEL4JLauncherBinary extends LauncherBinary { - - - public EXEL4JLauncherBinary(LaunchServer server) { - super(server, LauncherBinary.resolve(server, ".exe"), "Launcher-%s.exe"); - } - - @Override - public void init() { - tasks.add(new Launch4JTask(server)); - } -} diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java deleted file mode 100644 index f9390719..00000000 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/exe/Launch4JTask.java +++ /dev/null @@ -1,38 +0,0 @@ -package pro.gravit.launchserver.binary.tasks.exe; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import pro.gravit.launchserver.LaunchServer; -import pro.gravit.launchserver.binary.tasks.LauncherBuildTask; -import pro.gravit.utils.Version; - -import java.io.IOException; -import java.nio.file.Path; - -public class Launch4JTask implements LauncherBuildTask, BuildExeMainTask { - public static final String DOWNLOAD_URL = "https://bell-sw.com/pages/downloads/?version=java-8-lts&os=Windows&package=jre-full"; // BellSoft - private static final String VERSION = Version.getVersion().getVersionString(); - private static final int BUILD = Version.getVersion().build; - private final Path faviconFile; - private final LaunchServer server; - private transient final Logger logger = LogManager.getLogger(); - - public Launch4JTask(LaunchServer launchServer) { - this.server = launchServer; - faviconFile = launchServer.dir.resolve("favicon.ico"); - } - - public static String formatVars(String mask) { - return mask.formatted(VERSION, BUILD); - } - - @Override - public String getName() { - return "launch4j"; - } - - @Override - public Path process(Path inputFile) throws IOException { - throw new UnsupportedOperationException("Launch4j not supported"); - } -} diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java index 7c23e551..f3fcfd8d 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java @@ -12,12 +12,10 @@ import pro.gravit.launchserver.auth.protect.ProtectHandler; import pro.gravit.launchserver.auth.protect.StdProtectHandler; import pro.gravit.launchserver.auth.texture.RequestTextureProvider; -import pro.gravit.launchserver.binary.tasks.exe.Launch4JTask; import pro.gravit.launchserver.components.AuthLimiterComponent; import pro.gravit.launchserver.components.Component; import pro.gravit.launchserver.components.ProGuardComponent; import pro.gravit.launchserver.components.RegLimiterComponent; -import pro.gravit.utils.Version; import pro.gravit.utils.helper.JVMHelper; import java.io.File; @@ -41,7 +39,6 @@ public final class LaunchServerConfig { // Handlers & Providers public ProtectHandler protectHandler; public Map components; - public ExeConf launch4j; public NettyConfig netty; public LauncherConf launcher; public JarSignerConf sign; @@ -52,18 +49,6 @@ public final class LaunchServerConfig { public static LaunchServerConfig getDefault(LaunchServer.LaunchServerEnv env) { LaunchServerConfig newConfig = new LaunchServerConfig(); newConfig.mirrors = new String[]{"https://mirror.gravitlauncher.com/5.6.x/", "https://gravit-launcher-mirror.storage.googleapis.com/"}; - newConfig.launch4j = new LaunchServerConfig.ExeConf(); - newConfig.launch4j.enabled = false; - newConfig.launch4j.copyright = "© GravitLauncher Team"; - newConfig.launch4j.fileDesc = "GravitLauncher ".concat(Version.getVersion().getVersionString()); - newConfig.launch4j.fileVer = Version.getVersion().getVersionString().concat(".").concat(String.valueOf(Version.getVersion().patch)); - newConfig.launch4j.internalName = "Launcher"; - newConfig.launch4j.trademarks = "This product is licensed under GPLv3"; - newConfig.launch4j.txtFileVersion = "%s, build %d"; - newConfig.launch4j.txtProductVersion = "%s, build %d"; - newConfig.launch4j.productName = "GravitLauncher"; - newConfig.launch4j.productVer = newConfig.launch4j.fileVer; - newConfig.launch4j.maxVersion = "99.0.0"; newConfig.env = LauncherConfig.LauncherEnvironment.STD; newConfig.startScript = JVMHelper.OS_TYPE.equals(JVMHelper.OS.MUSTDIE) ? "." + File.separator + "start.bat" : "." + File.separator + "start.sh"; newConfig.auth = new HashMap<>(); @@ -232,25 +217,6 @@ public void close(LaunchServer.ReloadType type) { } } - public static class ExeConf { - public boolean enabled; - public boolean setMaxVersion; - public String maxVersion; - public String minVersion = "17.0.0"; - public String supportURL = null; - public String downloadUrl = Launch4JTask.DOWNLOAD_URL; - public String productName; - public String productVer; - public String fileDesc; - public String fileVer; - public String internalName; - public String copyright; - public String trademarks; - - public String txtFileVersion; - public String txtProductVersion; - } - public static class JarSignerConf { public boolean enabled = false; public String keyStore = "pathToKey"; From f1922c52e2a8601cd6269cf42856163852347134 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Thu, 18 Jan 2024 00:13:36 +0700 Subject: [PATCH 18/23] [FEATURE] Add ProGuard jvmArgs --- .../gravit/launchserver/components/ProGuardComponent.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java index f30ab0b4..ee92b7e0 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java @@ -34,6 +34,7 @@ public class ProGuardComponent extends Component implements AutoCloseable, Recon private static final Logger logger = LogManager.getLogger(); public String modeAfter = "MainBuild"; public String dir = "proguard"; + public List jvmArgs = new ArrayList<>(); public boolean enabled = true; public boolean mappings = true; public transient ProguardConf proguardConf; @@ -41,6 +42,10 @@ public class ProGuardComponent extends Component implements AutoCloseable, Recon private transient ProGuardBuildTask buildTask; private transient ProGuardMultiReleaseFixer fixerTask; + public ProGuardComponent() { + this.jvmArgs.add("-Xmx512M"); + } + public static boolean checkFXJMods(Path path) { if (!IOHelper.exists(path.resolve("javafx.base.jmod"))) return false; @@ -208,6 +213,7 @@ public Path process(Path inputFile) throws IOException { try { List args = new ArrayList<>(); args.add(IOHelper.resolveJavaBin(IOHelper.JVM_DIR).toAbsolutePath().toString()); + args.addAll(component.jvmArgs); args.add("-cp"); try(Stream files = Files.walk(Path.of("libraries"), FileVisitOption.FOLLOW_LINKS)) { args.add(files From 2fdd7d0199aa07e037f87c55793bcdbb403cb1e2 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Tue, 23 Jan 2024 19:11:33 +0700 Subject: [PATCH 19/23] [FIX] Slf4j fix --- .../pro/gravit/launchserver/config/LaunchServerConfig.java | 4 ++-- LauncherCore/src/main/java/pro/gravit/utils/Version.java | 4 ++-- .../src/main/java/pro/gravit/utils/helper/LogHelper.java | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java index f3fcfd8d..be906d4a 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java @@ -158,8 +158,8 @@ public void verify() { if (!updateMirror) { for (int i = 0; i < mirrors.length; ++i) { if (mirrors[i] != null && oldMirrorList.contains(mirrors[i])) { - logger.warn("Replace mirror '{}' to 'https://mirror.gravitlauncher.com/5.5.x/'. If you really need to use original url, use '-Dlaunchserver.config.disableUpdateMirror=true'", mirrors[i]); - mirrors[i] = "https://mirror.gravitlauncher.com/5.5.x/"; + logger.warn("Replace mirror '{}' to 'https://mirror.gravitlauncher.com/5.6.x/'. If you really need to use original url, use '-Dlaunchserver.config.disableUpdateMirror=true'", mirrors[i]); + mirrors[i] = "https://mirror.gravitlauncher.com/5.6.x/"; } } } diff --git a/LauncherCore/src/main/java/pro/gravit/utils/Version.java b/LauncherCore/src/main/java/pro/gravit/utils/Version.java index db44d40f..62fb4e33 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/Version.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/Version.java @@ -5,8 +5,8 @@ public final class Version implements Comparable { public static final int MAJOR = 5; - public static final int MINOR = 5; - public static final int PATCH = 3; + public static final int MINOR = 6; + public static final int PATCH = 0; public static final int BUILD = 1; public static final Version.Type RELEASE = Type.EXPERIMENTAL; public final int major; 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 36d6b00b..9ba2af43 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/LogHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/LogHelper.java @@ -31,7 +31,6 @@ public final class LogHelper { boolean useSlf4j = false; try { Class.forName("org.slf4j.Logger", false, LogHelper.class.getClassLoader()); - Class.forName("org.slf4j.impl.StaticLoggerBinder", false, LogHelper.class.getClassLoader()); useSlf4j = !Boolean.getBoolean(NO_SLF4J_PROPERTY); } catch (ClassNotFoundException ignored) { } From b7b7afbdbbd42c25492d51f0ed852a9f25c5631c Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Tue, 23 Jan 2024 19:11:48 +0700 Subject: [PATCH 20/23] [ANY] Update modules --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 00dc29cc..d783e9ad 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 00dc29cc69b07fd79c9f17e5678fb9b4d00e7bc7 +Subproject commit d783e9adb9bbbe072e4dd78c6e15a85b27fab446 From c9ccf362527adac329ad0d7d4a0cfb028688f29a Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Tue, 23 Jan 2024 19:34:53 +0700 Subject: [PATCH 21/23] [ANY] Remove reg limiter --- .../launchserver/components/Component.java | 1 - .../components/RegLimiterComponent.java | 34 ------------------- .../config/LaunchServerConfig.java | 6 ---- .../manangers/hook/AuthHookManager.java | 15 -------- 4 files changed, 56 deletions(-) delete mode 100644 LaunchServer/src/main/java/pro/gravit/launchserver/components/RegLimiterComponent.java diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java b/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java index 5eb20ad1..857fce51 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java @@ -11,7 +11,6 @@ public abstract class Component { public static void registerComponents() { if (!registredComp) { providers.register("authLimiter", AuthLimiterComponent.class); - providers.register("regLimiter", RegLimiterComponent.class); providers.register("commandRemover", CommandRemoverComponent.class); providers.register("proguard", ProGuardComponent.class); providers.register("whitelist", WhitelistComponent.class); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/components/RegLimiterComponent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/components/RegLimiterComponent.java deleted file mode 100644 index 7452c560..00000000 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/components/RegLimiterComponent.java +++ /dev/null @@ -1,34 +0,0 @@ -package pro.gravit.launchserver.components; - -import pro.gravit.launchserver.LaunchServer; -import pro.gravit.launchserver.manangers.hook.AuthHookManager; -import pro.gravit.utils.HookException; - -import java.util.ArrayList; -import java.util.List; - -public class RegLimiterComponent extends IPLimiter implements AutoCloseable { - - public transient LaunchServer launchServer; - public String message; - - public List excludeIps = new ArrayList<>(); - - @Override - public void init(LaunchServer launchServer) { - this.launchServer = launchServer; - launchServer.authHookManager.registraion.registerHook(this::registerHook); - } - - public boolean registerHook(AuthHookManager.RegContext context) { - if (!check(context.ip)) { - throw new HookException(message); - } - return false; - } - - @Override - public void close() { - launchServer.authHookManager.registraion.unregisterHook(this::registerHook); - } -} diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java index be906d4a..42d63bbc 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java @@ -15,7 +15,6 @@ import pro.gravit.launchserver.components.AuthLimiterComponent; import pro.gravit.launchserver.components.Component; import pro.gravit.launchserver.components.ProGuardComponent; -import pro.gravit.launchserver.components.RegLimiterComponent; import pro.gravit.utils.helper.JVMHelper; import java.io.File; @@ -87,11 +86,6 @@ public static LaunchServerConfig getDefault(LaunchServer.LaunchServerEnv env) { authLimiterComponent.rateLimitMillis = SECONDS.toMillis(8); authLimiterComponent.message = "Превышен лимит авторизаций"; newConfig.components.put("authLimiter", authLimiterComponent); - RegLimiterComponent regLimiterComponent = new RegLimiterComponent(); - regLimiterComponent.rateLimit = 3; - regLimiterComponent.rateLimitMillis = HOURS.toMillis(10); - regLimiterComponent.message = "Превышен лимит регистраций"; - newConfig.components.put("regLimiter", regLimiterComponent); ProGuardComponent proGuardComponent = new ProGuardComponent(); newConfig.components.put("proguard", proGuardComponent); return newConfig; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/hook/AuthHookManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/hook/AuthHookManager.java index 8148e975..fcaaf91a 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/hook/AuthHookManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/hook/AuthHookManager.java @@ -16,19 +16,4 @@ public class AuthHookManager { public final BiHookSet postCheckServerHook = new BiHookSet<>(); public final BiHookSet joinServerHook = new BiHookSet<>(); public final BiHookSet setProfileHook = new BiHookSet<>(); - public final HookSet registraion = new HookSet<>(); - - public static class RegContext { - public final String login; - public final String password; - public final String ip; - public final boolean trustContext; - - public RegContext(String login, String password, String ip, boolean trustContext) { - this.login = login; - this.password = password; - this.ip = ip; - this.trustContext = trustContext; - } - } } From 0c754ae5e6e0ed58dd3da861c60cb40ffc15c27e Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Tue, 23 Jan 2024 19:35:54 +0700 Subject: [PATCH 22/23] [FIX] Remove legacy manifest attributes --- LaunchServer/build.gradle | 3 --- 1 file changed, 3 deletions(-) diff --git a/LaunchServer/build.gradle b/LaunchServer/build.gradle index 1439c426..4663ce50 100644 --- a/LaunchServer/build.gradle +++ b/LaunchServer/build.gradle @@ -37,9 +37,6 @@ manifest.attributes("Main-Class": mainClassName, "Premain-Class": mainAgentName, "Multi-Release": "true", - "Can-Redefine-Classes": "true", - "Can-Retransform-Classes": "true", - "Can-Set-Native-Method-Prefix": "true" ) } From a0788e46238ede4e4a449d50e9605386a23b70cb Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Tue, 23 Jan 2024 19:44:19 +0700 Subject: [PATCH 23/23] [FIX] Remove legacy launch4j in build.gradle --- LaunchServer/build.gradle | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/LaunchServer/build.gradle b/LaunchServer/build.gradle index 4663ce50..6743d5ec 100644 --- a/LaunchServer/build.gradle +++ b/LaunchServer/build.gradle @@ -112,27 +112,9 @@ pack project(':LauncherAPI') from configurations.hikari } -tasks.register('launch4j', Copy) { - duplicatesStrategy = 'EXCLUDE' - into "$buildDir/libs/libraries/launch4j" - from(configurations.launch4j.collect { - it.isDirectory() ? it : ((it.getName().startsWith("launch4j") && it.getName().contains("workdir")) ? zipTree(it) : it) - }) - includeEmptyDirs false - eachFile { FileCopyDetails fcp -> - if (fcp.relativePath.pathString.startsWith("launch4j-") && - fcp.relativePath.pathString.contains("workdir")) { - def segments = fcp.relativePath.segments - def pathSegments = segments[1..-1] as String[] - fcp.relativePath = new RelativePath(!fcp.file.isDirectory(), pathSegments) - } else if (fcp.relativePath.pathString.contains("META-INF")) fcp.exclude() - fcp.mode = 0755 - } -} - tasks.register('dumpLibs', Copy) { duplicatesStrategy = 'EXCLUDE' - dependsOn tasks.hikari, tasks.launch4j + dependsOn tasks.hikari into "$buildDir/libs/libraries" from configurations.bundleOnly }