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:
2026-10-15 11:34:17 -05:00
parent 936b1ae5d9
commit e344a492e0
4 changed files with 42 additions and 32 deletions

View File

@@ -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