Skip to content

Commit

Permalink
Allow uncapped pingexecutorthreads
Browse files Browse the repository at this point in the history
  • Loading branch information
buthed010203 committed Jan 30, 2024
1 parent 23bb6cc commit f9456a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion core/src/mindustry/net/Net.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Host> valid, Cons<Exception> 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));
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/mindustry/ui/dialogs/SettingsMenuDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit f9456a1

Please sign in to comment.