merge: refresh ng_compare for logical game clock
This commit is contained in:
@@ -42,10 +42,13 @@ function monthlySnapshotPick(array $row, array $mapping, array $jsonColumns = []
|
||||
$db = DB::db();
|
||||
$game = KVStorage::getStorage($db, 'game_env');
|
||||
$game->resetCache();
|
||||
$clock = GameClock::fromStorage($game);
|
||||
$world = $game->getValues([
|
||||
'scenario', 'year', 'month', 'turnterm', 'turntime', 'starttime',
|
||||
'init_year', 'init_month', 'develcost', 'killturn', 'isunited',
|
||||
]);
|
||||
$world['turntime'] = $clock->formatTick(Util::toInt($world['turntime']), true);
|
||||
$world['starttime'] = $clock->formatTick(Util::toInt($world['starttime']), true);
|
||||
|
||||
$generals = [];
|
||||
foreach ($db->query('SELECT * FROM general ORDER BY no') as $row) {
|
||||
@@ -69,6 +72,10 @@ 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['recentWarTime'] = $general['recentWarTime'] === null
|
||||
? null
|
||||
: $clock->formatTick(Util::toInt($general['recentWarTime']), true);
|
||||
$generals[] = $general;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user