Thread count automatically creating fix.

This commit is contained in:
zaxar163 2019-01-04 17:04:45 +04:00
parent 34711eea80
commit 631e18d323
No known key found for this signature in database
GPG key ID: CEE900027AE098E0

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: ");