From a8153c91013b4e6a9b14d7c8ef65c716090b0574 Mon Sep 17 00:00:00 2001 From: zaxar163 Date: Fri, 4 Jan 2019 17:04:45 +0400 Subject: [PATCH] Thread count automatically creating fix. --- .../src/main/java/ru/gravit/launchserver/LaunchServer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index 2d47fa2e..3742ecd3 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -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: ");