diff options
-rw-r--r-- | Archipelago/client.gd | 14 | ||||
-rw-r--r-- | 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 | |||
22 | var _initiated_disconnect = false | 22 | var _initiated_disconnect = false |
23 | 23 | ||
24 | var _datapackages = {} | 24 | var _datapackages = {} |
25 | var _pending_packages = [] | ||
25 | var _item_id_to_name = {} # All games | 26 | var _item_id_to_name = {} # All games |
26 | var _location_id_to_name = {} # All games | 27 | var _location_id_to_name = {} # All games |
27 | var _item_name_to_id = {} # LINGO only | 28 | var _item_name_to_id = {} # LINGO only |
@@ -159,7 +160,9 @@ func _on_data(): | |||
159 | needed_games.append(game) | 160 | needed_games.append(game) |
160 | 161 | ||
161 | if !needed_games.empty(): | 162 | if !needed_games.empty(): |
162 | requestDatapackages(needed_games) | 163 | _pending_packages = needed_games |
164 | var cur_needed = _pending_packages.pop_front() | ||
165 | requestDatapackages([cur_needed]) | ||
163 | else: | 166 | else: |
164 | connectToRoom() | 167 | connectToRoom() |
165 | 168 | ||
@@ -167,8 +170,13 @@ func _on_data(): | |||
167 | for game in message["data"]["games"].keys(): | 170 | for game in message["data"]["games"].keys(): |
168 | _datapackages[game] = message["data"]["games"][game] | 171 | _datapackages[game] = message["data"]["games"][game] |
169 | saveSettings() | 172 | saveSettings() |
170 | processDatapackages() | 173 | |
171 | connectToRoom() | 174 | if !_pending_packages.empty(): |
175 | var cur_needed = _pending_packages.pop_front() | ||
176 | requestDatapackages([cur_needed]) | ||
177 | else: | ||
178 | processDatapackages() | ||
179 | connectToRoom() | ||
172 | 180 | ||
173 | elif cmd == "Connected": | 181 | elif cmd == "Connected": |
174 | _authenticated = true | 182 | _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(): | |||
22 | # loaded but the panels haven't been solved from the save file yet. | 22 | # loaded but the panels haven't been solved from the save file yet. |
23 | var panels_parent = self.get_node("Panels") | 23 | var panels_parent = self.get_node("Panels") |
24 | var location_script = ResourceLoader.load("user://maps/Archipelago/location.gd") | 24 | var location_script = ResourceLoader.load("user://maps/Archipelago/location.gd") |
25 | for location_name in apclient._location_name_to_id: | 25 | for location_id in apclient._panel_ids_by_location.keys(): |
26 | var location = location_script.new() | 26 | var location = location_script.new() |
27 | location.ap_name = location_name | 27 | location.ap_id = int(location_id) |
28 | location.ap_id = apclient._location_name_to_id[location_name] | ||
29 | location.name = "AP_location_" + location.ap_id | 28 | location.name = "AP_location_" + location.ap_id |
30 | self.add_child(location) | 29 | self.add_child(location) |
31 | 30 | ||