Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scripts/sync-gamedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,11 @@ def prune_snapshot(document: dict, manifest: ConsumerManifest, game_version: str
windows = entry.get("windows")
if not isinstance(windows, dict) or not isinstance(windows.get("crc64"), str):
continue
pruned_binaries[module] = {"windows": {"crc64": windows["crc64"]}}
pruned_windows = {"crc64": windows["crc64"]}
if "alias" in windows:
# Preserve optional module filenames for the runtime resolver.
pruned_windows["alias"] = windows["alias"]
pruned_binaries[module] = {"windows": pruned_windows}
pruned_document["binaries"] = pruned_binaries

if "records" in allowed_top:
Expand Down
8 changes: 8 additions & 0 deletions scripts/validate-gamedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,14 @@ def validate_snapshot(doc, game_version):
win = plats.get("windows")
if not isinstance(win, dict):
continue
aliases = win.get("alias", [])
if not isinstance(aliases, list) or any(
not isinstance(name, str) or not name or name in (".", "..")
or name.endswith((".", " "))
or any(ord(c) < 32 or c in r'/\:<>"|?*' for c in name)
for name in aliases
):
errors.append(f"'{game_version}': module '{mod}': alias must be an array of filenames")
crc64 = parse_crc64(win.get("crc64"))
if crc64 is None:
errors.append(f"'{game_version}': module '{mod}': invalid crc64")
Expand Down