diff --git a/hwe/func_command.php b/hwe/func_command.php index 2d7affcc..8dbc22c9 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -481,6 +481,13 @@ function setNationCommand(int $generalID, array $turnList, string $command, ?arr } _setNationCommand($commandObj, $turnList); + + if($general->getNPCType() < 2){ + //유저장인 경우에는 턴 리필 + $general->updateVarWithLimit('killturn', $env['killturn'], $general->getVar('killturn')); + $general->applyDB($db); + } + return [ 'result'=>true, 'brief'=>$commandObj->getBrief(), diff --git a/hwe/j_myBossInfo.php b/hwe/j_myBossInfo.php index d35dd757..ad43a44d 100644 --- a/hwe/j_myBossInfo.php +++ b/hwe/j_myBossInfo.php @@ -24,9 +24,9 @@ $userID = Session::getUserID(); $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); -$gameStor->cacheValues(['startyear', 'year', 'month', 'scenario']); +$gameStor->cacheValues(['startyear', 'year', 'month', 'scenario', 'killturn']); -$me = $db->queryFirstRow('SELECT no,nation,officer_level,penalty from general where owner=%i', $userID); +$me = $db->queryFirstRow('SELECT no,npc,nation,officer_level,penalty from general where owner=%i', $userID); $myOfficerLevel = $me['officer_level']; $nationID = $me['nation']; $myPenalty = Json::decode($me['penalty'] ?? '{}'); @@ -342,6 +342,10 @@ if ($action == "임명") { 'reason' => $result ]); } + //수뇌의 삭턴 리필 + $db->update('general', [ + 'killturn' => $db->sqleval('GREATEST(%b, %i)', 'killturn', $gameStor->getValue('killturn')), + ], 'no=%i', $me['no']); Json::die([ 'result' => true, 'reason' => 'success' @@ -356,6 +360,10 @@ if ($action == "임명") { 'reason' => $result ]); } + //수뇌의 삭턴 리필 + $db->update('general', [ + 'killturn' => $db->sqleval('GREATEST(%b, %i)', 'killturn', $gameStor->getValue('killturn')), + ], 'no=%i', $me['no']); Json::die([ 'result' => true, 'reason' => 'success' @@ -376,6 +384,10 @@ if ($action == "추방") { 'reason' => $result ]); } + //수뇌의 삭턴 리필 + $db->update('general', [ + 'killturn' => $db->sqleval('GREATEST(%b, %i)', 'killturn', $gameStor->getValue('killturn')), + ], 'no=%i', $me['no']); Json::die([ 'result' => true, 'reason' => 'success'