mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2026-11-05 01:24:06 +00:00
JOIN button now pulls up a dialog with the auto selected game server to confirm player wants to join that server; TODO: If only one server exists then join that one directly, if multiple exist the offer the 'best' three or something, don't crash if we somehow get a server update without the server list being nil
This commit is contained in:
@@ -57,12 +57,12 @@ module W3DHubLauncher
|
||||
channel = MemCache[:applications].find { |appl| appl.id == app.id }&.channels&.find { |c| c.id == app.channel }
|
||||
return nil unless channel
|
||||
|
||||
server_options = MemCache[:servers].select do |server|
|
||||
server_options = (MemCache[:servers]&.select do |server|
|
||||
server.game == app.id &&
|
||||
server.channel == channel.server_channel &&
|
||||
!server.password? &&
|
||||
server.player_count < server.max_players
|
||||
end.sort_by do |s|
|
||||
end || []).sort_by do |s|
|
||||
[s.player_count, -s.ping]
|
||||
end.reverse
|
||||
|
||||
|
||||
Reference in New Issue
Block a user