test(compare): trace deterministic monthly seed progression
This commit is contained in:
@@ -181,6 +181,7 @@ function comparisonRowsById(string $table, string $idColumn, array $ids): array
|
||||
|
||||
function comparisonTurnStateSnapshot(array $request): array
|
||||
{
|
||||
$db = DB::db();
|
||||
$observe = $request['observe'] ?? [];
|
||||
if (!is_array($observe)) {
|
||||
throw new \InvalidArgumentException('observe must be an object');
|
||||
@@ -188,6 +189,15 @@ function comparisonTurnStateSnapshot(array $request): array
|
||||
$generalIds = comparisonIntegerList($observe['generalIds'] ?? [], 'generalIds');
|
||||
$cityIds = comparisonIntegerList($observe['cityIds'] ?? [], 'cityIds');
|
||||
$nationIds = comparisonIntegerList($observe['nationIds'] ?? [], 'nationIds');
|
||||
if (($observe['allGenerals'] ?? false) === true) {
|
||||
$generalIds = array_map('intval', $db->queryFirstColumn('SELECT no FROM general ORDER BY no'));
|
||||
}
|
||||
if (($observe['allCities'] ?? false) === true) {
|
||||
$cityIds = array_map('intval', $db->queryFirstColumn('SELECT city FROM city ORDER BY city'));
|
||||
}
|
||||
if (($observe['allNations'] ?? false) === true) {
|
||||
$nationIds = array_map('intval', $db->queryFirstColumn('SELECT nation FROM nation ORDER BY nation'));
|
||||
}
|
||||
$logAfterId = $observe['logAfterId'] ?? 0;
|
||||
$messageAfterId = $observe['messageAfterId'] ?? 0;
|
||||
$includeNationHistoryLogs = $observe['includeNationHistoryLogs'] ?? false;
|
||||
@@ -219,7 +229,6 @@ function comparisonTurnStateSnapshot(array $request): array
|
||||
throw new \InvalidArgumentException('includeGlobalHistoryLogs must be a boolean');
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$game = KVStorage::getStorage($db, 'game_env');
|
||||
$game->resetCache();
|
||||
$worldValues = $game->getValues([
|
||||
|
||||
Reference in New Issue
Block a user