mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 15:04:52 +09:00
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>
14 lines
613 B
TypeScript
14 lines
613 B
TypeScript
import * as lib from "@clusterio/lib";
|
|
|
|
export default function(context: lib.MigrationContext) {
|
|
const { hooks, plugin } = context;
|
|
// migrate: inventory_sync was renamed to player_sync in 2.0.0-alpha.28
|
|
const renameFields = (config: lib.ConfigSchema) => (
|
|
lib.renameConfigPrefix(config, "inventory_sync.", "player_sync.")
|
|
);
|
|
hooks.controllerConfig.attach(plugin.name, renameFields);
|
|
hooks.hostConfig.attach(plugin.name, renameFields);
|
|
hooks.instanceConfig.attach(plugin.name, renameFields);
|
|
hooks.role.attach(plugin.name, role => lib.renamePermissionPrefix(role, "inventory_sync.", "player_sync."));
|
|
}
|