mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
Rename inventory_sync to player_sync
The plugin syncs more than inventories now (settings, appearance, recipe notifications), so name it for what it does. The package becomes @clusterio/plugin-player_sync and every inventory_sync identifier follows. A migration entrypoint renames the inventory_sync config fields, including load_plugin, and the inventory view permission. The plugin moves inventories.json in the database directory to player_sync.json and storage.inventory_sync in saves to storage.player_sync itself, and closes dialogs left open under the old GUI names on startup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e455d17bb7
commit
8363c5f0ef
39 files changed
+331
-177
No files matched your search
@@ -0,0 +1,28 @@
|
||||
local compat = require("modules/clusterio/compat")
|
||||
|
||||
--- @param no_early_return boolean? True to always setup data
|
||||
return function(no_early_return)
|
||||
local player_sync = compat.script_data.player_sync
|
||||
if player_sync and not no_early_return then
|
||||
return player_sync
|
||||
end
|
||||
|
||||
-- migrate: inventory_sync was renamed to player_sync in 2.0.0-alpha.28
|
||||
if not player_sync and compat.script_data.inventory_sync then
|
||||
player_sync = compat.script_data.inventory_sync
|
||||
compat.script_data.inventory_sync = nil
|
||||
end
|
||||
|
||||
player_sync = player_sync or {}
|
||||
player_sync.players = player_sync.players or {}
|
||||
player_sync.players_waiting_for_acquire = player_sync.players_waiting_for_acquire or {}
|
||||
player_sync.players_in_cutscene_to_sync = player_sync.players_in_cutscene_to_sync or {}
|
||||
player_sync.failed_deserialization = player_sync.failed_deserialization or {}
|
||||
|
||||
player_sync.active_downloads = player_sync.active_downloads or {}
|
||||
player_sync.finished_downloads = player_sync.finished_downloads or {}
|
||||
player_sync.active_uploads = player_sync.active_uploads or {}
|
||||
|
||||
compat.script_data.player_sync = player_sync
|
||||
return player_sync
|
||||
end
|
||||
Reference in new issue
Block a user