[FIX] json расширение вместо conf/cfg

This commit is contained in:
Gravit 2019-06-28 16:27:05 +07:00
parent e556bd70e8
commit b93c7d33eb
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
2 changed files with 18 additions and 4 deletions

View file

@ -463,8 +463,22 @@ public LaunchServer(Path dir, boolean testEnv, String[] args) throws IOException
launcherLibraries = dir.resolve("launcher-libraries"); launcherLibraries = dir.resolve("launcher-libraries");
launcherLibrariesCompile = dir.resolve("launcher-libraries-compile"); launcherLibrariesCompile = dir.resolve("launcher-libraries-compile");
this.args = Arrays.asList(args); this.args = Arrays.asList(args);
configFile = dir.resolve("LaunchServer.conf"); if(IOHelper.exists(dir.resolve("LaunchServer.conf")))
runtimeConfigFile = dir.resolve("RuntimeLaunchServer.conf"); {
configFile = dir.resolve("LaunchServer.conf");
}
else
{
configFile = dir.resolve("LaunchServer.json");
}
if(IOHelper.exists(dir.resolve("RuntimeLaunchServer.conf")))
{
runtimeConfigFile = dir.resolve("RuntimeLaunchServer.conf");
}
else
{
runtimeConfigFile = dir.resolve("RuntimeLaunchServer.json");
}
publicKeyFile = dir.resolve("public.key"); publicKeyFile = dir.resolve("public.key");
privateKeyFile = dir.resolve("private.key"); privateKeyFile = dir.resolve("private.key");
updatesDir = dir.resolve("updates"); updatesDir = dir.resolve("updates");
@ -765,7 +779,7 @@ private void generateConfigIfNotExists(boolean testEnv) throws IOException {
LogHelper.error("ProjectName null. Using MineCraft"); LogHelper.error("ProjectName null. Using MineCraft");
newConfig.projectName = "MineCraft"; newConfig.projectName = "MineCraft";
} }
newConfig.netty.address = "ws://" + address + ":9274/api"; newConfig.netty.address = "ws://" + address + ":9274/api";
newConfig.netty.downloadURL = "http://" + address + ":9274/%dirname%/"; newConfig.netty.downloadURL = "http://" + address + ":9274/%dirname%/";
newConfig.netty.launcherURL = "http://" + address + ":9274/Launcher.jar"; newConfig.netty.launcherURL = "http://" + address + ":9274/Launcher.jar";

View file

@ -58,7 +58,7 @@ public void invoke(String... args) throws IOException, CommandException {
client.setTitle(dirName); client.setTitle(dirName);
client.setDir(dirName); client.setDir(dirName);
try (BufferedWriter writer = IOHelper.newWriter(IOHelper.resolveIncremental(server.profilesDir, try (BufferedWriter writer = IOHelper.newWriter(IOHelper.resolveIncremental(server.profilesDir,
dirName, "cfg"))) { dirName, "json"))) {
Launcher.gsonManager.configGson.toJson(client, writer); Launcher.gsonManager.configGson.toJson(client, writer);
} }