refac: turnterm이 varturn 인 경우 대응 준비
This commit is contained in:
+12
-10
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user