test(compare): trace deterministic monthly seed progression
This commit is contained in:
+17
-2
@@ -15,11 +15,24 @@ function calcTournamentTerm(int $turnTerm): int{
|
||||
|
||||
function processTournament()
|
||||
{
|
||||
if (
|
||||
getenv('REF_DETERMINISTIC_INSTALL_ENABLED') === '1'
|
||||
&& getenv('REF_DETERMINISTIC_TOURNAMENT_MODE') === 'hold'
|
||||
) {
|
||||
// Legacy tournament matches mix PHP rand(), shuffle(), and MariaDB
|
||||
// ORDER BY RAND(), so they are outside the hidden/monthly seed stream.
|
||||
// Hold the real-time subsystem during monthly world-state comparison.
|
||||
return;
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'tnmt_auto', 'tnmt_time', 'turnterm', 'last_tournament_betting_id']);
|
||||
$now = new \DateTime();
|
||||
// The comparison harness supplies a fixed clock through TimeUtil. Keep the
|
||||
// production clock unchanged while preventing tournament catch-up from
|
||||
// escaping that deterministic month boundary.
|
||||
$now = TimeUtil::nowDateTime();
|
||||
$offset = $now->getTimestamp() - (new \DateTime($admin['tnmt_time']))->getTimestamp();
|
||||
|
||||
//수동일땐 무시
|
||||
@@ -286,7 +299,9 @@ function startTournament($type)
|
||||
$unit = calcTournamentTerm($turnTerm);
|
||||
|
||||
$gameStor->tnmt_auto = true;
|
||||
$gameStor->tnmt_time = (new \DateTimeImmutable())->add(new \DateInterval("PT{$unit}M"))->format('Y-m-d H:i:s');
|
||||
$gameStor->tnmt_time = TimeUtil::nowDateTimeImmutable()
|
||||
->add(new \DateInterval("PT{$unit}M"))
|
||||
->format('Y-m-d H:i:s');
|
||||
$gameStor->tournament = 1;
|
||||
$gameStor->tnmt_type = $type;
|
||||
$gameStor->last_tournament_betting_id = 0;
|
||||
|
||||
Reference in New Issue
Block a user