From 68bdf17e030c161c5ca05a5cb46356c41866d531 Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 26 Aug 2019 18:34:33 +0700 Subject: [PATCH] =?UTF-8?q?[FEATURE][EXPERIMENTAL]=20=D0=98=D1=81=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20JAConfigurat?= =?UTF-8?q?or?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gravit/launchserver/binary/JAConfigurator.java | 12 +++++++----- .../pro/gravit/launcher/client/ClientLauncher.java | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JAConfigurator.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JAConfigurator.java index 056f457a..a07d08d3 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JAConfigurator.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/JAConfigurator.java @@ -17,16 +17,18 @@ import pro.gravit.launcher.AutogenConfig; import pro.gravit.launcher.Launcher; import pro.gravit.launcher.LauncherConfig; +import pro.gravit.launcher.modules.LauncherModule; +import pro.gravit.launcher.modules.LauncherModulesManager; import pro.gravit.launcher.modules.Module; import pro.gravit.launcher.modules.ModulesManager; import pro.gravit.launchserver.asm.ClassMetadataReader; import pro.gravit.launchserver.asm.SafeClassWriter; public class JAConfigurator { - private static final String modulesManagerName = Type.getInternalName(ModulesManager.class); - private static final String launcherName = Type.getInternalName(Launcher.class); - private static final String modulesManagerDesc = Type.getDescriptor(ModulesManager.class); - private static final String registerModDesc = Type.getMethodDescriptor(Type.VOID_TYPE, Type.getType(Module.class)); + private static final String modulesManagerName = "pro/gravit/launcher/client/ClientModulesManager"; + private static final String launcherName = "pro/gravit/launcher/LauncherEngine"; + private static final String modulesManagerDesc = "Lpro/gravit/launcher/client/ClientModulesManager;"; + private static final String registerModDesc = Type.getMethodDescriptor(Type.VOID_TYPE, Type.getType(LauncherModule.class)); private static final String autoGenConfigName = Type.getInternalName(AutogenConfig.class); private static final String stringDesc = Type.getDescriptor(String.class); private final ClassNode configclass; @@ -47,7 +49,7 @@ public void addModuleClass(String fullName) { initModuleMethod.instructions.add(new FieldInsnNode(Opcodes.GETSTATIC, launcherName, "modulesManager", modulesManagerDesc)); initModuleMethod.instructions.add(new TypeInsnNode(Opcodes.NEW, fullName.replace('.', '/'))); initModuleMethod.instructions.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, fullName.replace('.', '/'), "", "()V")); - initModuleMethod.instructions.add(new MethodInsnNode(Opcodes.INVOKEINTERFACE, modulesManagerName, "registerModule", registerModDesc)); + initModuleMethod.instructions.add(new MethodInsnNode(Opcodes.INVOKEINTERFACE, modulesManagerName, "loadModule", registerModDesc)); } public byte[] getBytecode(ClassMetadataReader reader) { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java index 6005399f..c0fb76a8 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -441,6 +441,7 @@ public static void main(String... args) throws Throwable { //Launcher.modulesManager = new ClientModuleManager(engine); LauncherEngine.modulesManager = new ClientModuleManager(); LauncherConfig.getAutogenConfig().initModules(); //INIT + LauncherEngine.modulesManager.initModules(null); initGson(LauncherEngine.modulesManager); //Launcher.modulesManager.preInitModules(); LauncherEngine.modulesManager.invokeEvent(new PreConfigPhase());