diff --git a/project/scenes/components/search.tscn b/project/scenes/components/search.tscn index dabe582..23e60ed 100644 --- a/project/scenes/components/search.tscn +++ b/project/scenes/components/search.tscn @@ -51,7 +51,6 @@ theme_override_font_sizes/font_size = 20 theme_override_styles/normal = SubResource("StyleBoxFlat_hyysn") theme_override_styles/focus = SubResource("StyleBoxFlat_hyysn") placeholder_text = "Search or enter address" -select_all_on_focus = true script = ExtResource("1_7ivk2") gate_events = ExtResource("2_13io8") diff --git a/project/scenes/menu_body/world.tscn b/project/scenes/menu_body/world.tscn index b6cde0a..7bd4d7d 100644 --- a/project/scenes/menu_body/world.tscn +++ b/project/scenes/menu_body/world.tscn @@ -278,6 +278,7 @@ command_events = ExtResource("6_18mgg") [node name="GateLoader" type="Node" parent="."] script = ExtResource("1_uxhy6") gate_events = ExtResource("2_q7cvi") +connect_timeout = 10.0 [node name="SandboxManager" type="Node" parent="." node_paths=PackedStringArray("render_result")] script = ExtResource("3_0cpfc") diff --git a/project/scripts/loading/file_downloader.gd b/project/scripts/loading/file_downloader.gd index f7c2499..666f131 100644 --- a/project/scripts/loading/file_downloader.gd +++ b/project/scripts/loading/file_downloader.gd @@ -22,7 +22,7 @@ func _ready() -> void: FileTools.remove_recursive(DOWNLOAD_FOLDER) -func download(url: String) -> String: +func download(url: String, timeout: float = 0) -> String: var save_path = DOWNLOAD_FOLDER + "/" + url.md5_text() + "." + url.get_file().get_extension() if FileAccess.file_exists(save_path): @@ -30,7 +30,7 @@ func download(url: String) -> String: return save_path DirAccess.make_dir_recursive_absolute(save_path.get_base_dir()) - var result = await create_request(url, save_path) + var result = await create_request(url, save_path, timeout) if result == 200: return save_path @@ -58,10 +58,11 @@ func download_shared_lib(url: String, gate_url: String) -> String: return "" -func create_request(url: String, save_path: String) -> int: +func create_request(url: String, save_path: String, timeout: float = 0) -> int: var http = HTTPRequest.new() http.download_file = save_path http.use_threads = true + http.timeout = timeout add_child(http) var timer = create_progress_emitter(url, http) diff --git a/project/scripts/loading/gate_loader.gd b/project/scripts/loading/gate_loader.gd index 366020c..bdc1e16 100644 --- a/project/scripts/loading/gate_loader.gd +++ b/project/scripts/loading/gate_loader.gd @@ -1,6 +1,7 @@ extends Node @export var gate_events: GateEvents +@export var connect_timeout: float var c_gate: ConfigGate @@ -12,7 +13,7 @@ func _ready() -> void: func load_gate(config_url: String) -> void: Debug.logclr("======== " + config_url + " ========", Color.GREEN) - var config_path = await FileDownloader.download(config_url) + var config_path = await FileDownloader.download(config_url, connect_timeout) if config_path.is_empty(): return error(GateEvents.GateError.NOT_FOUND) c_gate = ConfigGate.new(config_path, config_url)