Files
Hornwitser 8c4d2db192 Move TypeScript Node.js build to dist/node
Use a separate folder for the TypeScript build for Node.js in the dist
folder.  This makes each type of build consistently have its own output
folder instead of being interleaved with the Node.js build.
2024-02-08 03:20:26 +01:00

58 lines
1.5 KiB
TypeScript

import * as lib from "@clusterio/lib";
import * as messages from "./messages";
declare module "@clusterio/lib" {
export interface InstanceConfigFields {
"inventory_sync.rcon_chunk_size": number;
}
export interface ControllerConfigFields {
"inventory_sync.player_lock_timeout": number;
}
}
lib.definePermission({
name: "inventory_sync.inventory.view",
title: "View player inventories",
description: "View player inventories",
grantByDefault: true,
});
export const plugin: lib.PluginDeclaration = {
name: "inventory_sync",
title: "Inventory sync",
description: "Synchronizes players inventories between instances",
instanceEntrypoint: "dist/node/instance",
instanceConfigFields: {
"inventory_sync.rcon_chunk_size": {
title: "Rcon inventory chunk size",
description:
"Divide inventories into chunks of this size before sending with rcon to prevent blocking the pipe",
type: "number",
initialValue: 1000,
},
},
controllerEntrypoint: "dist/node/controller",
controllerConfigFields: {
"inventory_sync.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",
initialValue: 60,
},
},
messages: [
messages.AcquireRequest,
messages.ReleaseRequest,
messages.UploadRequest,
messages.DownloadRequest,
messages.DatabaseStatsRequest,
],
webEntrypoint: "./web",
routes: ["/inventory"],
};