From 191226289d144b546119a05167e4b30f60d26a5d Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 9 Feb 2018 02:10:38 +0900 Subject: [PATCH] =?UTF-8?q?message=20=ED=81=B4=EB=9E=98=EC=8A=A4=EB=8A=94?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD=ED=95=9C=20table=20=EA=B5=AC=EC=A1=B0?= =?UTF-8?q?=EC=97=90=20=EB=A7=9E=EA=B2=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/func_message.php | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/twe/func_message.php b/twe/func_message.php index 1da51233..0ab9f038 100644 --- a/twe/func_message.php +++ b/twe/func_message.php @@ -13,20 +13,16 @@ class Message{ public $src; public $dest; public $time; - public $message; + public $text; + public $option; function __construct($row){ + $db_message = $row['message']; $this->id = $row['id']; $this->mailbox = $row['mailbox']; $this->type = $row['type']; $this->isSender = $row['is_sender'] != 0; - $this->src = [ - 'id' => $row['src'], - 'name' => $row['src_name'], - 'nation' => $row['src_nation'], - 'color' => $row['src_color'], - 'nation_id' => $row['src_nation_id'] - ]; + $this->src = $db_message['src']; if($this->src['nation'] === null){ $this->src['nation'] = '재야'; @@ -34,13 +30,7 @@ class Message{ $this->src['nation_id'] = null; } - $this->dest = [ - 'id' => $row['dest'], - 'name' => $row['dest_name'], - 'nation' => $row['dest_nation'], - 'color' => $row['dest_color'], - 'nation_id' => $row['dest_nation_id'] - ]; + $this->dest = $db_message['dest']; if($this->dest['nation'] === null){ $this->dest['nation'] = '재야'; @@ -49,7 +39,8 @@ class Message{ } $this->datetime = $row['time']; - $this->message = $row['message']; + $this->text = $db_message['text']; + $this->option = $db_message['option']; } } @@ -145,6 +136,9 @@ function sendMessage($msgType, $src, $dest, $msg, $date = null, $msgOption = nul } $destMailbox = $dest['nation_id'] + 9000; } + else if($msgType === 'deplomacy'){ + $dest['id'] = $dest['nation_id'] + 8000; + } else{ //dest는 id, name이 필수 $srcMailbox = $src['id'];