Add ProjectZomboidMapLog (map.txt)

Per-line world object placement/removal log. LINE pattern handles both
integer and floating-point coordinates and both 'Base.X' and
'IsoObject (X)' object encodings. Detectors: filename match plus content
signature on the added/removed verbs paired with Base./IsoObject prefix.
This commit is contained in:
2026-04-30 20:37:50 +00:00
parent 49cf4927f6
commit 6387fb1c52
4 changed files with 123 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
<?php
namespace IndifferentKetchup\Codex\Pattern\ProjectZomboid;
/**
* Regex constants for the Project Zomboid map.txt format.
*
* [time] steamid "player" verb object at x,y,z.
*
* Coordinates may be integer or floating point; objects may be Base.X
* tokens or 'IsoObject (X)' parenthesised forms.
*/
class MapPattern
{
public const string LINE = '/^\[(\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3})\] \d{17} "[^"]+" \S+ .+ at [\d.]+,[\d.]+,[\d.]+\.$/';
public const string FIELDS = '/^\[\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\] (?<steamid>\d{17}) "(?<player>[^"]+)" (?<verb>\S+) (?<object>.+) at (?<x>[\d.]+),(?<y>[\d.]+),(?<z>[\d.]+)\.$/';
}