Thread count automatically creating fix.

This commit is contained in:
zaxar163 2019-01-04 17:04:45 +04:00 committed by Gravit
parent b49d17a018
commit a8153c9101

View file

@ -568,9 +568,9 @@ private void generateConfigIfNotExists() throws IOException {
newConfig.authRejectString = "Превышен лимит авторизаций";
newConfig.binaryName = "Launcher";
newConfig.whitelistRejectString = "Вас нет в белом списке";
//try (BufferedReader reader = IOHelper.newReader(IOHelper.getResourceURL("ru/gravit/launchserver/defaults/config.cfg"))) {
// newConfig = Launcher.gson.fromJson(reader,Config.class);
//}
newConfig.threadCoreCount = 0; // on your own
newConfig.threadCount = JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors() >= 4 ? JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors() / 2 : JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors();
// Set server address
LogHelper.println("LaunchServer address: ");