외교 서신, 등용장 수락시 올바르지 않을 경우 alert
건국 시 장수 이름과 같아도 건국 가능하도록 변경
This commit is contained in:
@@ -568,7 +568,7 @@ function process_46(&$general) {
|
|||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$gencount = MYDB_num_rows($result);
|
$gencount = MYDB_num_rows($result);
|
||||||
|
|
||||||
$query = "select nation from nation where name='{$general['makenation']}'";
|
$query = "select nation from nation where nation!={$general['nation']} AND name='{$general['makenation']}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$nationcount = MYDB_num_rows($result);
|
$nationcount = MYDB_num_rows($result);
|
||||||
|
|
||||||
|
|||||||
@@ -44,16 +44,16 @@ if($msg === null){
|
|||||||
'reason'=>'올바르지 않은 메시지'
|
'reason'=>'올바르지 않은 메시지'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
$reason = 'success';
|
||||||
if($msgResponse){
|
if($msgResponse){
|
||||||
$result = $msg->agreeMessage($general['no']);
|
$result = $msg->agreeMessage($general['no'], $reason);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$result = $msg->declineMessage($general['no']);
|
$result = $msg->declineMessage($general['no'], $reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Json::die([
|
Json::die([
|
||||||
'result' => $result===DiplomaticMessage::ACCEPTED,
|
'result' => $result===DiplomaticMessage::ACCEPTED,
|
||||||
'reason' => 'result'
|
'reason' => $reason
|
||||||
]);
|
]);
|
||||||
+4
-1
@@ -42,7 +42,10 @@ function responseMessage(msgID, response){
|
|||||||
}).then(refreshMsg);
|
}).then(refreshMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshMsg(){
|
function refreshMsg(result){
|
||||||
|
if(!result.result){
|
||||||
|
alert(result.reason);
|
||||||
|
}
|
||||||
return redrawMsg(fetchMsg());
|
return redrawMsg(fetchMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ class DiplomaticMessage extends Message{
|
|||||||
/**
|
/**
|
||||||
* @return int 수행 결과 반환, ACCEPTED(등용장 소모), DECLINED(등용장 소모), INVALID 중 반환
|
* @return int 수행 결과 반환, ACCEPTED(등용장 소모), DECLINED(등용장 소모), INVALID 중 반환
|
||||||
*/
|
*/
|
||||||
public function agreeMessage(int $receiverID):int{
|
public function agreeMessage(int $receiverID, string &$reason):int{
|
||||||
//NOTE: 올바른 유저가 agreeMessage() 호출을 한건지는 외부에서 체크 필요(Session->userID 등)
|
//NOTE: 올바른 유저가 agreeMessage() 호출을 한건지는 외부에서 체크 필요(Session->userID 등)
|
||||||
|
|
||||||
if(!$this->id){
|
if(!$this->id){
|
||||||
@@ -318,7 +318,7 @@ class DiplomaticMessage extends Message{
|
|||||||
return self::DECLINED;
|
return self::DECLINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function declineMessage(int $receiverID):int{
|
public function declineMessage(int $receiverID, string &$reason):int{
|
||||||
if(!$this->id){
|
if(!$this->id){
|
||||||
throw \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
|
throw \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class ScoutMessage extends Message{
|
|||||||
/**
|
/**
|
||||||
* @return int 수행 결과 반환, ACCEPTED(등용장 소모), DECLINED(등용장 소모), INVALID 중 반환
|
* @return int 수행 결과 반환, ACCEPTED(등용장 소모), DECLINED(등용장 소모), INVALID 중 반환
|
||||||
*/
|
*/
|
||||||
public function agreeMessage(int $receiverID):int{
|
public function agreeMessage(int $receiverID, string &$reason):int{
|
||||||
//NOTE: 올바른 유저가 agreeMessage() 호출을 한건지는 외부에서 체크 필요(Session->userID 등)
|
//NOTE: 올바른 유저가 agreeMessage() 호출을 한건지는 외부에서 체크 필요(Session->userID 등)
|
||||||
|
|
||||||
if(!$this->id){
|
if(!$this->id){
|
||||||
@@ -146,7 +146,7 @@ class ScoutMessage extends Message{
|
|||||||
return self::DECLINED;
|
return self::DECLINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function declineMessage(int $receiverID):int{
|
public function declineMessage(int $receiverID, string &$reason):int{
|
||||||
if(!$this->id){
|
if(!$this->id){
|
||||||
throw \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
|
throw \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user