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
@@ -5,7 +5,7 @@ import type { InstancePluginContext } from "@clusterio/host";
|
||||
import {
|
||||
AcquireRequest, AcquireResponse, ReleaseRequest, UploadRequest, DownloadRequest, DownloadResponse, IpcPlayerData,
|
||||
} from "./messages.js";
|
||||
import { enabledComponents, stripPlayerData } from "./components.js";
|
||||
import { enabledComponents, scenarioComponents, stripPlayerData } from "./components.js";
|
||||
|
||||
type IpcPlayerName = {
|
||||
player_name: string
|
||||
@@ -14,6 +14,8 @@ type IpcPlayerName = {
|
||||
type IpcDownloadRequest = {
|
||||
player_name: string,
|
||||
recipe_notifications?: string,
|
||||
// Components the download was started with, all when missing
|
||||
components?: Record<string, boolean> | unknown[],
|
||||
}
|
||||
|
||||
type IpcAcquireResponse = {
|
||||
@@ -199,7 +201,7 @@ export default async function(context: InstancePluginContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
stripPlayerData(response.playerData, enabledComponents(instance.config));
|
||||
stripPlayerData(response.playerData, scenarioComponents(request.components));
|
||||
await applyRecipeNotificationDelta(response.playerData, request.recipe_notifications, logger);
|
||||
|
||||
const chunkSize = instance.config.get("player_sync.rcon_chunk_size");
|
||||
|
||||
Reference in new issue
Block a user