예약턴 바로 받아오도록 수정
This commit is contained in:
@@ -62,6 +62,7 @@ class che_첩보 extends Command\GeneralCommand
|
|||||||
$this->minConditionConstraints = [
|
$this->minConditionConstraints = [
|
||||||
ConstraintHelper::ReqGeneralGold($reqGold),
|
ConstraintHelper::ReqGeneralGold($reqGold),
|
||||||
ConstraintHelper::ReqGeneralRice($reqRice),
|
ConstraintHelper::ReqGeneralRice($reqRice),
|
||||||
|
ConstraintHelper::NotBeNeutral(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ class General implements iAction{
|
|||||||
if(!$rawCmd){
|
if(!$rawCmd){
|
||||||
return buildGeneralCommandClass(null, $this, $env);
|
return buildGeneralCommandClass(null, $this, $env);
|
||||||
}
|
}
|
||||||
return buildGeneralCommandClass($rawCmd['action'], $this, $env, $rawCmd['arg']);
|
return buildGeneralCommandClass($rawCmd['action'], $this, $env, Json::decode($rawCmd['arg']??null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -340,7 +340,7 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach($rawCmds as $turnIdx=>$rawCmd){
|
foreach($rawCmds as $turnIdx=>$rawCmd){
|
||||||
$result[$turnIdx] = buildGeneralCommandClass($rawCmd['action'], $this, $env, $rawCmd['arg']);
|
$result[$turnIdx] = buildGeneralCommandClass($rawCmd['action'], $this, $env, Json::decode($rawCmd['arg']??null));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
@@ -1073,7 +1073,7 @@ class General implements iAction{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$rawCmd = $rawCmds[$generalID];
|
$rawCmd = $rawCmds[$generalID];
|
||||||
$result[$generalID] = buildGeneralCommandClass($rawCmd['action'], $general, $env, $rawCmd['arg']);
|
$result[$generalID] = buildGeneralCommandClass($rawCmd['action'], $general, $env, Json::decode($rawCmd['arg']));
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -1127,7 +1127,7 @@ class General implements iAction{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach($orderedRawCmds[$generalID] as $turnIdx=>$rawCmd){
|
foreach($orderedRawCmds[$generalID] as $turnIdx=>$rawCmd){
|
||||||
$result[$generalID][$turnIdx] = buildGeneralCommandClass($rawCmd['action'], $general, $env, $rawCmd['arg']);
|
$result[$generalID][$turnIdx] = buildGeneralCommandClass($rawCmd['action'], $general, $env, Json::decode($rawCmd['arg']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
@@ -215,10 +215,7 @@ class TurnExecutionHelper
|
|||||||
static public function executeGeneralCommandUntil(string $date, \DateTimeInterface $limitActionTime, int $year, int $month){
|
static public function executeGeneralCommandUntil(string $date, \DateTimeInterface $limitActionTime, int $year, int $month){
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$generalsTodo = $db->query(
|
$generalsTodo = $db->query(
|
||||||
'SELECT no,name,turntime,killturn,block,npc,deadyear,
|
'SELECT no,name,turntime,killturn,block,npc,deadyear FROM general WHERE turntime < %s ORDER BY turntime ASC, `no` ASC',
|
||||||
general_turn.`action` AS `action`, general_turn.arg AS arg
|
|
||||||
FROM general LEFT JOIN general_turn ON general.`no` = general_turn.general_id AND turn_idx = 0
|
|
||||||
WHERE turntime < %s ORDER BY turntime ASC, `no` ASC',
|
|
||||||
$date
|
$date
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -228,11 +225,6 @@ WHERE turntime < %s ORDER BY turntime ASC, `no` ASC',
|
|||||||
$autorun_user = $gameStor->autorun_user;
|
$autorun_user = $gameStor->autorun_user;
|
||||||
|
|
||||||
foreach($generalsTodo as $rawGeneral){
|
foreach($generalsTodo as $rawGeneral){
|
||||||
$generalCommand = $rawGeneral['action'];
|
|
||||||
$generalArg = Json::decode($rawGeneral['arg'])??[];
|
|
||||||
unset($rawGeneral['action']);
|
|
||||||
unset($rawGeneral['arg']);
|
|
||||||
|
|
||||||
$currActionTime = new \DateTimeImmutable();
|
$currActionTime = new \DateTimeImmutable();
|
||||||
if($currActionTime > $limitActionTime){
|
if($currActionTime > $limitActionTime){
|
||||||
return [true, $currentTurn];
|
return [true, $currentTurn];
|
||||||
@@ -242,7 +234,7 @@ WHERE turntime < %s ORDER BY turntime ASC, `no` ASC',
|
|||||||
$turnObj = new static($general);
|
$turnObj = new static($general);
|
||||||
|
|
||||||
$env = $gameStor->getAll(true);
|
$env = $gameStor->getAll(true);
|
||||||
$generalCommandObj = buildGeneralCommandClass($generalCommand, $general, $env, $generalArg);
|
$generalCommandObj = $general->getReservedTurn(0, $env);
|
||||||
|
|
||||||
$hasNationTurn = false;
|
$hasNationTurn = false;
|
||||||
if($general->getVar('nation') != 0 && $general->getVar('officer_level') >= 5){
|
if($general->getVar('nation') != 0 && $general->getVar('officer_level') >= 5){
|
||||||
|
|||||||
Reference in New Issue
Block a user