From 14ef44e0d9233b651398c9b7c05d9133bd98be44 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 26 Apr 2023 22:28:05 -0400 Subject: Fixed handshake failure from too-large data packages The needed datapackages are requested one-by-one, now. --- Archipelago/client.gd | 14 +++++++++++--- Archipelago/load.gd | 5 ++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Archipelago/client.gd b/Archipelago/client.gd index d7e100a..f2cddb6 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -22,6 +22,7 @@ var _should_process = false var _initiated_disconnect = false var _datapackages = {} +var _pending_packages = [] var _item_id_to_name = {} # All games var _location_id_to_name = {} # All games var _item_name_to_id = {} # LINGO only @@ -159,7 +160,9 @@ func _on_data(): needed_games.append(game) if !needed_games.empty(): - requestDatapackages(needed_games) + _pending_packages = needed_games + var cur_needed = _pending_packages.pop_front() + requestDatapackages([cur_needed]) else: connectToRoom() @@ -167,8 +170,13 @@ func _on_data(): for game in message["data"]["games"].keys(): _datapackages[game] = message["data"]["games"][game] saveSettings() - processDatapackages() - connectToRoom() + + if !_pending_packages.empty(): + var cur_needed = _pending_packages.pop_front() + requestDatapackages([cur_needed]) + else: + processDatapackages() + connectToRoom() elif cmd == "Connected": _authenticated = true diff --git a/Archipelago/load.gd b/Archipelago/load.gd index ea8eb5f..e3ae24e 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -22,10 +22,9 @@ func _load(): # loaded but the panels haven't been solved from the save file yet. var panels_parent = self.get_node("Panels") var location_script = ResourceLoader.load("user://maps/Archipelago/location.gd") - for location_name in apclient._location_name_to_id: + for location_id in apclient._panel_ids_by_location.keys(): var location = location_script.new() - location.ap_name = location_name - location.ap_id = apclient._location_name_to_id[location_name] + location.ap_id = int(location_id) location.name = "AP_location_" + location.ap_id self.add_child(location) -- cgit 1.4.1