mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 15:24:52 +09:00
Strip downloads by the components the scenario started them with
The instance read its config when the controller answered, so a sync_ field changed during the download could strip a component the scenario still expected, and the scenario treated it as empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aa06b9afe3
commit
45fedf28a0
5 files changed
+26
-18
No files matched your search
@@ -129,14 +129,19 @@ describe("player_sync", function() {
|
||||
const expected = { generation: 1, name: "test", recipe_notifications: await encode({ add: ["a"] }) };
|
||||
assert.deepEqual(instance.server.rconCommands, [downloadCommand(expected)]);
|
||||
});
|
||||
it("should leave out components the instance does not sync", async function() {
|
||||
instance.mockConfigEntries.set("player_sync.sync_force", false);
|
||||
instance.mockConfigEntries.set("player_sync.sync_recipe_notifications", false);
|
||||
it("should leave out components the download was not started with", async function() {
|
||||
respondWith({ generation: 1, name: "test", force: "enemy", tag: "tag", recipe_notifications: "x" });
|
||||
await download({ player_name: "test" });
|
||||
await download({ player_name: "test", components: { appearance: true } });
|
||||
const expected = { generation: 1, name: "test", tag: "tag" };
|
||||
assert.deepEqual(instance.server.rconCommands, [downloadCommand(expected)]);
|
||||
});
|
||||
it("should ignore config changes made after the download was started", async function() {
|
||||
instance.mockConfigEntries.set("player_sync.sync_force", false);
|
||||
respondWith({ generation: 1, name: "test", force: "enemy", tag: "tag" });
|
||||
await download({ player_name: "test", components: { force: true } });
|
||||
const expected = { generation: 1, name: "test", force: "enemy" };
|
||||
assert.deepEqual(instance.server.rconCommands, [downloadCommand(expected)]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("set_components", function() {
|
||||
|
||||
Reference in new issue
Block a user