From adff1f9159a90400562b9f1b69d3f72d088ad272 Mon Sep 17 00:00:00 2001 From: Cyberarm Date: Sat, 17 Jan 2026 13:32:51 -0600 Subject: [PATCH] Fix play now auto-selected servers not sorted by ping --- lib/application_manager.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/application_manager.rb b/lib/application_manager.rb index 4a322af..e3bf2e5 100644 --- a/lib/application_manager.rb +++ b/lib/application_manager.rb @@ -254,14 +254,14 @@ class W3DHub server.channel == channel && !server.status.password && server.status.player_count < server.status.max_players - end + end.sort_by(&:ping) # try to find server with lowest ping and matching version found_server = server_options.find { |server| server.version == app_data[:installed_version] } # try to find server with lowest ping and undefined version found_server ||= server_options.find { |server| server.version == Api::ServerListServer::NO_OR_DEFAULT_VERSION } - found_server ? found_server : nil + found_server || nil end def play_now(app_id, channel)