응답시 새로고침, 등용수락 안되는 버그 수정

This commit is contained in:
2020-05-11 02:14:33 +09:00
parent 780169962d
commit b0dcf14d96
5 changed files with 15 additions and 12 deletions
+3 -6
View File
@@ -71,29 +71,26 @@ if($generalID !== $targetID){
} }
if($reqType == 'generalAction'){ if($reqType == 'generalAction'){
$result = getGeneralActionLogMore($targetID, $reqTo, 30, $lastSeq); $result = getGeneralActionLogMore($targetID, $reqTo, 30);
Json::die([ Json::die([
'result'=>true, 'result'=>true,
'reason'=>'success', 'reason'=>'success',
'sequence'=>$lastSeq,
'log'=>array_map(function($data){return ConvertLog($data);}, $result) 'log'=>array_map(function($data){return ConvertLog($data);}, $result)
]); ]);
} }
if($reqType == 'battleResult'){ if($reqType == 'battleResult'){
$result = getBattleResultMore($targetID, $reqTo, 30, $lastSeq); $result = getBattleResultMore($targetID, $reqTo, 30);
Json::die([ Json::die([
'result'=>true, 'result'=>true,
'reason'=>'success', 'reason'=>'success',
'sequence'=>$lastSeq,
'log'=>array_map(function($data){return ConvertLog($data);}, $result) 'log'=>array_map(function($data){return ConvertLog($data);}, $result)
]); ]);
} }
if($reqType == 'battleDetail'){ if($reqType == 'battleDetail'){
$result = getBattleDetailLogMore($targetID, $reqTo, 30, $lastSeq); $result = getBattleDetailLogMore($targetID, $reqTo, 30);
Json::die([ Json::die([
'result'=>true, 'result'=>true,
'reason'=>'success', 'reason'=>'success',
'sequence'=>$lastSeq,
'log'=>array_map(function($data){return ConvertLog($data);}, $result) 'log'=>array_map(function($data){return ConvertLog($data);}, $result)
]); ]);
} }
+6 -1
View File
@@ -26,7 +26,12 @@ function responseMessage(msgID, response){
response:response response:response
}) })
} }
}).then(refreshMsg); }).then(function(result){
if(result && !result.result){
alert(result.reason);
}
location.reload();
});
} }
function deleteMessage(msgID){ function deleteMessage(msgID){
+1 -1
View File
@@ -78,7 +78,7 @@ class che_등용 extends Command\GeneralCommand{
protected function initWithArg() protected function initWithArg()
{ {
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['nation'], 0); $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['nation', 'experience', 'dedication'], 0);
$this->setDestGeneral($destGeneral); $this->setDestGeneral($destGeneral);
[$reqGold, $reqRice] = $this->getCost(); [$reqGold, $reqRice] = $this->getCost();
@@ -83,14 +83,14 @@ class che_등용수락 extends Command\GeneralCommand{
protected function initWithArg() protected function initWithArg()
{ {
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['nation'], 0); $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], null, 2);
$this->setDestGeneral($destGeneral); $this->setDestGeneral($destGeneral);
$this->setDestNation($this->arg['destNationID'], ['gennum', 'scout']); $this->setDestNation($this->arg['destNationID'], ['gennum', 'scout']);
$relYear = $this->env['year'] - $this->env['startyear']; $relYear = $this->env['year'] - $this->env['startyear'];
$this->fullConditionConstraints=[ $this->fullConditionConstraints=[
ConstraintHelper::ReqEnvValue('join_mode', '==', 'onlyRandom', '랜덤 임관만 가능합니다'), ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다'),
ConstraintHelper::NotOpeningPart($relYear), ConstraintHelper::NotOpeningPart($relYear),
ConstraintHelper::ExistsDestNation(), ConstraintHelper::ExistsDestNation(),
ConstraintHelper::AllowJoinDestNation($relYear), ConstraintHelper::AllowJoinDestNation($relYear),
+3 -2
View File
@@ -49,7 +49,7 @@ class ScoutMessage extends Message{
return [self::INVALID, '올바른 수신자가 아닙니다.']; return [self::INVALID, '올바른 수신자가 아닙니다.'];
} }
return [self::ACCEPTED, '']; return [self::ACCEPTED, '성공'];
} }
/** /**
@@ -63,7 +63,7 @@ class ScoutMessage extends Message{
} }
$gameStor = KVStorage::getStorage(DB::db(), 'game_env'); $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(); $logger = $general->getLogger();
@@ -84,6 +84,7 @@ class ScoutMessage extends Message{
if(!$commandObj->hasFullConditionMet()){ if(!$commandObj->hasFullConditionMet()){
$logger->pushGeneralActionLog($commandObj->getFailString()); $logger->pushGeneralActionLog($commandObj->getFailString());
$reason = $commandObj->getFailString();
return self::DECLINED; return self::DECLINED;
} }