forked from devsam/core
이전 외교 메시지를 불러 올 수 있음
This commit is contained in:
+11
-3
@@ -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);
|
||||
@@ -29,6 +29,7 @@ var minMsgSeq = {
|
||||
'private':0x7fffffff,
|
||||
'public':0x7fffffff,
|
||||
'national':0x7fffffff,
|
||||
'diplomacy':0x7fffffff,
|
||||
}
|
||||
|
||||
var generalList = {};
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user