mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Removed hardcoded GSH endpoint from signalr server list updater, moved direct connect button to the right of the server list, added a slight gradient to buttons so their not totally flat.
This commit is contained in:
@@ -262,6 +262,8 @@ class W3DHub
|
||||
#! === Server List API === !#
|
||||
|
||||
SERVER_LIST_ENDPOINT = "https://gsh.w3dhub.com".freeze
|
||||
# SERVER_LIST_ENDPOINT = "https://gsh.w3d.cyberarm.dev".freeze
|
||||
# SERVER_LIST_ENDPOINT = "http://127.0.0.1:9292".freeze
|
||||
GSH_CONNECTION = Excon.new(SERVER_LIST_ENDPOINT, persistent: true)
|
||||
|
||||
def self.get(url, headers = DEFAULT_HEADERS, body = nil, api = :api)
|
||||
|
||||
@@ -35,7 +35,7 @@ class W3DHub
|
||||
puts e
|
||||
puts e.backtrace
|
||||
|
||||
sleep 10
|
||||
sleep 30
|
||||
retry
|
||||
end
|
||||
end
|
||||
@@ -48,12 +48,18 @@ class W3DHub
|
||||
@auto_reconnect = false
|
||||
|
||||
logger.debug(LOG_TAG) { "Requesting connection token..." }
|
||||
response = Excon.post("https://gsh.w3dhub.com/listings/push/v2/negotiate?negotiateVersion=1", headers: Api::DEFAULT_HEADERS, body: "")
|
||||
response = Api.post("#{Api::SERVER_LIST_ENDPOINT}/listings/push/v2/negotiate?negotiateVersion=1", Api::DEFAULT_HEADERS, "", :gsh)
|
||||
|
||||
if response.status != 200
|
||||
@auto_reconnect = true
|
||||
return
|
||||
end
|
||||
|
||||
data = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
@invocation_id = 0 if @invocation_id > 9095
|
||||
id = data[:connectionToken]
|
||||
endpoint = "https://gsh.w3dhub.com/listings/push/v2?id=#{id}"
|
||||
endpoint = "#{Api::SERVER_LIST_ENDPOINT}/listings/push/v2?id=#{id}"
|
||||
|
||||
logger.debug(LOG_TAG) { "Connecting to websocket..." }
|
||||
this = self
|
||||
|
||||
@@ -63,19 +63,13 @@ class W3DHub
|
||||
populate_server_list
|
||||
end
|
||||
end
|
||||
|
||||
# button get_image("#{GAME_ROOT_PATH}/media/ui_icons/return.png"), tip: I18n.t(:"server_browser.refresh"), image_height: 1.0, margin_left: 16, padding_left: 2, padding_right: 2, padding_top: 2, padding_bottom: 2 do
|
||||
# fetch_server_list
|
||||
# end
|
||||
|
||||
flow(fill: true)
|
||||
|
||||
button "Direct Connect", height: 1.0, padding_top: 4, padding_bottom: 4 do
|
||||
push_state(W3DHub::States::DirectConnectDialog)
|
||||
end
|
||||
end
|
||||
|
||||
flow(min_width: 372, width: 0.38, max_width: 512, height: 1.0) do |container|
|
||||
button "Direct Connect", height: 1.0, padding_top: 4, padding_bottom: 4 do
|
||||
push_state(W3DHub::States::DirectConnectDialog)
|
||||
end
|
||||
|
||||
flow(fill: true)
|
||||
|
||||
para "#{I18n.t(:"server_browser.nickname")}:"
|
||||
|
||||
19
lib/theme.rb
19
lib/theme.rb
@@ -80,15 +80,15 @@ class W3DHub
|
||||
padding_bottom: 8,
|
||||
border_thickness: 2,
|
||||
border_color: Gosu::Color::NONE,
|
||||
background: 0xff_0074e0,
|
||||
background: 0xff_0074e0..0xff_0052c0,
|
||||
hover: {
|
||||
color: 0xff_f2f2f2,
|
||||
background: 0xff_004c94,
|
||||
background: 0xff_0052c0..0xff_0030a0,
|
||||
border_color: 0xff_0074e0
|
||||
},
|
||||
active: {
|
||||
color: 0xff_aaaaaa,
|
||||
background: 0xff_005aad,
|
||||
background: 0xff_0030a0..0xff_0052c0,
|
||||
border_color: 0xff_0074e0
|
||||
}
|
||||
},
|
||||
@@ -151,7 +151,18 @@ class W3DHub
|
||||
MenuItem: {
|
||||
width: 1.0,
|
||||
text_left: :left,
|
||||
margin: 0
|
||||
margin: 0,
|
||||
border_color: Gosu::Color::NONE,
|
||||
background: 0xff_0074e0,
|
||||
hover: {
|
||||
color: 0xff_f2f2f2,
|
||||
background: 0xff_0052c0,
|
||||
border_color: Gosu::Color::NONE
|
||||
},
|
||||
active: {
|
||||
background: 0xff_0030a0,
|
||||
border_color: Gosu::Color::NONE
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user