Files
factorio-clusterio/plugins/player_auth/index.ts
T
Hornwitser b0f6c95fca Move export for plugin declaration (#555)
Change the expected exported name of plugin declarations to be "plugin"
at the main entrypoint instead of the default export.  This makes the
plugin's code organisation more flexible especially when using CommonJS
JavaScript modules as they can export additional symbols from the
plugin declaration file.
2024-01-18 20:31:52 +01:00

41 lines
1.1 KiB
TypeScript

import * as lib from "@clusterio/lib";
import * as messages from "./messages";
declare module "@clusterio/lib" {
export interface InstanceConfigFields {
"player_auth.load_plugin": boolean;
}
export interface ControllerConfigFields {
"player_auth.code_length": number;
"player_auth.code_timeout": number;
}
}
export const plugin: lib.PluginDeclaration = {
name: "player_auth",
title: "Player Auth",
description: "Provides authentication to the cluster via logging into a Factorio server.",
controllerEntrypoint: "dist/plugin/controller",
instanceEntrypoint: "dist/plugin/instance",
webEntrypoint: "./web",
controllerConfigFields: {
"player_auth.code_length": {
title: "Code Length",
description: "Length in characters of the generated codes.",
type: "number",
initialValue: 6,
},
"player_auth.code_timeout": {
title: "Code Timeout",
description: "Time in seconds for the generated codes to stay valid.",
type: "number",
initialValue: 120,
},
},
messages: [
messages.FetchPlayerCodeRequest,
messages.SetVerifyCodeRequest,
],
};