Allow disabling player online autosaves (#971)

This commit is contained in:
Floze authored and GitHub committed 2026-08-14 10:24:15 +01:00
1 parent 03f2616f30
commit 0be4fd77e5
3 files changed
+11 -1

No files matched your search

+1
View File
@@ -47,6 +47,7 @@ Many thanks to the following for contributing to this release:
### Fixes
- Allow player online autosave slots to be disabled while autosaves are enabled. [#966](<https://github.com/clusterio/clusterio/issues/966>)
- Silenced two Ant Design console warnings in the Web UI: the deprecated Modal `destroyOnClose` prop, and a duplicate-value warning from the instance version selector. [#940](<https://github.com/clusterio/clusterio/pull/940>)
- Surface the mod portal's own error when downloading mods for an unsupported Factorio version. [#941](<https://github.com/clusterio/clusterio/pull/941>)
- Instances always create their config file on assignment preventing duplicate folder creation. [#945](<https://github.com/clusterio/clusterio/pull/945>)
+1 -1
View File
@@ -575,7 +575,7 @@ export class InstanceConfig extends classes.Config<InstanceConfigFields> {
validator: function(value, config) {
const factorioSettings = config.get("factorio.settings");
const autosaveSlots = factorioSettings.autosave_slots;
if (typeof autosaveSlots === "number" && value < autosaveSlots) {
if (value !== 0 && typeof autosaveSlots === "number" && value < autosaveSlots) {
throw new Error("Value cannot be less than the number of autosave slots");
}
},
+9
View File
@@ -227,6 +227,15 @@ describe("lib/config/definitions/validators", function() {
/Value cannot be less than the number of autosave slots/
);
});
it("should allow disabling player online autosaves", function() {
const config = new InstanceConfig("controller", {
"factorio.settings": {
autosave_slots: 5,
},
});
assert.doesNotThrow(() => config.set("factorio.player_online_autosave_slots", 0));
});
it("should allow when autosave_slots is not a number", function() {
const config = new InstanceConfig("controller", {
"factorio.settings": {