diff --git a/api/analysis.php b/api/analysis.php index b609620..67d7616 100644 --- a/api/analysis.php +++ b/api/analysis.php @@ -393,6 +393,9 @@ foreach ($allEvents as $ev) { $tgtId = (int)($ev['targetID'] ?? 0); if (!$abId || !$tgtId || $abId <= 7) continue; + $srcId = (int)($ev['sourceID'] ?? 0); + if ($srcId > 0 && isset($players[$srcId])) continue; + $byAbility[$abId][] = [ 'ts' => (float)($ev['timestamp'] ?? 0), 'tgtId' => $tgtId, diff --git a/api/cache.php b/api/cache.php index 65bc873..8aeade9 100644 --- a/api/cache.php +++ b/api/cache.php @@ -2,6 +2,7 @@ declare(strict_types=1); const CACHED_LOG_DIR = __DIR__ . '/../cached_logs'; +const CACHED_LOG_VERSION = 'v2'; function cache_language(string $language): string { $language = strtolower(trim($language)); @@ -25,7 +26,7 @@ function cached_log_path(string $kind, string $reportCode, string $language, arr $safeParts = array_map('cache_key_part', $parts); $suffix = $safeParts ? '_' . implode('_', $safeParts) : ''; - return CACHED_LOG_DIR . '/' . $reportCode . '/' . $language . '/' . $kind . $suffix . '.json'; + return CACHED_LOG_DIR . '/' . CACHED_LOG_VERSION . '/' . $reportCode . '/' . $language . '/' . $kind . $suffix . '.json'; } function read_cached_log(string $kind, string $reportCode, string $language, array $parts = []): ?string {