From 5447274aa819c9bc154810d0039ade847adeb001 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 22 Jun 2024 15:28:39 +0000 Subject: [PATCH] =?UTF-8?q?game:=20=EC=82=AC=EB=A0=B9=ED=84=B4=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5,=20=EC=9D=B8=EC=82=AC=EB=B6=80=20=EC=B2=98=EB=A6=AC?= =?UTF-8?q?=20=EC=8B=9C=20=EC=82=AD=ED=84=B4=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_command.php | 7 +++++++ hwe/j_myBossInfo.php | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) 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'