Изменение имени wrapper'а

This commit is contained in:
Gravit 2018-09-20 18:52:52 +07:00
parent 303402310b
commit 6e648e17ad
3 changed files with 10 additions and 1 deletions

View file

@ -29,7 +29,6 @@
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.zip.CRC32; import java.util.zip.CRC32;
import org.apache.commons.io.FileUtils;
import ru.gravit.launcher.LauncherAPI; import ru.gravit.launcher.LauncherAPI;
import ru.gravit.launcher.hasher.HashedDir; import ru.gravit.launcher.hasher.HashedDir;
import ru.gravit.utils.helper.CommonHelper; import ru.gravit.utils.helper.CommonHelper;
@ -95,6 +94,8 @@ public static final class Config extends ConfigObject {
@LauncherAPI @LauncherAPI
public final String authRejectString; public final String authRejectString;
@LauncherAPI @LauncherAPI
public final String projectName;
@LauncherAPI
public final String whitelistRejectString; public final String whitelistRejectString;
@LauncherAPI @LauncherAPI
public final boolean genMappings; public final boolean genMappings;
@ -135,6 +136,7 @@ private Config(BlockConfigEntry block, Path coredir) {
launch4j = new ExeConf(block.getEntry("launch4J", BlockConfigEntry.class)); launch4j = new ExeConf(block.getEntry("launch4J", BlockConfigEntry.class));
sign = new SignConf(block.getEntry("signing", BlockConfigEntry.class), coredir); sign = new SignConf(block.getEntry("signing", BlockConfigEntry.class), coredir);
binaryName = block.getEntryValue("binaryName", StringConfigEntry.class); binaryName = block.getEntryValue("binaryName", StringConfigEntry.class);
projectName = block.hasEntry("projectName") ? block.getEntryValue("projectName", StringConfigEntry.class) : "Minecraft";
compress = block.getEntryValue("compress", BooleanConfigEntry.class); compress = block.getEntryValue("compress", BooleanConfigEntry.class);
} }

View file

@ -55,6 +55,12 @@ public void setAddress(String address)
body.append(address); body.append(address);
body.append("\";"); body.append("\";");
} }
public void setProjectName(String name)
{
body.append("this.projectname = \"");
body.append(name);
body.append("\";");
}
public void setPort(int port) public void setPort(int port)
{ {

View file

@ -134,6 +134,7 @@ private void stdBuild() throws IOException {
server.buildHookManager.preHook(context); server.buildHookManager.preHook(context);
jaConfigurator.setAddress(server.config.getAddress()); jaConfigurator.setAddress(server.config.getAddress());
jaConfigurator.setPort(server.config.port); jaConfigurator.setPort(server.config.port);
jaConfigurator.setProjectName(server.config.projectName);
server.buildHookManager.registerAllClientModuleClass(jaConfigurator); server.buildHookManager.registerAllClientModuleClass(jaConfigurator);
try (ZipInputStream input = new ZipInputStream( try (ZipInputStream input = new ZipInputStream(
IOHelper.newInput(IOHelper.getResourceURL("Launcher.jar")))) { IOHelper.newInput(IOHelper.getResourceURL("Launcher.jar")))) {