mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 08:03:13 +09:00
Explain why a prefetched copy needs the run token as well as the generation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
17f029e39e
commit
fdec6bc249
1 file changed
+5
-2
@@ -352,8 +352,11 @@ function player_sync.sync_player(acquire_response)
|
|||||||
-- Epoch is bumped when an admin replaces or deletes the stored data
|
-- Epoch is bumped when an admin replaces or deletes the stored data
|
||||||
local epoch = acquire_response.epoch or 0
|
local epoch = acquire_response.epoch or 0
|
||||||
-- A prefetched copy (player_sync.prefetch_inventory) is used only if this reply acquires the player at the copy's
|
-- A prefetched copy (player_sync.prefetch_inventory) is used only if this reply acquires the player at the copy's
|
||||||
-- generation and the copy was sent with the components synced here now. Otherwise it goes, and the join carries on
|
-- generation, from the controller run that sent it (token), and the copy was sent with the components synced here
|
||||||
-- as if it had never come: today's download or failure dialog, never the restart path below.
|
-- now. The generation alone isn't enough: a controller that crashed before saving it restarts at the last saved
|
||||||
|
-- generation, and another instance's upload can then reuse the same number with other data. Otherwise the copy
|
||||||
|
-- goes, and the join carries on as if it had never come: today's download or failure dialog, never the restart
|
||||||
|
-- path below, which only sees a different generation.
|
||||||
for _, downloads in ipairs({ script_data.finished_downloads, script_data.active_downloads }) do
|
for _, downloads in ipairs({ script_data.finished_downloads, script_data.active_downloads }) do
|
||||||
local record = downloads[acquire_response.player_name]
|
local record = downloads[acquire_response.player_name]
|
||||||
if record and record.prefetch and not (
|
if record and record.prefetch and not (
|
||||||
|
|||||||
Reference in new issue
Block a user