불가침, 종전 메시지

This commit is contained in:
2020-05-03 00:31:04 +09:00
parent 83e8cfc2cc
commit ce5ad89d5e
16 changed files with 477 additions and 98 deletions
@@ -27,7 +27,7 @@ use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper;
class che_불가침수락 extends Command\NationCommand{
static protected $actionName = '불가침';
static protected $actionName = '불가침 수락';
static public $reqArg = true;
protected function argTest():bool{
@@ -95,7 +95,7 @@ class che_불가침수락 extends Command\NationCommand{
$this->setCity();
$this->setNation();
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['imgsvr', 'picture'], 1);
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], [], 1);
$this->setDestGeneral($destGeneral);
$this->setDestNation($this->arg['destNationID']);
@@ -126,6 +126,7 @@ class che_불가침수락 extends Command\NationCommand{
ConstraintHelper::SuppliedCity(),
ConstraintHelper::ExistsDestNation(),
ConstraintHelper::ExistsDestGeneral(),
ConstraintHelper::ReqDestNationValue('nation', '소속', '==', $this->destGeneralObj->getNationID(), '제의 장수가 국가 소속이 아닙니다'),
ConstraintHelper::DisallowDiplomacyBetweenStatus([
0 => '아국과 이미 교전중입니다.',
1 => '아국과 이미 선포중입니다.',
@@ -155,7 +156,7 @@ class che_불가침수락 extends Command\NationCommand{
$destNationName = getNationStaticInfo($this->arg['destNationID'])['name'];
$year = $this->arg['year'];
$month = $this->arg['month'];
return "{$year}{$month}까지 ";
return "{$year}{$month}월까지 불가침 합의";
}
public function run():bool{
@@ -180,7 +181,7 @@ class che_불가침수락 extends Command\NationCommand{
$month = $this->arg['month'];
$logger = $general->getLogger();
$destLogger = new ActionLogger(0, $destNationID, $env['year'], $env['month']);
$destLogger = $this->destGeneralObj->getLogger();
$currentMonth = $env['year'] * 12 + $env['month'] - 1;
$reqMonth = $year *12 + $month - 1;
@@ -194,13 +195,13 @@ class che_불가침수락 extends Command\NationCommand{
$nationID, $destNationID);
$josaWa = JosaUtil::pick($destNationName, '와');
$logger->pushGeneralActionLog("<D><b>{$destNationName}</b></>{$josaWa} <C>$year</>년 불가침에 성공했습니다.", ActionLogger::PLAIN);
$logger->pushGeneralHistoryLog("<D><b>{$destNationName}</b></>{$josaWa} {$year}{$month}까지 불가침 성공");
$logger->pushGeneralActionLog("<D><b>{$destNationName}</b></>{$josaWa} <C>$year</>년 <C>{$month}</>월까지 불가침에 성공했습니다.", ActionLogger::PLAIN);
$logger->pushGeneralHistoryLog("<D><b>{$destNationName}</b></>{$josaWa} {$year}{$month}월까지 불가침 성공");
$josaWa = JosaUtil::pick($nationName, '와');
$destLogger->pushGeneralActionLog("<D><b>{$nationName}</b></>{$josaWa} <C>$year</>년 불가침에 성공했습니다.", ActionLogger::PLAIN);
$destLogger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>{$josaWa} {$year}{$month}까지 불가침 성공");
$destLogger->pushGeneralActionLog("<D><b>{$nationName}</b></>{$josaWa} <C>$year</>년 <C>{$month}</>월까지 불가침에 성공했습니다.", ActionLogger::PLAIN);
$destLogger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>{$josaWa} {$year}{$month}월까지 불가침 성공");
$general->applyDB($db);
$destLogger->flush();