mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 16:13:12 +09:00
Allow disabling player online autosaves (#971)
This commit is contained in:
1 parent
03f2616f30
commit
0be4fd77e5
3 files changed
+11
-1
No files matched your search
@@ -47,6 +47,7 @@ Many thanks to the following for contributing to this release:
|
|||||||
|
|
||||||
### Fixes
|
### 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>)
|
- 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>)
|
- 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>)
|
- Instances always create their config file on assignment preventing duplicate folder creation. [#945](<https://github.com/clusterio/clusterio/pull/945>)
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ export class InstanceConfig extends classes.Config<InstanceConfigFields> {
|
|||||||
validator: function(value, config) {
|
validator: function(value, config) {
|
||||||
const factorioSettings = config.get("factorio.settings");
|
const factorioSettings = config.get("factorio.settings");
|
||||||
const autosaveSlots = factorioSettings.autosave_slots;
|
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");
|
throw new Error("Value cannot be less than the number of autosave slots");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -227,6 +227,15 @@ describe("lib/config/definitions/validators", function() {
|
|||||||
/Value cannot be less than the number of autosave slots/
|
/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() {
|
it("should allow when autosave_slots is not a number", function() {
|
||||||
const config = new InstanceConfig("controller", {
|
const config = new InstanceConfig("controller", {
|
||||||
"factorio.settings": {
|
"factorio.settings": {
|
||||||
|
|||||||
Reference in new issue
Block a user