mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Websocket based server list updater now works, gui needs a bit of work to not flash when refreshing list
This commit is contained in:
@@ -16,6 +16,18 @@ class W3DHub
|
||||
@status = @data[:status] ? Status.new(@data[:status]) : nil
|
||||
end
|
||||
|
||||
def update(hash)
|
||||
if @status
|
||||
@status.instance_variable_set(:@name, hash[:name])
|
||||
@status.instance_variable_set(:@password, hash[:password] || false)
|
||||
@status.instance_variable_set(:@map, hash[:map])
|
||||
@status.instance_variable_set(:@max_players, hash[:maxplayers])
|
||||
@status.instance_variable_set(:@player_count, hash[:numplayers] || 0)
|
||||
@status.instance_variable_set(:@started, hash[:started])
|
||||
@status.instance_variable_set(:@remaining, hash[:remaining])
|
||||
end
|
||||
end
|
||||
|
||||
class Status
|
||||
attr_reader :name, :password, :map, :max_players, :player_count, :started, :remaining, :teams, :players
|
||||
|
||||
|
||||
Reference in New Issue
Block a user