feat(web): harden continuous implementation handoff
This commit is contained in:
@@ -447,6 +447,16 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
|
||||
}
|
||||
return;
|
||||
}
|
||||
case "setTextureProperties": {
|
||||
const texture = currentSnapshot?.textures?.find((candidate) => candidate.id === payload.dataId);
|
||||
if (!texture) throw report("NON_MESH_DATA_UNSUPPORTED", `Texture data block is unavailable: ${payload.dataId}`);
|
||||
if (!validPropertyKeys(payload.properties, ["noiseScale", "noiseDepth", "intensity", "contrast", "saturation"])) throw report("NON_MESH_PROPERTY_INVALID", "Texture properties are empty or contain unsupported fields");
|
||||
for (const [key, value] of Object.entries(payload.properties)) {
|
||||
if (typeof value !== "number" || !Number.isFinite(value) || value < 0 || value > 1_000_000) throw report("NON_MESH_PROPERTY_INVALID", `Texture setting ${key} is outside the bounded range`);
|
||||
if (key === "noiseDepth" && (!Number.isSafeInteger(value) || value > 30)) throw report("NON_MESH_PROPERTY_INVALID", "Texture noise depth must be an integer between 0 and 30");
|
||||
}
|
||||
return;
|
||||
}
|
||||
case "setVolumeProperties": {
|
||||
const data = currentSnapshot?.nonMeshData?.find((candidate) => candidate.id === payload.dataId);
|
||||
if (!data || data.type !== "VOLUME") throw report("NON_MESH_DATA_UNSUPPORTED", `N-015 Volume data block is unavailable: ${payload.dataId}`);
|
||||
|
||||
Reference in New Issue
Block a user