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; }