From f9456a14ef58bdc0aa69146be79d781a5df745f9 Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Mon, 29 Jan 2024 21:37:45 -0500 Subject: [PATCH] Allow uncapped pingexecutorthreads --- core/src/mindustry/net/Net.java | 5 ++++- core/src/mindustry/ui/dialogs/SettingsMenuDialog.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/net/Net.java b/core/src/mindustry/net/Net.java index e588fa22fe..602ed9e434 100644 --- a/core/src/mindustry/net/Net.java +++ b/core/src/mindustry/net/Net.java @@ -332,7 +332,10 @@ public void handleServerReceived(NetConnection connection, Packet object){ * If the port is the default mindustry port, SRV records are checked too. */ public void pingHost(String address, int port, Cons valid, Cons failed){ - if(pingExecutor == null) pingExecutor = Threads.cachedExecutor("Server Pings", Core.settings.getInt("pingexecutorthreads", OS.isWindows && !OS.is64Bit ? 5 : 64)); + if(pingExecutor == null) { + int threads = Core.settings.getInt("pingexecutorthreads"); + pingExecutor = Threads.cachedExecutor("Server Pings", threads > 100 ? Integer.MAX_VALUE : threads); + } pingExecutor.submit(() -> provider.pingHost(address, port, valid, failed)); } diff --git a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java index 0667df487f..c4cc775ace 100644 --- a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java +++ b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java @@ -425,7 +425,7 @@ void addSettings(){ client.sliderPref("modautoupdate", 1, 0, 2, s -> s == 0 ? "Disabled" : s == 1 ? "In Background" : "Restart Game"); client.sliderPref("processorstatementscale", 80, 10, 100, 1, s -> String.format("%.2fx", s/100f)); // This is the most scuffed setting you have ever seen client.sliderPref("automapvote", 0, 0, 4, s -> s == 0 ? "Never" : s == 4 ? "Random vote" : "Always " + new String[]{"downvote", "novote", "upvote"}[--s]); - client.sliderPref("pingexecutorthreads", OS.isWindows && !OS.is64Bit ? 5 : 65, 5, 100, 5, s -> "" + s); + client.sliderPref("pingexecutorthreads", OS.isWindows && !OS.is64Bit ? 5 : 65, 5, 105, 5, s -> s > 100 ? "Unlimited" : String.valueOf(s)); client.sliderPref("maxschematicslisted", 300, 0, 3000, 150, s -> s == 0 ? "Unlimited" : String.valueOf(s)); client.textPref("defaultbuildpathargs", "self"); // Keep it to just self. Skill issue players going afk make this too problematic otherwise. client.textPref("defaultminepathargs", "all");