Add ProjectZomboidCmdLog (cmd.txt)

Per-line client RPC trace. Parser captures only the timestamp;
analysers decompose steamid/player/command/coords via CmdPattern::FIELDS.
Detectors: filename match plus content signature on the
'steamid "name" command @ x,y,z' line shape.
This commit is contained in:
2026-04-30 20:36:26 +00:00
parent e74c105625
commit cc9c512667
4 changed files with 114 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\CmdPattern;
class ProjectZomboidCmdLog extends ProjectZomboidEventLog
{
public static function getDefaultParser(): ParserInterface
{
return static::makePatternParser(
CmdPattern::LINE,
[PatternParser::TIME]
);
}
public static function getDefaultAnalyser(): AnalyserInterface
{
return new PatternAnalyser();
}
public static function getDetectors(): array
{
return [
(new FilenameDetector())
->setPattern('/_cmd\.txt$/')
->setWeight(0.95),
(new WeightedSinglePatternDetector())
->setPattern('/^\[[^\]]+\] \d{17} "[^"]+" \w[\w.]+ @ \d/m')
->setWeight(0.85),
];
}
public function getTitle(): string
{
return "Project Zomboid Command Log";
}
}