mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-24 00:23:12 +09:00
Upload on leave while an unconfirmed prefetched copy is held
The leave handler skipped the upload for any active download, including a prefetched copy no join had confirmed, which has replaced nothing here. Newer local data, such as after a failed upload whose retry the join cleared, was then never uploaded. Only a real download skips it now; a copy whose join took the body still uploads nothing through sync_in_progress. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3f79cdb1a6
commit
0149c72639
1 file changed
+9
-4
@@ -583,10 +583,15 @@ player_sync.events[defines.events.on_pre_player_left_game] = function(event)
|
|||||||
local destination = player_record.destination
|
local destination = player_record.destination
|
||||||
player_record.destination = nil
|
player_record.destination = nil
|
||||||
|
|
||||||
-- If player has an active download release our acquisition but let the download continue
|
local download = script_data.active_downloads[player.name]
|
||||||
if script_data.active_downloads[player.name] then
|
if download and download.prefetch then
|
||||||
-- A prefetched copy is confirmed per join: the next join's acquire reply confirms it again
|
-- A prefetched copy is confirmed per join: the next join's acquire reply confirms it again. Until then it has
|
||||||
script_data.active_downloads[player.name].confirmed = nil
|
-- replaced nothing here, so the checks below decide the upload. One whose join took the body (spectate) left
|
||||||
|
-- sync_in_progress set, and uploads nothing.
|
||||||
|
download.confirmed = nil
|
||||||
|
|
||||||
|
elseif download then
|
||||||
|
-- If player has an active download release our acquisition but let the download continue
|
||||||
clusterio_api.send_json("player_sync_release", { player_name = player.name })
|
clusterio_api.send_json("player_sync_release", { player_name = player.name })
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user