fix: complete logical clock wall-time isolation
This commit is contained in:
+15
-12
@@ -25,21 +25,24 @@ if(!$reserved){
|
||||
]);
|
||||
}
|
||||
|
||||
$reservedDate = new \DateTime($reserved['date']);
|
||||
$now = new \DateTime();
|
||||
$reservedDate = new \DateTimeImmutable($reserved['date']);
|
||||
$now = GameClock::readWallTime();
|
||||
|
||||
|
||||
$status = 'not_yet';
|
||||
|
||||
list($isUnited, $lastTurn) = $gameStor->getValuesAsArray(['isunited', 'turntime']);
|
||||
if($isUnited === null || $lastTurn === null){
|
||||
$isUnited = 2;
|
||||
$lastTurn = '2000-01-01';
|
||||
}
|
||||
|
||||
if($lastTurn !== null){
|
||||
$lastTurn = new \DateTime($lastTurn);
|
||||
}
|
||||
list($isUnited, $unitedWallAnchor) = $gameStor->getValuesAsArray(['isunited', 'autoreset_united_wall_anchor']);
|
||||
if($isUnited === null){
|
||||
$isUnited = 2;
|
||||
}
|
||||
$lastTurn = null;
|
||||
if($isUnited > 0){
|
||||
if(!is_string($unitedWallAnchor) || $unitedWallAnchor === ''){
|
||||
$unitedWallAnchor = TimeUtil::format($now, true);
|
||||
$gameStor->autoreset_united_wall_anchor = $unitedWallAnchor;
|
||||
}
|
||||
$lastTurn = new \DateTimeImmutable($unitedWallAnchor);
|
||||
}
|
||||
|
||||
if($lastTurn === null){
|
||||
//이미 리셋된 상태임
|
||||
@@ -99,4 +102,4 @@ $result['affected']=1;
|
||||
$prefix = DB::prefix();
|
||||
ServConfig::getServerList()[$prefix]->openServer();
|
||||
|
||||
Json::die($result);
|
||||
Json::die($result);
|
||||
|
||||
Reference in New Issue
Block a user