fix: complete logical clock wall-time isolation

This commit is contained in:
2026-08-04 20:37:56 +09:00
committed by Hide_D
parent 5d9512ced7
commit fc6f84ce23
67 changed files with 689 additions and 231 deletions
+25 -11
View File
@@ -6,15 +6,20 @@ use sammo\Enums\EventTarget;
use sammo\Enums\InheritanceKey;
use \Symfony\Component\Lock;
class TurnExecutionHelper
{
class TurnExecutionHelper
{
/** @var General*/
protected $generalObj;
public function __construct(General $general)
public function __construct(General $general)
{
$this->generalObj = $general;
}
}
public static function monotonicCompletionTick(int $completedTick, int $candidateTick): int
{
return max($completedTick, $candidateTick);
}
public function __destruct()
{
@@ -450,9 +455,12 @@ class TurnExecutionHelper
updateTraffic();
if ($executionOver) {
if ($currentTurn !== null) {
$executed = true;
$gameStor->turntime = $currentTurn;
if ($currentTurn !== null) {
$executed = true;
$gameStor->turntime = self::monotonicCompletionTick(
Util::toInt($gameStor->turntime),
$currentTurn,
);
}
unlock();
return $gameStor->turntime;
@@ -497,10 +505,16 @@ class TurnExecutionHelper
$gameStor->month
);
if ($currentTurn !== null) {
$executed = true;
$gameStor->turntime = $currentTurn;
}
if ($currentTurn !== null) {
$executed = true;
// A general's sub-tick can be just before the monthly boundary that
// was completed above. Never move the global completion cursor back
// behind an already-applied monthly event.
$gameStor->turntime = self::monotonicCompletionTick(
Util::toInt($gameStor->turntime),
$currentTurn,
);
}
//토너먼트 처리
processTournament();