diff options
-rw-r--r-- | Archipelago/client.gd | 18 | ||||
-rw-r--r-- | Archipelago/load.gd | 7 |
2 files changed, 19 insertions, 6 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index cbddf89..0f121a1 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -31,6 +31,7 @@ var _panel_ids_by_location = {} | |||
31 | 31 | ||
32 | var _map_loaded = false | 32 | var _map_loaded = false |
33 | var _held_items = [] | 33 | var _held_items = [] |
34 | var _held_locations = [] | ||
34 | 35 | ||
35 | signal client_connected | 36 | signal client_connected |
36 | 37 | ||
@@ -130,6 +131,8 @@ func _on_data(): | |||
130 | if _slot_data.has("panel_ids_by_location_id"): | 131 | if _slot_data.has("panel_ids_by_location_id"): |
131 | _panel_ids_by_location = _slot_data["panel_ids_by_location_id"] | 132 | _panel_ids_by_location = _slot_data["panel_ids_by_location_id"] |
132 | 133 | ||
134 | requestSync() | ||
135 | |||
133 | emit_signal("client_connected") | 136 | emit_signal("client_connected") |
134 | 137 | ||
135 | elif cmd == "ConnectionRefused": | 138 | elif cmd == "ConnectionRefused": |
@@ -205,18 +208,27 @@ func connectToRoom(): | |||
205 | ) | 208 | ) |
206 | 209 | ||
207 | 210 | ||
211 | func requestSync(): | ||
212 | sendMessage([{"cmd": "Sync"}]) | ||
213 | |||
214 | |||
208 | func sendLocation(loc_id): | 215 | func sendLocation(loc_id): |
209 | sendMessage([{"cmd": "LocationChecks", "locations": [loc_id]}]) | 216 | if _map_loaded: |
217 | sendMessage([{"cmd": "LocationChecks", "locations": [loc_id]}]) | ||
218 | else: | ||
219 | _held_locations.append(loc_id) | ||
210 | 220 | ||
211 | 221 | ||
212 | func mapFinishedLoading(): | 222 | func mapFinishedLoading(): |
213 | if !_map_loaded: | 223 | if !_map_loaded: |
214 | _map_loaded = true | ||
215 | |||
216 | for item in _held_items: | 224 | for item in _held_items: |
217 | processItem(item) | 225 | processItem(item) |
218 | 226 | ||
227 | sendMessage([{"cmd": "LocationChecks", "locations": _held_locations}]) | ||
228 | |||
229 | _map_loaded = true | ||
219 | _held_items = [] | 230 | _held_items = [] |
231 | _held_locations = [] | ||
220 | 232 | ||
221 | 233 | ||
222 | func processItem(item): | 234 | func processItem(item): |
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index b0ccafc..cb592ff 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd | |||
@@ -28,9 +28,10 @@ func _load(): | |||
28 | "answer_correct", location, "handle_correct" | 28 | "answer_correct", location, "handle_correct" |
29 | ) | 29 | ) |
30 | 30 | ||
31 | # Process any items received while the map was loading. | ||
32 | apclient.mapFinishedLoading() | ||
33 | |||
34 | # Proceed with the rest of the load. | 31 | # Proceed with the rest of the load. |
35 | global._print("Hooked Load End") | 32 | global._print("Hooked Load End") |
36 | ._load() | 33 | ._load() |
34 | |||
35 | # Process any items received while the map was loading, and send the checks | ||
36 | # from the save load. | ||
37 | apclient.mapFinishedLoading() | ||