Фиксы номера порта и ServerWrapper

This commit is contained in:
Gravit 2018-09-24 19:59:42 +07:00
parent 96167e81a3
commit 526742b375
2 changed files with 5 additions and 5 deletions

View file

@ -146,7 +146,7 @@ public void write(HOutput output) throws IOException {
private static final String[] EMPTY_ARRAY = new String[0]; private static final String[] EMPTY_ARRAY = new String[0];
private static final String SOCKET_HOST = "127.0.0.1"; private static final String SOCKET_HOST = "127.0.0.1";
private static final int SOCKET_PORT = 87564; private static final int SOCKET_PORT = 32148;
private static final String MAGICAL_INTEL_OPTION = "-XX:HeapDumpPath=ThisTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump"; private static final String MAGICAL_INTEL_OPTION = "-XX:HeapDumpPath=ThisTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump";
private static final boolean isUsingWrapper = true; private static final boolean isUsingWrapper = true;
@SuppressWarnings("unused") @SuppressWarnings("unused")
@ -310,7 +310,7 @@ public static Process launch(
clientHDir.write(output); clientHDir.write(output);
} }
} }
} catch (IOException e) { } catch (Exception e) {
LogHelper.error(e); LogHelper.error(e);
try (HOutput output = new HOutput(IOHelper.newOutput(paramsFile))) { try (HOutput output = new HOutput(IOHelper.newOutput(paramsFile))) {
params.write(output); params.write(output);

View file

@ -36,7 +36,7 @@ public static void main(String[] args) throws Throwable {
modulesManager.autoload(Paths.get("modules")); modulesManager.autoload(Paths.get("modules"));
Launcher.modulesManager = modulesManager; Launcher.modulesManager = modulesManager;
LauncherConfig cfg = new LauncherConfig(new HInput(IOHelper.newInput(IOHelper.getResourceURL(Launcher.CONFIG_FILE)))); LauncherConfig cfg = new LauncherConfig(new HInput(IOHelper.newInput(IOHelper.getResourceURL(Launcher.CONFIG_FILE))));
configFile = IOHelper.WORKING_DIR.resolve("ServerWrapper.cfg"); configFile = Paths.get("ServerWrapper.cfg");
modulesManager.preInitModules(); modulesManager.preInitModules();
generateConfigIfNotExists(); generateConfigIfNotExists();
try (BufferedReader reader = IOHelper.newReader(configFile)) { try (BufferedReader reader = IOHelper.newReader(configFile)) {
@ -73,7 +73,7 @@ private static void generateConfigIfNotExists() throws IOException {
return; return;
// Create new config // Create new config
LogHelper.info("Creating LaunchServer config"); LogHelper.info("Creating LaunchWrapper config");
Config newConfig; Config newConfig;
try (BufferedReader reader = IOHelper.newReader(IOHelper.getResourceURL("ru/gravit/launcher/server/config.cfg"))) { try (BufferedReader reader = IOHelper.newReader(IOHelper.getResourceURL("ru/gravit/launcher/server/config.cfg"))) {
newConfig = new Config(TextConfigReader.read(reader, false)); newConfig = new Config(TextConfigReader.read(reader, false));
@ -82,7 +82,7 @@ private static void generateConfigIfNotExists() throws IOException {
LogHelper.warning("Title is not set. Please show ServerWrapper.cfg"); LogHelper.warning("Title is not set. Please show ServerWrapper.cfg");
// Write LaunchServer config // Write LaunchServer config
LogHelper.info("Writing LaunchServer config file"); LogHelper.info("Writing LaunchWrapper config file");
try (BufferedWriter writer = IOHelper.newWriter(configFile)) { try (BufferedWriter writer = IOHelper.newWriter(configFile)) {
TextConfigWriter.write(newConfig.block, writer, true); TextConfigWriter.write(newConfig.block, writer, true);
} }