From 6a100ed2c12e190e361428e12eefc611f7010ab8 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 15 Apr 2018 23:41:36 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B5=AD=EA=B0=80=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EB=B0=98=ED=99=98=EC=8B=9C=200=EC=9D=B8=20=EA=B2=BD=EC=9A=B0?= =?UTF-8?q?=EC=97=90=20=ED=95=9C=ED=95=B4=20=EC=9E=AC=EC=95=BC=EB=8F=84=20?= =?UTF-8?q?=EB=B0=98=ED=99=98.=20-=20=EC=9E=AC=EC=95=BC=EC=9D=98=20?= =?UTF-8?q?=EC=83=89=EC=9D=84=20#000000=20=EC=9C=BC=EB=A1=9C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_bestGeneral.php | 16 ++++++++-------- hwe/func.php | 31 +++++++++++++++++++++---------- hwe/sammo/Scenario.php | 2 +- hwe/sammo/Scenario/NPC.php | 2 +- hwe/sammo/Scenario/Nation.php | 2 +- tmp_msg/msg.js | 8 ++------ tmp_msg/sender_list.json | 2 +- 7 files changed, 35 insertions(+), 28 deletions(-) diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index 2e019a11..ea9428a3 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -63,8 +63,8 @@ if (isset($btn) && $btn == "NPC 보기") { $sel = "npc<2"; } -$nationName = []; -$nationColor = []; +$nationName = ['재야']; +$nationColor = ['#000000']; foreach (getAllNationStaticInfo() as $nation) { $nationName[$nation['nation']] = $nation['name']; $nationColor[$nation['nation']] = $nation['color']; @@ -137,9 +137,9 @@ for ($i=0; $i < 21; $i++) { if ($i != 2) { if (isset($gen)) { $name[$k] = $gen['name']; - $nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']]; + $nation[$k] = $nationName[$gen['nation']]; $data[$k] = $gen['data']; - $color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']]; + $color[$k] = $nationColor[$gen['nation']]; $pic[$k] = $gen['picture']; } else { $name[$k] = "-"; @@ -248,8 +248,8 @@ for ($i=0; $i < 4; $i++) { $gen = MYDB_fetch_array($result); if (isset($gen)) { $name[$k] = $gen['name']; - $nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']]; - $color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']]; + $nation[$k] = $nationName[$gen['nation']]; + $color[$k] = $nationColor[$gen['nation']]; $pic[$k] = $gen['picture']; } else { $name[$k] = "미발견"; @@ -300,8 +300,8 @@ for ($i=0; $i < 4; $i++) { $gen = MYDB_fetch_array($result); if (isset($gen)) { $name[$k] = $gen['name']; - $nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']]; - $color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']]; + $nation[$k] = $nationName[$gen['nation']]; + $color[$k] = $nationColor[$gen['nation']]; $pic[$k] = $gen['picture']; } else { $name[$k] = "미발견"; diff --git a/hwe/func.php b/hwe/func.php index 4f137c57..f0d786b3 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -24,7 +24,7 @@ require_once('func_command.php'); /** * nationID를 이용하여 국가의 '어지간해선' 변경되지 않는 정보(이름, 색, 성향, 규모, 수도)를 반환해줌 * - * @param int|null $nationID 국가 코드, -1인 경우 전체, null인 경우 수행하지 않음 + * @param int|null $nationID 국가 코드, -1인 경우 전체, null인 경우 수행하지 않음. 0인 경우에는 재야임 * @param bool $forceRefresh 강제 갱신 여부 * * @return array|null nationID에 해당하는 국가가 있을 경우 array 반환. 그외의 경우 null @@ -32,13 +32,24 @@ require_once('func_command.php'); function getNationStaticInfo($nationID, $forceRefresh=false) { static $nationList = null; + static $freeNation = [ + 'nation'=>0, + 'name'=>'재야', + 'color'=>'#000000', + 'type'=>0, + 'level'=>0, + 'capital'=>0 + ]; if ($forceRefresh) { $nationList = null; } - if($nationID === null || $nationID == 0){ - return null; + if ($nationID === null) { + return null; + } + if($nationID === 0){ + return $freeNation; } if($nationList === null){ @@ -67,11 +78,11 @@ function getAllNationStaticInfo(){ return getNationStaticInfo(-1); } -function GetImageURL($imgsvr) { +function GetImageURL($imgsvr, $filepath='') { if($imgsvr == 0) { - return ServConfig::$sharedIconPath; + return ServConfig::getSharedIconPath($filepath); } else { - return AppConf::getUserIconPathWeb(); + return AppConf::getUserIconPathWeb($filepath); } } @@ -158,6 +169,10 @@ function cityInfo() { $tradeStr = $city['trade'] . "%"; } + if(!$nation){ + $nation = getNationStaticInfo(0); + } + if($nation['color'] == "" ) { $nation['color'] = "#000000"; } echo " @@ -2211,10 +2226,6 @@ function uniqueItem($general, $log, $vote=0) { $nation = getNationStaticInfo($general['nation']); - if($nation === null) { - $nation = ['name' => "재야"]; - } - switch($sel) { case 0: $log[] = "".getWeapName($it)."(을)를 습득했습니다!"; diff --git a/hwe/sammo/Scenario.php b/hwe/sammo/Scenario.php index 1b9cf321..77bd7283 100644 --- a/hwe/sammo/Scenario.php +++ b/hwe/sammo/Scenario.php @@ -35,7 +35,7 @@ class Scenario{ $data = $this->data; $this->nations = []; - $this->nations[0] = new Scenario\Nation(0, '재야', '#ffffff', 0, 0); + $this->nations[0] = new Scenario\Nation(0, '재야', '#000000', 0, 0); foreach (Util::array_get($data['nation'],[]) as $idx=>$rawNation) { list($name, $color, $gold, $rice, $infoText, $tech, $type, $nationLevel, $cities) = $rawNation; $nationID = $idx+1; diff --git a/hwe/sammo/Scenario/NPC.php b/hwe/sammo/Scenario/NPC.php index 948c8909..0ef471e5 100644 --- a/hwe/sammo/Scenario/NPC.php +++ b/hwe/sammo/Scenario/NPC.php @@ -84,7 +84,7 @@ class NPC{ $db = DB::db(); - if($age == \sammo\GameConst::$adultAge && $month == 1){//FIXME: 14가 어디서 튀어나왔나? + if($age == \sammo\GameConst::$adultAge && $month == 1){ \sammo\pushWorldHistory(["●1월:$name(이)가 성인이 되어 등장했습니다."], $year, $month); } diff --git a/hwe/sammo/Scenario/Nation.php b/hwe/sammo/Scenario/Nation.php index 10616141..e6d4eff2 100644 --- a/hwe/sammo/Scenario/Nation.php +++ b/hwe/sammo/Scenario/Nation.php @@ -22,7 +22,7 @@ class Nation{ public function __construct( int $id = null, string $name = '국가', - string $color = '#ffffff', + string $color = '#000000', int $gold = 0, int $rice = 2000, string $infoText = '국가 설명', diff --git a/tmp_msg/msg.js b/tmp_msg/msg.js index 8893da5e..9cea74b8 100644 --- a/tmp_msg/msg.js +++ b/tmp_msg/msg.js @@ -82,12 +82,12 @@ function redrawMsg(deferred){ var msg = this; if(!msg.src.nation){ msg.src.nation = '재야'; - msg.src.color = '#ffffff'; + msg.src.color = '#000000'; } if(!msg.dest.nation){ msg.dest.nation = '재야'; - msg.dest.color = '#ffffff'; + msg.dest.color = '#000000'; } msg.src.colorType = isBrightColor(msg.src.color)?'bright':'dark'; @@ -186,10 +186,6 @@ function redrawMsg(deferred){ .then(registerSequence) .then(refineMessageObjs) .then(printTemplate); - - - - } function refreshMailboxList(obj){ diff --git a/tmp_msg/sender_list.json b/tmp_msg/sender_list.json index 51952691..5dfa5ab9 100644 --- a/tmp_msg/sender_list.json +++ b/tmp_msg/sender_list.json @@ -4,7 +4,7 @@ "nationID":0, "mailbox":9000, "nation":"재야", - "color":"#ffffff", + "color":"#000000", "general":[ [31, "Hide_Dy"] ]
【 ".CityConst::$regionMap[$city['region']]." | ".CityConst::$levelMap[$city['level']]." 】 {$city['name']}