fix: relax DebugServerPattern::LINE for PZ B42 log format

PZ build 42.x dropped the per-line `t:` (microsecond) field and
tightened the spacing between `f:N`, `t:N`, and `st:N,N,N,N>` markers.
The hardcoded `f:\d+,\s+t:\d+,\s+st:` requirement caused every B42
line to fail the parser's LINE regex, leaving ServerLog entries
without their level/prefix and silently disabling
ServerExceptionProblem and ModMissingProblem (the anchorless
EngineVersionInformation still fired against the joined entry text,
which is why the symptom was "one Information, no Problems").

Make `t:N,` optional via `(?:,\s+t:\d+)?` and the comma between
`f:N` and `st:` optional via `,?`. The B41 format remains a strict
match. Add `debug-server-42x-minimal.txt` mirroring the existing
synthetic fixture in the new format, and parameterise
ProjectZomboidServerLogTest with a #[DataProvider] so all four
parser-shape assertions now run against both formats. Spot-check:
analysers emit 3 Problems (2 exceptions, 1 missing mod) and 4
Information entries against the new fixture, identical to B41.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-06 13:33:35 +00:00
parent 45a5e1a3da
commit 0d18cfbfc6
3 changed files with 49 additions and 11 deletions

View File

@@ -15,7 +15,7 @@ namespace IndifferentKetchup\Codex\Pattern\ProjectZomboid;
*/
class DebugServerPattern
{
public const string LINE = '/^\[(\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3})\]\s+(\w+)\s*:\s+(\S+)\s+f:\d+,\s+t:\d+,\s+st:[\d,]+>\s+.*$/';
public const string LINE = '/^\[(\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3})\]\s+(\w+)\s*:\s+(\S+)\s+f:\d+(?:,\s+t:\d+)?,?\s+st:[\d,]+>\s+.*$/';
public const string VERSION = '/version=(?<version>\S+) (?<hash>[a-f0-9]{40}) (?<date>\d{4}-\d{2}-\d{2}) (?<time>\d{2}:\d{2}:\d{2})/';