diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index 770aad53..46228962 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -148,8 +148,30 @@ echo " unset($city); // 첩보된 도시까지만 허용 -if($valid == 0 && $userGrade < 5) { + +$showDetailedInfo = false; +if($valid){ + $showDetailedInfo = true; +} + +if(!key_exists($citylist, CityConst::all())){ $citylist = $me['city']; + $showDetailedInfo = true; + $valid = 1; +} + +if($userGrade >= 5){ + $valid = true; +} + +if(!$valid) { + $ownCities = Util::convertArrayToSetLike($db->queryFirstColumn('SELECT city FROM city WHERE nation = %i AND nation != 0', $me['nation'])); + foreach(array_keys(CityConst::byID($citylist)->path) as $pathID){ + if(key_exists($pathID, $ownCities)){ + $showDetailedInfo = true; + break; + } + } } @@ -172,11 +194,35 @@ if($city['trade'] === null) { } $dbColumns = General::mergeQueryColumn(['npc', 'defence_train', 'no', 'picture', 'imgsvr', 'name', 'injury', 'leadership', 'strength', 'intel', 'officer_level', 'nation', 'crewtype', 'crew', 'train', 'atmos'], 2)[0]; -$generals = $db->query( - 'SELECT %l from general where city=%i order by name', - Util::formatListOfBackticks($dbColumns), - $city['city'] -); +if($showDetailedInfo){ + $generals = $db->query( + 'SELECT %l from general where city=%i order by name', + Util::formatListOfBackticks($dbColumns), + $city['city'] + ); +} +else{ + $generals = []; +} + +if($valid){ + $city['trustText'] = round($city['trust'], 1); + $city['popRateText'] = round($city['pop']/$city['pop_max']*100, 2); +} +else{ + $city['agri'] = '?'; + $city['comm'] = '?'; + $city['pop'] = '?'; + $city['secu'] = '?'; + $city['trustText'] = '?'; + $city['popRateText'] = '?'; + + if($city['nation'] != 0){ + $city['def'] = '?'; + $city['wall'] = '?'; + } +} + $generalTurnList = []; @@ -257,6 +303,10 @@ foreach($generals as $general){ $crew = $general['crew']; $train = -1; $atmos = -1; + + if(!$valid){ + $crew = -1; + } } $nation = $general['nation']; @@ -331,7 +381,9 @@ foreach($generalsFormat as $general){ } if($general['nation'] != $myNation['nation']){ $enemyCnt += 1; - $enemyCrew += $general['crew']; + if($general['crew'] >= 0){ + $enemyCrew += $general['crew']; + } if($general['crew'] > 0){ $enemyArmedCnt += 1; } @@ -402,11 +454,11 @@ foreach($generalsFormat as $general){
| =backButton()?> | |||||||||||||||||||
| =banner()?> | |||||||||||||||||||
| =$nameText?> | -=$leadershipText?>=$leadershipBonusText?> | -=$strengthText?> | -=$intelText?> | -=$officerLevelText?> | - -=$defenceTrainText?> | -=$crewTypeText?> | -=$crew?> | -=$train?> | -=$atmos?> | - -NPC 장수 | - -=$turnText?> | - - -? | -? | -=$crew?> | -? | -? | - -【=$nationName?>】 장수 | - -재 야 | - - - +|
| =$nameText?> | +=$leadershipText?>=$leadershipBonusText?> | +=$strengthText?> | +=$intelText?> | +=$officerLevelText?> | + +=$defenceTrainText?> | +=$crewTypeText?> | +=$crew?> | +=$train?> | +=$atmos?> | + +NPC 장수 | + +=$turnText?> | + + +? | +? | +=$crew>=0?$crew:'?'?> | +? | +? | + +【=$nationName?>】 장수 | + +재 야 | + + +