6 Commits

4 changed files with 15 additions and 45 deletions

View File

@@ -7,14 +7,14 @@ GEM
io-event (~> 1.11)
metrics (~> 0.12)
traces (~> 0.18)
async-http (0.92.1)
async-http (0.93.0)
async (>= 2.10.2)
async-pool (~> 0.11)
io-endpoint (~> 0.14)
io-stream (~> 0.6)
metrics (~> 0.12)
protocol-http (~> 0.49)
protocol-http1 (~> 0.30)
protocol-http (~> 0.58)
protocol-http1 (~> 0.36)
protocol-http2 (~> 0.22)
protocol-url (~> 0.2)
traces (~> 0.10)
@@ -31,13 +31,10 @@ GEM
fiber-local (~> 1.1)
json
cri (2.15.12)
cyberarm_engine (0.24.5)
cyberarm_engine (0.25.0)
gosu (~> 1.1)
digest-crc (0.7.0)
rake (>= 12.0.0, < 14.0.0)
event_emitter (0.2.6)
excon (1.3.2)
logger
ffi (1.17.0)
ffi-win32-extensions (1.1.0)
ffi (>= 1.15.5, <= 1.17.0)
@@ -54,21 +51,19 @@ GEM
json (2.18.0)
libui (0.2.0-x64-mingw-ucrt)
fiddle
logger (1.7.0)
metrics (0.15.0)
mutex_m (0.3.0)
ocran (1.3.17)
fiddle (~> 1.0)
protocol-hpack (1.5.1)
protocol-http (0.57.0)
protocol-http1 (0.35.2)
protocol-http (~> 0.22)
protocol-http (0.58.0)
protocol-http1 (0.36.0)
protocol-http (~> 0.58)
protocol-http2 (0.23.0)
protocol-hpack (~> 1.4)
protocol-http (~> 0.47)
protocol-rack (0.20.0)
protocol-rack (0.21.0)
io-stream (>= 0.10)
protocol-http (~> 0.43)
protocol-http (~> 0.58)
rack (>= 1.0)
protocol-url (0.4.0)
protocol-websocket (0.20.2)
@@ -85,12 +80,6 @@ GEM
sdl2-bindings (0.2.3)
ffi (~> 1.15)
traces (0.18.2)
websocket (1.2.11)
websocket-client-simple (0.9.0)
base64
event_emitter
mutex_m
websocket
win32-process (0.10.0)
ffi (>= 1.0.0)
win32-security (0.5.0)
@@ -107,7 +96,6 @@ DEPENDENCIES
bundler (~> 2.4.3)
cyberarm_engine
digest-crc
excon
ircparser
libui
ocran
@@ -116,7 +104,6 @@ DEPENDENCIES
rexml
rubyzip
sdl2-bindings
websocket-client-simple
win32-process
win32-security

View File

@@ -1,11 +1,6 @@
class W3DHub
class Api
# Set Excon default CA file if found
if (ca_file = W3DHub.ca_bundle_path)
Excon.defaults[:ssl_ca_file] = ca_file
end
LOG_TAG = "W3DHub::Api".freeze
API_TIMEOUT = 30 # seconds

View File

@@ -3,7 +3,7 @@ class W3DHub
class ServerBrowser < Page
def setup
@server_locked_icons = {}
@refresh_server_list = false
@refresh_server_list_at_ms = nil
refresh_server = false
@selected_server ||= nil
@@ -138,8 +138,8 @@ class W3DHub
def update
super
if @refresh_server_list && Gosu.milliseconds >= @refresh_server_list
@refresh_server_list = nil
if @refresh_server_list_at_ms && Gosu.milliseconds >= @refresh_server_list_at_ms
@refresh_server_list_at_ms = nil
# populate_server_list
reorder_server_list
@@ -213,25 +213,13 @@ class W3DHub
server.ping == W3DHub::Api::ServerListServer::NO_OR_BAD_PING ? "Ping failed" : "Ping #{server.ping}ms"
end
def find_element_by_tag(container, tag, list = [])
return unless container
container.children.each do |child|
list << child if child.style.tag == tag
find_element_by_tag(child, tag, list) if child.is_a?(CyberarmEngine::Element::Container)
end
return list.first
end
def refresh_server_list(server, mode = :update) # :remove, :refresh_all
if mode == :refresh_all
populate_server_list
return
end
@refresh_server_list = Gosu.milliseconds + 3_000
@refresh_server_list_at_ms = Gosu.milliseconds + 3_000
@refresh_server = server if @selected_server&.id == server.id
server_container = find_element_by_tag(@server_list_container, server.id)
@@ -390,7 +378,7 @@ class W3DHub
flow(width: 1.0, height: 46, margin_top: 16, margin_bottom: 16) do
game_installed = Store.application_manager.installed?(server.game, server.channel)
game_updatable = Store.application_manager.updateable?(server.game, server.channel)
matching_version = game_installed[:installed_version] == server.version || server.version == Api::ServerListServer::NO_OR_DEFAULT_VERSION
matching_version = (game_installed && game_installed[:installed_version] == server.version) || server.version == Api::ServerListServer::NO_OR_DEFAULT_VERSION
channel = Store.application_manager.channel(server.game, server.channel)
style = ((channel && channel.user_level.downcase.strip == "public") || server.channel == "release") ? {} : TESTING_BUTTON

View File

@@ -1,4 +1,4 @@
class W3DHub
DIR_NAME = "W3DHubAlt".freeze
VERSION = "0.8.1".freeze
VERSION = "0.9.0".freeze
end