Add AdminChangedOptionInformation insight

This commit is contained in:
2026-04-30 21:46:13 +00:00
parent caed04db10
commit b7b89ef24e
3 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace IndifferentKetchup\Codex\Analysis\ProjectZomboid;
use IndifferentKetchup\Codex\Analysis\Information;
use IndifferentKetchup\Codex\Analysis\PatternInsightInterface;
use IndifferentKetchup\Codex\Pattern\ProjectZomboid\AdminPattern;
class AdminChangedOptionInformation extends Information implements PatternInsightInterface
{
public static function getPatterns(): array
{
return [AdminPattern::CHANGED_OPTION_ENTRY];
}
public function setMatches(array $matches, mixed $patternKey): void
{
$this->setLabel('Admin changed option');
$this->setValue(sprintf(
'%s set %s=%s',
$matches['admin'],
$matches['option'],
$matches['value']
));
}
}

View File

@@ -38,4 +38,6 @@ class AdminPattern
public const string ADDED_XP_ENTRY = '/^\[\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\] (?<admin>.+?) added (?<amount>[\d.]+) (?<skill>\S+) xp\'s to (?<target>.+?)\.?$/';
public const string GRANTED_ACCESS_ENTRY = '/^\[\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\] (?<admin>.+?) granted (?<level>\w+) access level on (?<target>.+?)\.?$/';
public const string CHANGED_OPTION_ENTRY = '/^\[\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\] (?<admin>.+?) changed option (?<option>\S+?)=(?<value>.+?)\.?$/';
}