diff --git a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java index e42b62a7..8fcdeada 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java @@ -87,6 +87,7 @@ public static void main(String[] args) throws Throwable { modulesManager.preInitModules(); LogHelper.debug("Read ServerWrapperConfig.json"); gsonBuiler = new GsonBuilder(); + gsonBuiler.setPrettyPrinting(); gson = gsonBuiler.create(); generateConfigIfNotExists(); try(Reader reader = IOHelper.newReader(configFile)) @@ -99,7 +100,7 @@ public static void main(String[] args) throws Throwable { else CommonHelper.newThread("Server Auth Thread", true, () -> ServerWrapper.loopAuth(wrapper, config.reconnectCount, config.reconnectSleep)); modulesManager.initModules(); - String classname = config.mainclass.isEmpty() ? args[0] : config.mainclass; + String classname = (config.mainclass == null || config.mainclass.isEmpty()) ? args[0] : config.mainclass; if (classname.length() == 0) { LogHelper.error("MainClass not found. Please set MainClass for ServerWrapper.cfg or first commandline argument"); } @@ -152,6 +153,7 @@ private static void generateConfigIfNotExists() throws IOException { newConfig.port = 7240; newConfig.login = "login"; newConfig.password = "password"; + newConfig.mainclass = ""; //try(Reader reader = IOHelper.newReader(IOHelper.getResourceURL("ru/gravit/launcher/server/ServerWrapper.cfg"))) //{ // newConfig = gson.fromJson(reader,Config.class); diff --git a/modules b/modules index ec143160..eec958f2 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit ec1431605c4951ace5cbd2ab392b67cea25bddd5 +Subproject commit eec958f2c5edbc7c053686ab7cebaab8dbca2778