mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 15:24:52 +09:00
Send only the local state on download init
The current state sent with the download request no longer includes the failed names from the previous deserialization. Stored names unknown on this instance always end up in the add list, so the deserializer recomputes the failed list from that on every download and needs no previous state. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
68ce13ead4
commit
b1e79cf86d
2 files changed
+9
-28
No files matched your search
@@ -112,9 +112,7 @@ function inventory_sync.deserialize_player(player, finished_record)
|
||||
-- Deserialize downloaded player data
|
||||
local serialized_player = compat.json_to_table(finished_record.data)
|
||||
assert(type(serialized_player) == "table", "wrong type for serialized_player")
|
||||
script_data.failed_deserialization[player.name] = serialize.deserialize_player(
|
||||
player, serialized_player, script_data.failed_deserialization[player.name]
|
||||
)
|
||||
script_data.failed_deserialization[player.name] = serialize.deserialize_player(player, serialized_player)
|
||||
|
||||
-- Restore player position and driving state
|
||||
restore_position(player, finished_record)
|
||||
@@ -447,10 +445,7 @@ function inventory_sync.initiate_inventory_download(player, player_record, gener
|
||||
-- The plugin only sends back what differs from the current notification state
|
||||
local recipe_notifications
|
||||
if recipe_notifications_api then
|
||||
local failed = script_data.failed_deserialization[player.name]
|
||||
recipe_notifications = serialize.serialize_crafting_notifications(
|
||||
player, failed and failed.recipe_notifications
|
||||
)
|
||||
recipe_notifications = serialize.serialize_crafting_notifications(player)
|
||||
end
|
||||
|
||||
clusterio_api.send_json("inventory_sync_download", {
|
||||
|
||||
Reference in new issue
Block a user