mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
requiredMods entries are now Factorio dependency strings, and a mod listed twice gives a version range. The plugin loader validates them. The host refuses to start an instance whose mod pack is missing a required mod of a loaded plugin, has it disabled or has it outside the version range. On start the controller resolves the required mods of its plugins and their dependencies for the default mod pack's Factorio version and downloads the ones missing from the mod store. The resolver and portal download move from the ControlConnection handlers into Controller methods so both paths share them. Subspace Storage requires subspace_storage >= 1.99.0, and the integration tests build a stub of that mod for the test mod pack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
72 lines
1.9 KiB
TypeScript
72 lines
1.9 KiB
TypeScript
import * as lib from "@clusterio/lib";
|
|
import * as messages from "./messages.js";
|
|
|
|
declare module "@clusterio/lib" {
|
|
export interface ControllerConfigFields {
|
|
"subspace_storage.division_method": "simple" | "dole" | "neural_dole";
|
|
"subspace_storage.log_item_transfers": boolean;
|
|
}
|
|
export interface InstanceConfigFields {
|
|
"subspace_storage.log_item_transfers": boolean;
|
|
}
|
|
export interface Permissions {
|
|
"subspace_storage.storage.view": never;
|
|
}
|
|
}
|
|
|
|
export const plugin: lib.PluginDeclaration = {
|
|
name: "subspace_storage",
|
|
title: "Subspace Storage",
|
|
description: "Provides shared storage across instances for the Subspace Storage mod",
|
|
instanceEntrypoint: "dist/node/instance.js",
|
|
requiredMods: ["subspace_storage >= 1.99.0"],
|
|
instanceConfigFields: {
|
|
"subspace_storage.log_item_transfers": {
|
|
title: "Log Item Transfers",
|
|
description: "Spam host console with item transfers done.",
|
|
type: "boolean",
|
|
initialValue: false,
|
|
},
|
|
},
|
|
|
|
controllerEntrypoint: "dist/node/controller.js",
|
|
controllerConfigFields: {
|
|
"subspace_storage.division_method": {
|
|
title: "Division Method",
|
|
description: "Method for dividing resource requests between instances.",
|
|
type: "string",
|
|
enum: ["simple", "dole", "neural_dole"],
|
|
initialValue: "simple",
|
|
},
|
|
"subspace_storage.log_item_transfers": {
|
|
title: "Log Item Transfers",
|
|
description: "Spam controller console with item transfers done.",
|
|
type: "boolean",
|
|
initialValue: false,
|
|
},
|
|
},
|
|
|
|
features: [
|
|
"SavePatching",
|
|
"ScriptCommands",
|
|
],
|
|
|
|
messages: [
|
|
messages.PlaceEvent,
|
|
messages.RemoveRequest,
|
|
messages.GetStorageRequest,
|
|
messages.UpdateStorageEvent,
|
|
messages.SetStorageSubscriptionRequest,
|
|
],
|
|
permissions: [
|
|
{
|
|
name: "subspace_storage.storage.view",
|
|
title: "View Subspace Storage",
|
|
description: "View the items and fluids stored in the shared subspace.",
|
|
grantByDefault: true,
|
|
},
|
|
],
|
|
webEntrypoint: "./web",
|
|
routes: ["/storage"],
|
|
};
|