diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index f530696c..712cea14 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -29,7 +29,6 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.zip.CRC32; -import org.apache.commons.io.FileUtils; import ru.gravit.launcher.LauncherAPI; import ru.gravit.launcher.hasher.HashedDir; import ru.gravit.utils.helper.CommonHelper; @@ -95,6 +94,8 @@ public static final class Config extends ConfigObject { @LauncherAPI public final String authRejectString; @LauncherAPI + public final String projectName; + @LauncherAPI public final String whitelistRejectString; @LauncherAPI public final boolean genMappings; @@ -135,6 +136,7 @@ private Config(BlockConfigEntry block, Path coredir) { launch4j = new ExeConf(block.getEntry("launch4J", BlockConfigEntry.class)); sign = new SignConf(block.getEntry("signing", BlockConfigEntry.class), coredir); binaryName = block.getEntryValue("binaryName", StringConfigEntry.class); + projectName = block.hasEntry("projectName") ? block.getEntryValue("projectName", StringConfigEntry.class) : "Minecraft"; compress = block.getEntryValue("compress", BooleanConfigEntry.class); } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JAConfigurator.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JAConfigurator.java index 5f7edde8..3fbfc78b 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JAConfigurator.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JAConfigurator.java @@ -55,6 +55,12 @@ public void setAddress(String address) body.append(address); body.append("\";"); } + public void setProjectName(String name) + { + body.append("this.projectname = \""); + body.append(name); + body.append("\";"); + } public void setPort(int port) { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java index e82278d5..af2d8856 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java @@ -134,6 +134,7 @@ private void stdBuild() throws IOException { server.buildHookManager.preHook(context); jaConfigurator.setAddress(server.config.getAddress()); jaConfigurator.setPort(server.config.port); + jaConfigurator.setProjectName(server.config.projectName); server.buildHookManager.registerAllClientModuleClass(jaConfigurator); try (ZipInputStream input = new ZipInputStream( IOHelper.newInput(IOHelper.getResourceURL("Launcher.jar")))) {