test: trace scenario 2400 parity

This commit is contained in:
2026-08-05 13:25:58 +00:00
parent ba7676e0f6
commit 191bb6428a
5 changed files with 100 additions and 32 deletions
+32
View File
@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace sammo;
if (PHP_SAPI !== 'cli' || getenv('REF_DETERMINISTIC_INSTALL_ENABLED') !== '1') {
http_response_code(404);
exit(1);
}
chdir(dirname(__DIR__));
require_once 'lib.php';
$rows = DB::db()->query(
'SELECT general_id, log_type, year, month, text
FROM general_record
WHERE log_type IN ("battle_brief", "battle")
ORDER BY id'
);
echo json_encode([
'schemaVersion' => 1,
'engine' => 'ref',
'logs' => array_map(static fn(array $row): array => [
'generalId' => (int)$row['general_id'],
'category' => $row['log_type'] === 'battle_brief' ? 'BATTLE_BRIEF' : 'BATTLE_DETAIL',
'year' => (int)$row['year'],
'month' => (int)$row['month'],
'text' => (string)$row['text'],
], $rows),
], JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), PHP_EOL;