Files
factorio-clusterio/plugins/inventory_sync/info.ts
T
Luciole 838170a9ff Port packages/web_ui to TypeScript (#508)
* .jsx to .tsx

* controller: tsc --build before webpack-cli

* Type Annotation

* disabled move into the <Input/> and <Checkbox/>

* cleanup debug left over

* documentation

* default ModPack

* modPackUpdateHandlers no undefined

* PluginInfo changes proposition

* PluginInfo changes proposition miss

* ModRecord & ModInfo feedback loop at const mods = [ ?

* ["connect", "drop", "resume", "close"] as const

* .tsx to .ts when possible
2023-09-02 14:51:35 +02:00

65 lines
1.9 KiB
TypeScript

import * as lib from "@clusterio/lib";
import * as messages from "./messages";
class ControllerConfigGroup extends lib.PluginConfigGroup { }
ControllerConfigGroup.defaultAccess = ["controller", "host", "control"];
ControllerConfigGroup.groupName = "inventory_sync";
ControllerConfigGroup.define({
name: "autosave_interval",
title: "Autosave Interval",
description: "Interval the player data is autosaved at in seconds.",
type: "number",
initial_value: 600, // 10 minutes
});
ControllerConfigGroup.define({
name: "player_lock_timeout",
title: "Player Lock Timeout",
description:
"Time in seconds before the lock on a player inventory expires after an instance stops or is disconnected",
type: "number",
initial_value: 60,
});
ControllerConfigGroup.finalize();
class InstanceConfigGroup extends lib.PluginConfigGroup { }
InstanceConfigGroup.defaultAccess = ["controller", "host", "control"];
InstanceConfigGroup.groupName = "inventory_sync";
InstanceConfigGroup.define({
name: "rcon_chunk_size",
title: "Rcon inventory chunk size",
description: "Divide inventories into multiple chunks before sending with rcon to prevent blocking the pipe",
type: "number",
initial_value: 1000,
});
InstanceConfigGroup.finalize();
lib.definePermission({
name: "inventory_sync.inventory.view",
title: "View player inventories",
description: "View player inventories",
grantByDefault: true,
});
const info: lib.PluginDeclaration = {
name: "inventory_sync",
title: "Inventory sync",
description: "Synchronizes players inventories between instances",
instanceEntrypoint: "dist/plugin/instance",
InstanceConfigGroup,
controllerEntrypoint: "dist/plugin/controller",
ControllerConfigGroup,
messages: [
messages.AcquireRequest,
messages.ReleaseRequest,
messages.UploadRequest,
messages.DownloadRequest,
messages.DatabaseStatsRequest,
],
webEntrypoint: "./web",
routes: ["/inventory"],
}
export default info;