diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-05-27 14:43:46 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-05-27 14:43:46 -0400 |
commit | b30fec976eb6f597ccc2f7eaa2601b81548a15fa (patch) | |
tree | 9e08810061cd60cc554cff2e8ad9b3bffd89d2ea /Archipelago | |
parent | 0478b3ab159d4d2efebe7b3141580383f6f6f108 (diff) | |
download | lingo-archipelago-b30fec976eb6f597ccc2f7eaa2601b81548a15fa.tar.gz lingo-archipelago-b30fec976eb6f597ccc2f7eaa2601b81548a15fa.tar.bz2 lingo-archipelago-b30fec976eb6f597ccc2f7eaa2601b81548a15fa.zip |
Fixed art gallery starting room bug v0.6.0
The issue: there was a transient issue (more prevalent for certain users) where a painting from the art gallery would appear in the starting room (at the world origin). The cause: Unlike every other item, the art gallery painting items are not idempotent, so if one is re-processed it behaves differently than the original time it was processed; specifically, it would fail to find the painting it needs to replace, so the current painting would be moved to the origin. This issue was flaky because it would only occur if the AP item resync that's requested at connection time was not received by the client until after the map finished loading. The solution: Receipt indices are now saved as items are processed, and received items with an index that has already been processed are not re-processed.
Diffstat (limited to 'Archipelago')
-rw-r--r-- | Archipelago/client.gd | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 5bd6f0a..88a6a8b 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -95,6 +95,7 @@ var _held_locations = [] | |||
95 | var _last_new_item = -1 | 95 | var _last_new_item = -1 |
96 | var _progressive_progress = {} | 96 | var _progressive_progress = {} |
97 | var _has_colors = ["white"] | 97 | var _has_colors = ["white"] |
98 | var _received_indexes = [] | ||
98 | 99 | ||
99 | signal could_not_connect | 100 | signal could_not_connect |
100 | signal connect_status | 101 | signal connect_status |
@@ -324,12 +325,6 @@ func _on_data(): | |||
324 | global._print(message) | 325 | global._print(message) |
325 | 326 | ||
326 | elif cmd == "ReceivedItems": | 327 | elif cmd == "ReceivedItems": |
327 | if message["index"] == 0: | ||
328 | # We are being sent all of our items, so lets reset any progress | ||
329 | # on progressive items. | ||
330 | _progressive_progress.clear() | ||
331 | _held_items = [] | ||
332 | |||
333 | var i = 0 | 328 | var i = 0 |
334 | for item in message["items"]: | 329 | for item in message["items"]: |
335 | if _map_loaded: | 330 | if _map_loaded: |
@@ -555,6 +550,8 @@ func completedGoal(): | |||
555 | 550 | ||
556 | func mapFinishedLoading(): | 551 | func mapFinishedLoading(): |
557 | if !_map_loaded: | 552 | if !_map_loaded: |
553 | _received_indexes.clear() | ||
554 | _progressive_progress.clear() | ||
558 | _has_colors = ["white"] | 555 | _has_colors = ["white"] |
559 | emit_signal("evaluate_solvability") | 556 | emit_signal("evaluate_solvability") |
560 | 557 | ||
@@ -569,6 +566,13 @@ func mapFinishedLoading(): | |||
569 | 566 | ||
570 | 567 | ||
571 | func processItem(item, index, from, flags): | 568 | func processItem(item, index, from, flags): |
569 | if index != null: | ||
570 | if _received_indexes.has(index): | ||
571 | # Do not re-process items. | ||
572 | return | ||
573 | |||
574 | _received_indexes.append(index) | ||
575 | |||
572 | global._print(item) | 576 | global._print(item) |
573 | 577 | ||
574 | var stringified = String(item) | 578 | var stringified = String(item) |