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
+14 -2
View File
@@ -75,7 +75,11 @@ foreach ($db->query('SELECT * FROM general ORDER BY no') as $row) {
'dex4', 'dex5', 'killTurn', 'affinity', 'birthYear', 'deathYear', 'specAge', 'specAge2'] as $key) {
$general[$key] = (int)$general[$key];
}
$general['turnTime'] = $clock->formatTick(Util::toInt($general['turnTime']), true);
$general['turnTick'] = Util::toInt($general['turnTime']);
$general['turnTime'] = $clock->formatTick($general['turnTick'], true);
$general['recentWarTick'] = $general['recentWarTime'] === null
? null
: Util::toInt($general['recentWarTime']);
$general['recentWarTime'] = $general['recentWarTime'] === null
? null
: $clock->formatTick(Util::toInt($general['recentWarTime']), true);
@@ -102,7 +106,9 @@ foreach ($db->query('SELECT * FROM city ORDER BY city') as $row) {
}
$nations = [];
foreach ($db->query('SELECT * FROM nation ORDER BY nation') as $row) {
$lastAttackableByNation = KVStorage::getValuesFromInterNamespace($db, 'nation_env', 'last_attackable');
$lastCapitalMoveTrialByNation = KVStorage::getValuesFromInterNamespace($db, 'nation_env', 'last천도Trial');
foreach ($db->query('SELECT *, CAST(tech AS DOUBLE) AS tech_raw FROM nation ORDER BY nation') as $row) {
$nation = monthlySnapshotPick($row, [
'id' => 'nation', 'name' => 'name', 'color' => 'color', 'capitalCityId' => 'capital',
'gold' => 'gold', 'rice' => 'rice', 'tech' => 'tech', 'level' => 'level',
@@ -117,6 +123,12 @@ foreach ($db->query('SELECT * FROM nation ORDER BY nation') as $row) {
$nation[$key] = (int)$nation[$key];
}
$nation['tech'] = (float)$nation['tech'];
$nation['techRaw'] = (float)$row['tech_raw'];
$nation['lastAttackable'] = (int)($lastAttackableByNation[$nation['id']] ?? 0);
$lastCapitalMoveTrial = $lastCapitalMoveTrialByNation[$nation['id']] ?? null;
$nation['lastCapitalMoveTrial'] = is_array($lastCapitalMoveTrial)
? [(int)($lastCapitalMoveTrial[0] ?? 0), (int)($lastCapitalMoveTrial[1] ?? 0)]
: null;
$nations[] = $nation;
}