game: 사령턴 입력, 인사부 처리 시 삭턴 변경
This commit is contained in:
@@ -481,6 +481,13 @@ function setNationCommand(int $generalID, array $turnList, string $command, ?arr
|
|||||||
}
|
}
|
||||||
|
|
||||||
_setNationCommand($commandObj, $turnList);
|
_setNationCommand($commandObj, $turnList);
|
||||||
|
|
||||||
|
if($general->getNPCType() < 2){
|
||||||
|
//유저장인 경우에는 턴 리필
|
||||||
|
$general->updateVarWithLimit('killturn', $env['killturn'], $general->getVar('killturn'));
|
||||||
|
$general->applyDB($db);
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'result'=>true,
|
'result'=>true,
|
||||||
'brief'=>$commandObj->getBrief(),
|
'brief'=>$commandObj->getBrief(),
|
||||||
|
|||||||
+14
-2
@@ -24,9 +24,9 @@ $userID = Session::getUserID();
|
|||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$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'];
|
$myOfficerLevel = $me['officer_level'];
|
||||||
$nationID = $me['nation'];
|
$nationID = $me['nation'];
|
||||||
$myPenalty = Json::decode($me['penalty'] ?? '{}');
|
$myPenalty = Json::decode($me['penalty'] ?? '{}');
|
||||||
@@ -342,6 +342,10 @@ if ($action == "임명") {
|
|||||||
'reason' => $result
|
'reason' => $result
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
//수뇌의 삭턴 리필
|
||||||
|
$db->update('general', [
|
||||||
|
'killturn' => $db->sqleval('GREATEST(%b, %i)', 'killturn', $gameStor->getValue('killturn')),
|
||||||
|
], 'no=%i', $me['no']);
|
||||||
Json::die([
|
Json::die([
|
||||||
'result' => true,
|
'result' => true,
|
||||||
'reason' => 'success'
|
'reason' => 'success'
|
||||||
@@ -356,6 +360,10 @@ if ($action == "임명") {
|
|||||||
'reason' => $result
|
'reason' => $result
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
//수뇌의 삭턴 리필
|
||||||
|
$db->update('general', [
|
||||||
|
'killturn' => $db->sqleval('GREATEST(%b, %i)', 'killturn', $gameStor->getValue('killturn')),
|
||||||
|
], 'no=%i', $me['no']);
|
||||||
Json::die([
|
Json::die([
|
||||||
'result' => true,
|
'result' => true,
|
||||||
'reason' => 'success'
|
'reason' => 'success'
|
||||||
@@ -376,6 +384,10 @@ if ($action == "추방") {
|
|||||||
'reason' => $result
|
'reason' => $result
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
//수뇌의 삭턴 리필
|
||||||
|
$db->update('general', [
|
||||||
|
'killturn' => $db->sqleval('GREATEST(%b, %i)', 'killturn', $gameStor->getValue('killturn')),
|
||||||
|
], 'no=%i', $me['no']);
|
||||||
Json::die([
|
Json::die([
|
||||||
'result' => true,
|
'result' => true,
|
||||||
'reason' => 'success'
|
'reason' => 'success'
|
||||||
|
|||||||
Reference in New Issue
Block a user