mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-11 15:54:52 +09:00
clusterio#1140 no longer reports plugins without a web entrypoint as
failing to load, so the empty web modules from 99d47cf1 can go. The
browser tsconfig of these plugins now checks index.ts instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
1.5 KiB
TypeScript
51 lines
1.5 KiB
TypeScript
import * as lib from "@clusterio/lib";
|
|
|
|
declare module "@clusterio/lib" {
|
|
export interface ControllerConfigFields {
|
|
"exp_auto_restart.idle_seconds": number;
|
|
"exp_auto_restart.scope": "host" | "cluster";
|
|
"exp_auto_restart.start_instances": boolean;
|
|
"exp_auto_restart.restart_controller": boolean;
|
|
}
|
|
}
|
|
|
|
export const plugin: lib.PluginDeclaration = {
|
|
name: "exp_auto_restart",
|
|
title: "ExpGaming - Auto Restart",
|
|
description: "Clusterio plugin restarting hosts and the controller once no players are online",
|
|
|
|
controllerEntrypoint: "./dist/node/controller.js",
|
|
controllerConfigFields: {
|
|
"exp_auto_restart.idle_seconds": {
|
|
title: "Idle Seconds",
|
|
description: "How long a host must have had no players online before it is restarted",
|
|
type: "number",
|
|
initialValue: 300,
|
|
validator: (value: number) => {
|
|
if (value < 0) {
|
|
throw new Error("Idle seconds cannot be negative");
|
|
}
|
|
},
|
|
},
|
|
"exp_auto_restart.scope": {
|
|
title: "Scope",
|
|
description: "Whether players on other hosts also hold back a restart",
|
|
type: "string",
|
|
enum: ["host", "cluster"],
|
|
initialValue: "host",
|
|
},
|
|
"exp_auto_restart.start_instances": {
|
|
title: "Start Instances",
|
|
description: "Start the instances that were running again once the host is back",
|
|
type: "boolean",
|
|
initialValue: true,
|
|
},
|
|
"exp_auto_restart.restart_controller": {
|
|
title: "Restart Controller",
|
|
description: "Also restart the controller when it needs it and no players are online anywhere",
|
|
type: "boolean",
|
|
initialValue: false,
|
|
},
|
|
},
|
|
};
|