Added game code 1 to logs.

This commit is contained in:
2026-08-28 21:55:24 +02:00
parent 010fe14ab4
commit e90cb788ba

View File

@@ -23,6 +23,11 @@ _FAILED_IMPORT_RE = re.compile(
r"Failed to import scene:\s*(?P<scene>.*)$",
re.IGNORECASE,
)
_MODULE_CODE_SYNC_RE = re.compile(
r"Module Code Sync Error\s*\(\[(?P<left>-?\d+)\]\s*!=\s*"
r"\[(?P<right>-?\d+)\]\)",
re.IGNORECASE,
)
_TIMESTAMP_RE = re.compile(
r"^\s*(?:\[)?(?P<timestamp>"
r"\d{4}-\d{2}-\d{2}[T ][0-9:.+Z-]+|\d{2}:\d{2}:\d{2}(?:\.\d+)?)"
@@ -72,6 +77,11 @@ class NativeLogAnalysis:
import_scene_threw: bool = False
stage_without_new_stage: bool = False
tex_reclaim_count: int = 0
module_code_sync_error: bool = False
module_code_sync_left: int | None = None
module_code_sync_right: int | None = None
module_code_sync_delta: int | None = None
banned_code_1: bool = False
def latest_scene(self, name: str) -> SceneImport | None:
wanted = _scene_key(name)
@@ -95,6 +105,11 @@ class NativeLogAnalysis:
"failed_files": [event.to_dict() for event in self.failed_files],
"stage_without_new_stage": self.stage_without_new_stage,
"tex_reclaim_count": self.tex_reclaim_count,
"module_code_sync_error": self.module_code_sync_error,
"module_code_sync_left": self.module_code_sync_left,
"module_code_sync_right": self.module_code_sync_right,
"module_code_sync_delta": self.module_code_sync_delta,
"banned_code_1": self.banned_code_1,
}
for output_key, scene_name in (
("whispering_vale", "WhisperingVale"),
@@ -243,6 +258,27 @@ def parse_native_log_lines(lines: Iterable[str]) -> NativeLogAnalysis:
analysis.import_scene_threw = True
analysis.events.append(LogEvent("import_scene_threw", line_number, raw, timestamp))
module_sync = _MODULE_CODE_SYNC_RE.search(raw)
if module_sync is not None:
left = int(module_sync.group("left"))
right = int(module_sync.group("right"))
analysis.module_code_sync_error = True
analysis.module_code_sync_left = left
analysis.module_code_sync_right = right
analysis.module_code_sync_delta = abs(left - right)
analysis.events.append(
LogEvent(
"module_code_sync_error",
line_number,
raw,
timestamp,
f"{left} != {right}",
)
)
if "banned code 1" in raw.casefold():
analysis.banned_code_1 = True
analysis.events.append(LogEvent("banned_code_1", line_number, raw, timestamp))
failed_import = _FAILED_IMPORT_RE.search(raw)
if failed_import is not None:
value = failed_import.group("scene").strip()