mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Updated server browser to order servers by player count, then by ping.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
class W3DHub
|
||||
class Api
|
||||
class ServerListServer
|
||||
NO_OR_BAD_PING = 1_000_000
|
||||
|
||||
attr_reader :id, :game, :address, :port, :region, :channel, :ping, :status
|
||||
|
||||
def initialize(hash)
|
||||
@@ -12,7 +14,7 @@ class W3DHub
|
||||
@port = @data[:port]
|
||||
@region = @data[:region]
|
||||
@channel = @data[:channel] || "release"
|
||||
@ping = -1
|
||||
@ping = NO_OR_BAD_PING
|
||||
|
||||
@status = Status.new(@data[:status])
|
||||
|
||||
@@ -55,7 +57,7 @@ class W3DHub
|
||||
end
|
||||
end
|
||||
|
||||
@ping = -1 if @ping.zero?
|
||||
@ping = NO_OR_BAD_PING if @ping.zero?
|
||||
|
||||
@ping
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user