mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2026-03-22 04:06:18 +00:00
Consider player count in 'play now' server auto selection :D
This commit is contained in:
@@ -254,7 +254,8 @@ class W3DHub
|
|||||||
server.channel == channel &&
|
server.channel == channel &&
|
||||||
!server.status.password &&
|
!server.status.password &&
|
||||||
server.status.player_count < server.status.max_players
|
server.status.player_count < server.status.max_players
|
||||||
end.sort_by(&:ping)
|
end
|
||||||
|
server_options.sort_by! { |s| [s.status.player_count, s.ping] }.reverse!
|
||||||
|
|
||||||
# try to find server with lowest ping and matching version
|
# try to find server with lowest ping and matching version
|
||||||
found_server = server_options.find { |server| server.version == app_data[:installed_version] }
|
found_server = server_options.find { |server| server.version == app_data[:installed_version] }
|
||||||
|
|||||||
Reference in New Issue
Block a user