From b30fec976eb6f597ccc2f7eaa2601b81548a15fa Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 27 May 2023 14:43:46 -0400 Subject: Fixed art gallery starting room bug 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. --- Archipelago/client.gd | 16 ++++++++++------ 1 file 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 = [] var _last_new_item = -1 var _progressive_progress = {} var _has_colors = ["white"] +var _received_indexes = [] signal could_not_connect signal connect_status @@ -324,12 +325,6 @@ func _on_data(): global._print(message) elif cmd == "ReceivedItems": - if message["index"] == 0: - # We are being sent all of our items, so lets reset any progress - # on progressive items. - _progressive_progress.clear() - _held_items = [] - var i = 0 for item in message["items"]: if _map_loaded: @@ -555,6 +550,8 @@ func completedGoal(): func mapFinishedLoading(): if !_map_loaded: + _received_indexes.clear() + _progressive_progress.clear() _has_colors = ["white"] emit_signal("evaluate_solvability") @@ -569,6 +566,13 @@ func mapFinishedLoading(): func processItem(item, index, from, flags): + if index != null: + if _received_indexes.has(index): + # Do not re-process items. + return + + _received_indexes.append(index) + global._print(item) var stringified = String(item) -- cgit 1.4.1