From 7af3c6e91abbcd611820170ebe55930e387704ec Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 1 Mar 2018 04:30:24 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=88=EB=A9=94=EC=8B=9C=EC=A7=80,=20contact?= =?UTF-8?q?=5Flist=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmp_msg/sender_list.json | 2 +- twe/j_msg_contact_list.php | 55 ++++++++++++++++++++++++++++++++++++++ twe/j_msgselect.php | 2 -- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 twe/j_msg_contact_list.php delete mode 100644 twe/j_msgselect.php diff --git a/tmp_msg/sender_list.json b/tmp_msg/sender_list.json index 5dfa5ab9..51952691 100644 --- a/tmp_msg/sender_list.json +++ b/tmp_msg/sender_list.json @@ -4,7 +4,7 @@ "nationID":0, "mailbox":9000, "nation":"재야", - "color":"#000000", + "color":"#ffffff", "general":[ [31, "Hide_Dy"] ] diff --git a/twe/j_msg_contact_list.php b/twe/j_msg_contact_list.php new file mode 100644 index 00000000..20a34126 --- /dev/null +++ b/twe/j_msg_contact_list.php @@ -0,0 +1,55 @@ +query('select `no`, `name`, `nation`, `level`, `npc` from `general` where `npc` < 2') as $general) +{ + list($generalID, $generalName, $nationID, $level, $npc) = $general; + if(!isset($generalNations[$nationID])){ + $generalNations[$nationID] = []; + } + + $isChief = ($level == 12); + + $obj = [$generalID, $generalName]; + if($isChief){ + $obj[] = 1; + } + + //TODO: 빙의장 정보 추가 + $generalNations[$nationID][] = $obj; +} + +$neutral = [ + "nation"=>0, + "name"=>"재야", + "color"=>"#ffffff" +]; + +$result = array_map(function($nation){ + $nationID = $nation['nation']; + $mailbox = $nationID + 9000; + $nation = $nation['name']; + $color = ('#'.$nation['color']).replace('##','#');//xxx: #기호 없는 이전 코드 대비용 + $generals = util::array_get($generalNations[$nationID], []); + + return [ + "nationID"=>$nationID, + "mailbox"=>$mailbox, + "nation"=>$nationID, + "color"=>$color, + "general"=>$generals + ]; +}, array_merge([$neutral], getAllNationStaticInfo())); + +returnJson([ + "nation"=>$result +]); \ No newline at end of file diff --git a/twe/j_msgselect.php b/twe/j_msgselect.php deleted file mode 100644 index 2462a743..00000000 --- a/twe/j_msgselect.php +++ /dev/null @@ -1,2 +0,0 @@ -