From b0dcf14d967eb6e3951744167f000283b6efcedc Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 11 May 2020 02:14:33 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=91=EB=8B=B5=EC=8B=9C=20=EC=83=88?= =?UTF-8?q?=EB=A1=9C=EA=B3=A0=EC=B9=A8,=20=EB=93=B1=EC=9A=A9=EC=88=98?= =?UTF-8?q?=EB=9D=BD=20=EC=95=88=EB=90=98=EB=8A=94=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/j_general_log_old.php | 9 +++------ hwe/js/msg.js | 7 ++++++- hwe/sammo/Command/General/che_등용.php | 2 +- hwe/sammo/Command/General/che_등용수락.php | 4 ++-- hwe/sammo/ScoutMessage.php | 5 +++-- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/hwe/j_general_log_old.php b/hwe/j_general_log_old.php index 3b397b45..0779fef3 100644 --- a/hwe/j_general_log_old.php +++ b/hwe/j_general_log_old.php @@ -71,29 +71,26 @@ if($generalID !== $targetID){ } if($reqType == 'generalAction'){ - $result = getGeneralActionLogMore($targetID, $reqTo, 30, $lastSeq); + $result = getGeneralActionLogMore($targetID, $reqTo, 30); Json::die([ 'result'=>true, 'reason'=>'success', - 'sequence'=>$lastSeq, 'log'=>array_map(function($data){return ConvertLog($data);}, $result) ]); } if($reqType == 'battleResult'){ - $result = getBattleResultMore($targetID, $reqTo, 30, $lastSeq); + $result = getBattleResultMore($targetID, $reqTo, 30); Json::die([ 'result'=>true, 'reason'=>'success', - 'sequence'=>$lastSeq, 'log'=>array_map(function($data){return ConvertLog($data);}, $result) ]); } if($reqType == 'battleDetail'){ - $result = getBattleDetailLogMore($targetID, $reqTo, 30, $lastSeq); + $result = getBattleDetailLogMore($targetID, $reqTo, 30); Json::die([ 'result'=>true, 'reason'=>'success', - 'sequence'=>$lastSeq, 'log'=>array_map(function($data){return ConvertLog($data);}, $result) ]); } diff --git a/hwe/js/msg.js b/hwe/js/msg.js index 5af7a5e7..3a0bf9fa 100644 --- a/hwe/js/msg.js +++ b/hwe/js/msg.js @@ -26,7 +26,12 @@ function responseMessage(msgID, response){ response:response }) } - }).then(refreshMsg); + }).then(function(result){ + if(result && !result.result){ + alert(result.reason); + } + location.reload(); + }); } function deleteMessage(msgID){ diff --git a/hwe/sammo/Command/General/che_등용.php b/hwe/sammo/Command/General/che_등용.php index e73bbd3a..8798b79f 100644 --- a/hwe/sammo/Command/General/che_등용.php +++ b/hwe/sammo/Command/General/che_등용.php @@ -78,7 +78,7 @@ class che_등용 extends Command\GeneralCommand{ protected function initWithArg() { - $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['nation'], 0); + $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['nation', 'experience', 'dedication'], 0); $this->setDestGeneral($destGeneral); [$reqGold, $reqRice] = $this->getCost(); diff --git a/hwe/sammo/Command/General/che_등용수락.php b/hwe/sammo/Command/General/che_등용수락.php index f655e958..0aa4bfd7 100644 --- a/hwe/sammo/Command/General/che_등용수락.php +++ b/hwe/sammo/Command/General/che_등용수락.php @@ -83,14 +83,14 @@ class che_등용수락 extends Command\GeneralCommand{ protected function initWithArg() { - $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['nation'], 0); + $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], null, 2); $this->setDestGeneral($destGeneral); $this->setDestNation($this->arg['destNationID'], ['gennum', 'scout']); $relYear = $this->env['year'] - $this->env['startyear']; $this->fullConditionConstraints=[ - ConstraintHelper::ReqEnvValue('join_mode', '==', 'onlyRandom', '랜덤 임관만 가능합니다'), + ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다'), ConstraintHelper::NotOpeningPart($relYear), ConstraintHelper::ExistsDestNation(), ConstraintHelper::AllowJoinDestNation($relYear), diff --git a/hwe/sammo/ScoutMessage.php b/hwe/sammo/ScoutMessage.php index 267f8052..19e54151 100644 --- a/hwe/sammo/ScoutMessage.php +++ b/hwe/sammo/ScoutMessage.php @@ -49,7 +49,7 @@ class ScoutMessage extends Message{ return [self::INVALID, '올바른 수신자가 아닙니다.']; } - return [self::ACCEPTED, '']; + return [self::ACCEPTED, '성공']; } /** @@ -63,7 +63,7 @@ class ScoutMessage extends Message{ } $gameStor = KVStorage::getStorage(DB::db(), 'game_env'); - $general = \sammo\General::createGeneralObjFromDB($receiverID, ['npc', 'gold', 'rice', 'experience', 'dedication', 'betray', 'troop', 'aux'], 1); + $general = \sammo\General::createGeneralObjFromDB($receiverID, null, 2); $logger = $general->getLogger(); @@ -84,6 +84,7 @@ class ScoutMessage extends Message{ if(!$commandObj->hasFullConditionMet()){ $logger->pushGeneralActionLog($commandObj->getFailString()); + $reason = $commandObj->getFailString(); return self::DECLINED; }