From 8dc5231118bb6af734e47c3bfcb983bf83cdfa3c Mon Sep 17 00:00:00 2001 From: Hide_D Date: Wed, 29 Oct 2025 15:15:05 +0000 Subject: [PATCH] =?UTF-8?q?refac:=20turnterm=EC=9D=B4=20varturn=20?= =?UTF-8?q?=EC=9D=B8=20=EA=B2=BD=EC=9A=B0=20=EB=8C=80=EC=9D=91=20=EC=A4=80?= =?UTF-8?q?=EB=B9=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/ServerTool.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/hwe/sammo/ServerTool.php b/hwe/sammo/ServerTool.php index 3188b3f7..1df104d0 100644 --- a/hwe/sammo/ServerTool.php +++ b/hwe/sammo/ServerTool.php @@ -14,12 +14,23 @@ final class ServerTool if ((120 % $turnterm) != 0) { return 'invalid minute'; } - + $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); $admin = $gameStor->getValues(['turntime', 'turnterm', 'year', 'startyear', 'month', 'isunited']); + $oldunit = $admin['turnterm'] * 60; + $unit = $turnterm * 60; + + if($unit == $oldunit){ + return null; + } + + if($oldunit < 0 || $unit < 0){ + return 'variable_turnterm'; + } + $reqGameLock = $admin['isunited'] != 2 && !$ignoreLock; $locked = false; @@ -40,15 +51,6 @@ final class ServerTool $locked = tryLock(); } - $oldunit = $admin['turnterm'] * 60; - $unit = $turnterm * 60; - - if($unit == $oldunit){ - if($locked){ - unlock(); - } - return null; - } $unitDiff = $unit / $oldunit;