등용장 메시지 송신이 이상한 문제 해결.

인사부 '공석' 지정 가능
This commit is contained in:
2018-04-28 20:49:38 +09:00
parent 5262d424b4
commit 170a32a1bd
2 changed files with 16 additions and 13 deletions
+11 -8
View File
@@ -41,17 +41,20 @@ if($meLevel < 5){
if($btn == "임명") { if($btn == "임명") {
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'"; if($genlist !== 0){
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
$general = MYDB_fetch_array($result); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if(!$general){ if(!$general){
header('location:b_myBossInfo.php'); header('location:b_myBossInfo.php');
exit(); exit();
}
} }
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함 //임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0)) { if($meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0) || ($general['level'] == 12 && $genlist != 0)) {
header('location:b_myBossInfo.php'); header('location:b_myBossInfo.php');
exit(); exit();
@@ -74,7 +77,7 @@ if($btn == "임명") {
} }
//나와 대상 장수는 국가가 같아야 함 //나와 대상 장수는 국가가 같아야 함
if($me['nation'] != $general['nation']){ if($genlist != 0 && $me['nation'] != $general['nation']){
header('location:b_myBossInfo.php'); header('location:b_myBossInfo.php');
exit(); exit();
} }
+5 -5
View File
@@ -72,7 +72,7 @@ class ScoutMessage extends Message{
return $result; return $result;
} }
$helper = new Engine\Personnel($this->src->nationID, $this->src->senderID); $helper = new Engine\Personnel($this->src->nationID, $this->src->generalID);
list($result, $reason) = $helper->scoutGeneral($receiverID); list($result, $reason) = $helper->scoutGeneral($receiverID);
@@ -116,9 +116,9 @@ class ScoutMessage extends Message{
"{$this->src->nationName}(으)로 등용 제의 수락", "{$this->src->nationName}(으)로 등용 제의 수락",
new \DateTime(), new \DateTime(),
new \DateTime('9999-12-31'), new \DateTime('9999-12-31'),
Json::encode([ [
'delete'=>$this->id 'delete'=>$this->id
]) ]
); );
$newMsg->send(true); $newMsg->send(true);
@@ -137,9 +137,9 @@ class ScoutMessage extends Message{
"{$this->src->nationName}(으)로 등용 제의 거부", "{$this->src->nationName}(으)로 등용 제의 거부",
new \DateTime(), new \DateTime(),
new \DateTime('9999-12-31'), new \DateTime('9999-12-31'),
Json::encode([ [
'delete'=>$this->id 'delete'=>$this->id
]) ]
); );
$newMsg->send(true); $newMsg->send(true);