mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FEATURE] Support port in launchserver address in first run
This commit is contained in:
parent
0894e0b9c3
commit
accbbe6b13
1 changed files with 7 additions and 7 deletions
|
@ -220,7 +220,7 @@ public static void generateConfigIfNotExists(Path configFile, CommandHandler com
|
||||||
address = System.getProperty("launchserver.address", null);
|
address = System.getProperty("launchserver.address", null);
|
||||||
}
|
}
|
||||||
if (address == null) {
|
if (address == null) {
|
||||||
System.out.println("LaunchServer address(default: localhost): ");
|
System.out.println("External launchServer address:port (default: localhost:9274): ");
|
||||||
address = commandHandler.readLine();
|
address = commandHandler.readLine();
|
||||||
}
|
}
|
||||||
String projectName = System.getenv("PROJECTNAME");
|
String projectName = System.getenv("PROJECTNAME");
|
||||||
|
@ -234,18 +234,18 @@ public static void generateConfigIfNotExists(Path configFile, CommandHandler com
|
||||||
newConfig.setProjectName(projectName);
|
newConfig.setProjectName(projectName);
|
||||||
}
|
}
|
||||||
if (address == null || address.isEmpty()) {
|
if (address == null || address.isEmpty()) {
|
||||||
logger.error("Address null. Using localhost");
|
logger.error("Address null. Using localhost:9274");
|
||||||
address = "localhost";
|
address = "localhost:9274";
|
||||||
}
|
}
|
||||||
if (newConfig.projectName == null || newConfig.projectName.isEmpty()) {
|
if (newConfig.projectName == null || newConfig.projectName.isEmpty()) {
|
||||||
logger.error("ProjectName null. Using MineCraft");
|
logger.error("ProjectName null. Using MineCraft");
|
||||||
newConfig.projectName = "MineCraft";
|
newConfig.projectName = "MineCraft";
|
||||||
}
|
}
|
||||||
|
|
||||||
newConfig.netty.address = "ws://" + address + ":9274/api";
|
newConfig.netty.address = "ws://" + address + "/api";
|
||||||
newConfig.netty.downloadURL = "http://" + address + ":9274/%dirname%/";
|
newConfig.netty.downloadURL = "http://" + address + "/%dirname%/";
|
||||||
newConfig.netty.launcherURL = "http://" + address + ":9274/Launcher.jar";
|
newConfig.netty.launcherURL = "http://" + address + "/Launcher.jar";
|
||||||
newConfig.netty.launcherEXEURL = "http://" + address + ":9274/Launcher.exe";
|
newConfig.netty.launcherEXEURL = "http://" + address + "/Launcher.exe";
|
||||||
|
|
||||||
// Write LaunchServer config
|
// Write LaunchServer config
|
||||||
logger.info("Writing LaunchServer config file");
|
logger.info("Writing LaunchServer config file");
|
||||||
|
|
Loading…
Reference in a new issue