diff --git a/src/Log/ProjectZomboid/ProjectZomboidAdminLog.php b/src/Log/ProjectZomboid/ProjectZomboidAdminLog.php new file mode 100644 index 0000000..0e9b986 --- /dev/null +++ b/src/Log/ProjectZomboid/ProjectZomboidAdminLog.php @@ -0,0 +1,47 @@ +setPattern('/_admin\.txt$/') + ->setWeight(0.95), + (new WeightedSinglePatternDetector()) + ->setPattern('/^\[[^\]]+\] .+? added item Base\.\S+ in .+?\'s inventory/m') + ->setWeight(0.90), + (new WeightedSinglePatternDetector()) + ->setPattern('/^\[[^\]]+\] .+? granted (?:admin|user|moderator|gm|observer) access level on /m') + ->setWeight(0.85), + ]; + } + + public function getTitle(): string + { + return "Project Zomboid Admin Log"; + } +} diff --git a/src/Pattern/ProjectZomboid/AdminPattern.php b/src/Pattern/ProjectZomboid/AdminPattern.php new file mode 100644 index 0000000..ee206d9 --- /dev/null +++ b/src/Pattern/ProjectZomboid/AdminPattern.php @@ -0,0 +1,28 @@ + ...' Verb dispatch is left + * to the analyser layer. The admin name itself can contain parentheses + * (Nathan(Weerd)) or whitespace (silly goose) so the parser captures + * only the timestamp. + */ +class AdminPattern +{ + public const string LINE = '/^\[(\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3})\] .+\.$/'; + + public const string ADDED_ITEM = '/^(?.+?) added item (?Base\.\S+) in (?.+?)\'s inventory$/'; + + public const string ADDED_XP = '/^(?.+?) added (?[\d.]+) (?\S+) xp\'s to (?.+)$/'; + + public const string GRANTED_ACCESS = '/^(?.+?) granted (?\w+) access level on (?.+)$/'; + + public const string CHANGED_OPTION = '/^(?.+?) changed option (?