diff --git a/hwe/j_msg_get_old.php b/hwe/j_msg_get_old.php index 0c7b6d54..19439110 100644 --- a/hwe/j_msg_get_old.php +++ b/hwe/j_msg_get_old.php @@ -16,7 +16,7 @@ if($reqTo === null){ 'reason'=>'올바르지 않은 범위 입니다.' ]); } -if($reqType === null || !in_array($reqType, ['private', 'public', 'national'])){ +if($reqType === null || !in_array($reqType, ['private', 'public', 'national', 'diplomacy'])){ Json::die([ 'result'=>false, 'reason'=>'올바르지 않은 타입입니다.' @@ -95,13 +95,21 @@ else if($reqType == 'public'){ return $msg->toArray(); }, Message::getMessagesFromMailBoxOld(Message::MAILBOX_PUBLIC, Message::MSGTYPE_PUBLIC, $reqTo, 20)); } -else{ +else if($reqType == 'national'){ $result['national'] = array_map(function(Message $msg)use (&$nextSequence){ if($msg->id > $nextSequence){ $nextSequence = $msg->id; } return $msg->toArray(); - }, Message::getMessagesFromMailBoxOld(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_NATIONAL, $reqTo, 40)); + }, Message::getMessagesFromMailBoxOld(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_NATIONAL, $reqTo, 20)); +} +else{ + $result['diplomacy'] = array_map(function(Message $msg)use (&$nextSequence){ + if($msg->id > $nextSequence){ + $nextSequence = $msg->id; + } + return $msg->toArray(); + }, Message::getMessagesFromMailBoxOld(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_DIPLOMACY, $reqTo, 20)); } Json::die($result); \ No newline at end of file diff --git a/hwe/js/msg.js b/hwe/js/msg.js index cdf1c456..cf212e38 100644 --- a/hwe/js/msg.js +++ b/hwe/js/msg.js @@ -29,6 +29,7 @@ var minMsgSeq = { 'private':0x7fffffff, 'public':0x7fffffff, 'national':0x7fffffff, + 'diplomacy':0x7fffffff, } var generalList = {}; diff --git a/hwe/sammo/Message.php b/hwe/sammo/Message.php index 35c85666..a315001c 100644 --- a/hwe/sammo/Message.php +++ b/hwe/sammo/Message.php @@ -366,6 +366,9 @@ class Message if($this->msgType === self::MSGTYPE_NATIONAL && $this->src->nationID !== $this->dest->nationID){ return $this->sendRaw($this->src->nationID + self::MAILBOX_NATIONAL); } + if($this->msgType === self::MSGTYPE_DIPLOMACY && !key_exists('action', $this->msgOption)){ + return $this->sendRaw($this->src->nationID + self::MAILBOX_NATIONAL); + } return [0, 0]; }