mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
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.
58 lines
1.5 KiB
TypeScript
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"],
|
|
};
|