Add ProjectZomboidClientActionLog (ClientActionLog.txt)

Strict 5-field bracketed format. Parser captures only the timestamp;
analysers that want steamid/action/player/coords/param decompose the
Line text via ClientActionPattern::FIELDS. Detectors: filename match
plus content signature on the IS{Enter,Exit}Vehicle / ISWalkToTimedAction
action tokens.
This commit is contained in:
2026-04-30 20:35:40 +00:00
parent 28e8fc8dc6
commit e74c105625
4 changed files with 119 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace IndifferentKetchup\Codex\Pattern\ProjectZomboid;
/**
* Regex constants for the Project Zomboid ClientActionLog.txt format.
*
* Strict 5-field bracketed structure:
* [time] [steamid][action][player][x,y,z][param].
*
* LINE captures, in order:
* 1. time (DD-MM-YY HH:MM:SS.mmm)
*
* The remaining bracketed fields are extractable via FIELDS for analysers.
*/
class ClientActionPattern
{
public const string LINE = '/^\[(\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3})\] \[\d{17}\]\[[^\]]+\]\[[^\]]+\]\[\d+,\d+,\d+\]\[[^\]]+\]\.$/';
public const string FIELDS = '/^\[\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\] \[(?<steamid>\d{17})\]\[(?<action>[^\]]+)\]\[(?<player>[^\]]+)\]\[(?<x>\d+),(?<y>\d+),(?<z>\d+)\]\[(?<param>[^\]]+)\]\.$/';
}