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,44 @@
<?php
namespace IndifferentKetchup\Codex\Log\ProjectZomboid;
use IndifferentKetchup\Codex\Analyser\AnalyserInterface;
use IndifferentKetchup\Codex\Analyser\PatternAnalyser;
use IndifferentKetchup\Codex\Detective\FilenameDetector;
use IndifferentKetchup\Codex\Detective\WeightedSinglePatternDetector;
use IndifferentKetchup\Codex\Parser\ParserInterface;
use IndifferentKetchup\Codex\Parser\PatternParser;
use IndifferentKetchup\Codex\Pattern\ProjectZomboid\ClientActionPattern;
class ProjectZomboidClientActionLog extends ProjectZomboidEventLog
{
public static function getDefaultParser(): ParserInterface
{
return static::makePatternParser(
ClientActionPattern::LINE,
[PatternParser::TIME]
);
}
public static function getDefaultAnalyser(): AnalyserInterface
{
return new PatternAnalyser();
}
public static function getDetectors(): array
{
return [
(new FilenameDetector())
->setPattern('/_ClientActionLog\.txt$/')
->setWeight(0.95),
(new WeightedSinglePatternDetector())
->setPattern('/\[\d{17}\]\[(?:ISEnterVehicle|ISExitVehicle|ISWalkToTimedAction)\]\[/')
->setWeight(0.95),
];
}
public function getTitle(): string
{
return "Project Zomboid Client Action Log";
}
}