Add ProjectZomboidItemLog (item.txt)

Per-line item gain/loss event log. Parser captures only the timestamp;
analysers decompose location/delta/item via ItemPattern::FIELDS.
Detectors: filename match plus content signature on the
container/floor/inventory location verbs paired with a signed delta.
This commit is contained in:
2026-04-30 20:37:06 +00:00
parent cc9c512667
commit 49cf4927f6
4 changed files with 113 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
<?php
namespace IndifferentKetchup\Codex\Pattern\ProjectZomboid;
/**
* Regex constants for the Project Zomboid item.txt format.
*
* [time] steamid "player" location ±N x,y,z [Base.ItemId].
*/
class ItemPattern
{
public const string LINE = '/^\[(\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3})\] \d{17} "[^"]+" \S+ [+\-]\d+ \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>[^"]+)" (?<location>\S+) (?<delta>[+\-]\d+) (?<x>\d+),(?<y>\d+),(?<z>\d+) \[(?<item>[^\]]+)\]\.$/';
}