국가 정보 반환시 0인 경우에 한해 재야도 반환.

- 재야의 색을 #000000 으로 설정
This commit is contained in:
2018-04-15 23:41:36 +09:00
parent 5a6cd7fb46
commit 6a100ed2c1
7 changed files with 35 additions and 28 deletions
+21 -10
View File
@@ -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 "<table width=640 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
<tr><td colspan=8 align=center style=height:20;color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>【 ".CityConst::$regionMap[$city['region']]." | ".CityConst::$levelMap[$city['level']]."{$city['name']}</td></tr>
@@ -2211,10 +2226,6 @@ function uniqueItem($general, $log, $vote=0) {
$nation = getNationStaticInfo($general['nation']);
if($nation === null) {
$nation = ['name' => "재야"];
}
switch($sel) {
case 0:
$log[] = "<C>●</><C>".getWeapName($it)."</>(을)를 습득했습니다!";