Rename Slave to Host

The role of a slave as a host for Factorio servers is not well reflected
in its name and has caused confusion among users.  Rename slave to host
to better reflect its role as a host of Factorio servers.
This commit is contained in:
Hornwitser committed 2023-02-22 15:30:51 +01:00
1 parent 70ad295a89
commit 6fc3abafd5
101 files changed
+1168 -1168

No files matched your search

+1 -1
View File
@@ -10,4 +10,4 @@ Run the following commands in the folder Clusterio is installed to:
npm install @clusterio/plugin-subspace_storage
npx clusteriocontroller plugin add @clusterio/plugin-subspace_storage
Substitute clusteriocontroller with clusterioslave or clusterioctl if this a dedicate slave or ctl installation respectively.
Substitute clusteriocontroller with clusteriohost or clusterioctl if this a dedicate host or ctl installation respectively.
+2 -2
View File
@@ -107,7 +107,7 @@ class ControllerPlugin extends libPlugin.BaseControllerPlugin {
}
itemsToUpdate = [...itemsToUpdate.entries()];
this.broadcastEventToSlaves(this.info.messages.updateStorage, { items: itemsToUpdate });
this.broadcastEventToHosts(this.info.messages.updateStorage, { items: itemsToUpdate });
for (let link of this.subscribedControlLinks) {
this.info.messages.updateStorage.send(link, { items: itemsToUpdate });
}
@@ -142,7 +142,7 @@ class ControllerPlugin extends libPlugin.BaseControllerPlugin {
let itemsRemoved = [];
if (method === "simple") {
// Give out as much items as possible until there are 0 left. This
// might lead to one slave getting all the items and the rest nothing.
// might lead to one host getting all the items and the rest nothing.
for (let item of message.data.items) {
let count = this.items.getItemCount(item[0]);
let toRemove = Math.min(count, item[1]);
+1 -1
View File
@@ -84,7 +84,7 @@ class NeuralDole {
this.lastRequest[`${object.name}_${object.instanceID}_${object.instanceName}`] = object.count;
// 0. Number of items to give in that dose
// 1. New dole for item X
// 2. New carry for item X slave Y
// 2. New carry for item X instance Y
this.dole[object.name] = magicData[1];
this.carry[`${object.name} ${object.instanceID}`] = magicData[2];
this.debt[`${object.name} ${object.instanceID}`] = magicData[3];
+10 -10
View File
@@ -23,23 +23,23 @@ function sigmoid3(x) {
return x;
}
// DOSE - Doses items for item X slave Y
// Numreq - number of items that are requested for item X for slave Y
// DOSE - Doses items for item X instance Y
// Numreq - number of items that are requested for item X for instance Y
// Instore - number of items for item X in controller gauge (currently)
// store_last_tick -
// Number of items for item X in controller gauge at time of last tick
// dole - Current dole for item X
// carry - carry for item X slave Y
// prev_req - Numreq for previous request for item X slave Y
// carry - carry for item X instance Y
// prev_req - Numreq for previous request for item X instance Y
// * doleinfo_last -
// Object with 2 values for last "tick period": numreq - total number or
// requests for item, numslave - number of slaves requesting that item
// debt - debt for item X slave Y
// requests for item, numinstance - number of instances requesting that item
// debt - debt for item X instance Y
// Returns: Array of 3 elements
// 0.Number of items to give in that dose
// 1.New dole for item X
// 2.New carry for item X slave Y
// 2.New carry for item X instance Y
// 3.New debt
function dose(numreq, instore, store_last_tick, dole, carry, prev_req, numreq_total_adj, debt) {
numreq = Number(numreq);
@@ -98,18 +98,18 @@ function dose(numreq, instore, store_last_tick, dole, carry, prev_req, numreq_to
// TICK -
// Updates values for item X, should be called once for each item for
// each round of all slaves requesting that item Instore - number of
// each round of all instances requesting that item Instore - number of
// items for item X in controller gauge (currently)
// dole - Current dole for item X
// store_last_tick -
// Number of items for item X in controller gauge at time of last tick (not this one)
// * doleinfo_last -
// Object with 2 values for last "tick period": numreq - total number or
// requests for item, numslave - number of slaves requesting that item
// requests for item, numinstance - number of instances requesting that item
//
// * doleinfo_new -
// Object with 2 values for new "tick period": numreq - total number or
// requests for item, numslave - number of slaves requesting that item
// requests for item, numinstance - number of instances requesting that item
// Returns: Array of 2 elements
+7 -7
View File
@@ -2,7 +2,7 @@
const { libConfig, libLink, libUsers } = require("@clusterio/lib");
class ControllerConfigGroup extends libConfig.PluginConfigGroup {}
ControllerConfigGroup.defaultAccess = ["controller", "slave", "control"];
ControllerConfigGroup.defaultAccess = ["controller", "host", "control"];
ControllerConfigGroup.groupName = "subspace_storage";
ControllerConfigGroup.define({
name: "autosave_interval",
@@ -29,12 +29,12 @@ ControllerConfigGroup.define({
ControllerConfigGroup.finalize();
class InstanceConfigGroup extends libConfig.PluginConfigGroup {}
InstanceConfigGroup.defaultAccess = ["controller", "slave", "control"];
InstanceConfigGroup.defaultAccess = ["controller", "host", "control"];
InstanceConfigGroup.groupName = "subspace_storage";
InstanceConfigGroup.define({
name: "log_item_transfers",
title: "Log Item Transfers",
description: "Spam slave console with item transfers done.",
description: "Spam host console with item transfers done.",
type: "boolean",
initial_value: false,
});
@@ -78,7 +78,7 @@ module.exports = {
// XXX this should be a request to be reliable
place: new libLink.Event({
type: "subspace_storage:place",
links: ["instance-slave", "slave-controller"],
links: ["instance-host", "host-controller"],
forwardTo: "controller",
eventProperties: {
"instance_id": { type: "integer" },
@@ -87,7 +87,7 @@ module.exports = {
}),
remove: new libLink.Request({
type: "subspace_storage:remove",
links: ["instance-slave", "slave-controller"],
links: ["instance-host", "host-controller"],
forwardTo: "controller",
requestProperties: {
"instance_id": { type: "integer" },
@@ -99,7 +99,7 @@ module.exports = {
}),
getStorage: new libLink.Request({
type: "subspace_storage:get_storage",
links: ["instance-slave", "slave-controller", "control-controller"],
links: ["instance-host", "host-controller", "control-controller"],
permission: "subspace_storage.storage.view",
forwardTo: "controller",
responseProperties: {
@@ -108,7 +108,7 @@ module.exports = {
}),
updateStorage: new libLink.Event({
type: "subspace_storage:update_storage",
links: ["controller-slave", "slave-instance", "controller-control"],
links: ["controller-host", "host-instance", "controller-control"],
broadcastTo: "instance",
eventProperties: {
"items": items,
+3 -3
View File
@@ -13,7 +13,7 @@ class InstancePlugin extends libPlugin.BaseInstancePlugin {
this.provideItems(output).catch(err => this.unexpectedError(err));
});
this.instance.server.on("ipc-subspace_storage:orders", (orders) => {
if (this.instance.status !== "running" || !this.slave.connected) {
if (this.instance.status !== "running" || !this.host.connected) {
return;
}
@@ -25,7 +25,7 @@ class InstancePlugin extends libPlugin.BaseInstancePlugin {
async onStart() {
this.pingId = setInterval(() => {
if (!this.slave.connected) {
if (!this.host.connected) {
return; // Only ping if we are actually connected to the controller.
}
this.sendRcon(
@@ -50,7 +50,7 @@ class InstancePlugin extends libPlugin.BaseInstancePlugin {
// provide items --------------------------------------------------------------
async provideItems(items) {
if (!this.slave.connector.hasSession) {
if (!this.host.connector.hasSession) {
// For now the items are voided if the controller connection is
// down, which is no different from the previous behaviour.
if (this.instance.config.get("subspace_storage.log_item_transfers")) {