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 "
| 【 ".CityConst::$regionMap[$city['region']]." | ".CityConst::$levelMap[$city['level']]." 】 {$city['name']} |