Add AdminTeleportedInformation insight

This commit is contained in:
2026-04-30 21:47:14 +00:00
parent 64641fa8e8
commit d15fc81f9f
3 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace IndifferentKetchup\Codex\Analysis\ProjectZomboid;
use IndifferentKetchup\Codex\Analysis\Information;
use IndifferentKetchup\Codex\Analysis\PatternInsightInterface;
use IndifferentKetchup\Codex\Pattern\ProjectZomboid\AdminPattern;
class AdminTeleportedInformation extends Information implements PatternInsightInterface
{
public static function getPatterns(): array
{
return [AdminPattern::TELEPORTED_ENTRY];
}
public function setMatches(array $matches, mixed $patternKey): void
{
$this->setLabel('Admin teleported');
$this->setValue(sprintf(
'%s teleported %s to %s,%s,%s',
$matches['admin'],
$matches['target'],
$matches['x'],
$matches['y'],
$matches['z']
));
}
}

View File

@@ -42,4 +42,6 @@ class AdminPattern
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>.+?)\.?$/';
public const string RELOADED_OPTIONS_ENTRY = '/^\[\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\] (?<admin>.+?) reloaded options\.?$/';
public const string TELEPORTED_ENTRY = '/^\[\d{2}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\] (?<admin>.+?) teleported (?<target>.+?) to (?<x>\d+),(?<y>\d+),(?<z>-?\d+)\.?$/';
}