mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +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);
|
||||
}
|
||||
if (address == null) {
|
||||
System.out.println("LaunchServer address(default: localhost): ");
|
||||
System.out.println("External launchServer address:port (default: localhost:9274): ");
|
||||
address = commandHandler.readLine();
|
||||
}
|
||||
String projectName = System.getenv("PROJECTNAME");
|
||||
|
@ -234,18 +234,18 @@ public static void generateConfigIfNotExists(Path configFile, CommandHandler com
|
|||
newConfig.setProjectName(projectName);
|
||||
}
|
||||
if (address == null || address.isEmpty()) {
|
||||
logger.error("Address null. Using localhost");
|
||||
address = "localhost";
|
||||
logger.error("Address null. Using localhost:9274");
|
||||
address = "localhost:9274";
|
||||
}
|
||||
if (newConfig.projectName == null || newConfig.projectName.isEmpty()) {
|
||||
logger.error("ProjectName null. Using MineCraft");
|
||||
newConfig.projectName = "MineCraft";
|
||||
}
|
||||
|
||||
newConfig.netty.address = "ws://" + address + ":9274/api";
|
||||
newConfig.netty.downloadURL = "http://" + address + ":9274/%dirname%/";
|
||||
newConfig.netty.launcherURL = "http://" + address + ":9274/Launcher.jar";
|
||||
newConfig.netty.launcherEXEURL = "http://" + address + ":9274/Launcher.exe";
|
||||
newConfig.netty.address = "ws://" + address + "/api";
|
||||
newConfig.netty.downloadURL = "http://" + address + "/%dirname%/";
|
||||
newConfig.netty.launcherURL = "http://" + address + "/Launcher.jar";
|
||||
newConfig.netty.launcherEXEURL = "http://" + address + "/Launcher.exe";
|
||||
|
||||
// Write LaunchServer config
|
||||
logger.info("Writing LaunchServer config file");
|
||||
|
|
Loading…
Reference in a new issue