Files
factorio-clusterio/plugins/player_auth/info.js
T
Hornwitser 70ad295a89 Rename Master to Controller
The role of the master server as the party controlling every part of the
cluster is not well reflected in its name and has caused confusion among
users on several occasions.  Rename master to controller to better
reflects its role.
2023-02-22 15:30:51 +01:00

57 lines
1.5 KiB
JavaScript

"use strict";
let { libConfig, libLink } = require("@clusterio/lib");
class ControllerConfigGroup extends libConfig.PluginConfigGroup {}
ControllerConfigGroup.defaultAccess = ["controller", "slave", "control"];
ControllerConfigGroup.groupName = "player_auth";
ControllerConfigGroup.define({
name: "code_length",
title: "Code Length",
description: "Length in characters of the generated codes.",
type: "number",
initial_value: 6,
});
ControllerConfigGroup.define({
name: "code_timeout",
title: "Code Timeout",
description: "Time in seconds for the generated codes to stay valid.",
type: "number",
initial_value: 120,
});
ControllerConfigGroup.finalize();
module.exports = {
name: "player_auth",
title: "Player Auth",
description: "Provides authentication to the cluster via logging into a Factorio server.",
controllerEntrypoint: "controller",
instanceEntrypoint: "instance",
webEntrypoint: "./web",
ControllerConfigGroup,
messages: {
fetchPlayerCode: new libLink.Request({
type: "player_auth:fetch_player_code",
links: ["instance-slave", "slave-controller"],
forwardTo: "controller",
requestProperties: {
"player": { type: "string" },
},
responseProperties: {
"player_code": { type: "string" },
"controller_url": { type: "string" },
},
}),
setVerifyCode: new libLink.Request({
type: "player_auth:set_verify_code",
links: ["instance-slave", "slave-controller"],
forwardTo: "controller",
requestProperties: {
"player": { type: "string" },
"verify_code": { type: "string" },
},
}),
},
};