From 427532f0a5cdd5012fe91f2ae72c926538a70f81 Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 2 Apr 2018 02:05:50 +0900 Subject: [PATCH] =?UTF-8?q?supply=EC=97=90=EC=84=9C=20reference=EB=A1=9C?= =?UTF-8?q?=20=EC=B0=B8=EC=A1=B0=ED=95=B4=EC=95=BC=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EA=B2=83=EC=9D=84=20value=EB=A1=9C=20=EC=B0=B8=EC=A1=B0?= =?UTF-8?q?=ED=95=9C=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/_admin2.php | 1 - hwe/func_gamerule.php | 12 ++++++++---- hwe/func_time_event.php | 12 ++++++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/hwe/_admin2.php b/hwe/_admin2.php index 5d39ba8f..6ba1c34a 100644 --- a/hwe/_admin2.php +++ b/hwe/_admin2.php @@ -74,7 +74,6 @@ for($i=0; $i < $gencount; $i++) { if($general['block'] > 0) { $style .= "background-color:red;"; } if($general['npc'] >= 2) { $style .= "color:cyan;"; } elseif($general['npc'] == 1) { $style .= "color:skyblue;"; } - if($general['con'] > $admin['conlimit']) { $style .= "color:red;"; } echo " "; diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index 268bb024..98fc309c 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -250,22 +250,26 @@ function checkSupply($connect) { $queue = new \SplQueue(); foreach(getAllNationStaticInfo() as $nation){ - $queue->enqueue($cities[$nation['capital']]); + $city = $cities[$nation['capital']]; + $city['supply'] = true; + $queue->enqueue($city); } while(!$queue->isEmpty()){ $city = $queue->dequeue(); - $city['supply'] = true; - foreach(array_keys(CityConst::byID($city['id'])->path) as $connCityID){ - $connCity = $cities[$connCityID]; + if(!key_exists($connCityID, $cities)){ + continue; + } + $connCity = &$cities[$connCityID]; if($connCity['nation'] != $city['nation']){ continue; } if($connCity['supply']){ continue; } + $connCity['supply'] = true; $queue->enqueue($connCity); } } diff --git a/hwe/func_time_event.php b/hwe/func_time_event.php index 6cfa2985..24309939 100644 --- a/hwe/func_time_event.php +++ b/hwe/func_time_event.php @@ -374,7 +374,7 @@ function processRiceIncome($connect) { // 실지급율 $ratio = $realoutcome / $originoutcome; } - $adminLog[count($adminLog)] = StringUtil::Fill2($nation['name'],12," ")." // 세곡 : ".StringUtil::Fill2($income,6," ")." // 세출 : ".StringUtil::Fill2($originoutcome,6," ")." // 실제 : ".tab2($realoutcome,6," ")." // 지급율 : ".tab2(round($ratio*100,2),5," ")." % // 결과곡 : ".tab2($nation['rice'],6," "); + $adminLog[] = StringUtil::Fill2($nation['name'],12," ")." // 세곡 : ".StringUtil::Fill2($income,6," ")." // 세출 : ".StringUtil::Fill2($originoutcome,6," ")." // 실제 : ".tab2($realoutcome,6," ")." // 지급율 : ".tab2(round($ratio*100,2),5," ")." % // 결과곡 : ".tab2($nation['rice'],6," "); $query = "select no,name,nation from general where nation='{$nation['nation']}' and level>='9'"; $coreresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -412,6 +412,10 @@ function processRiceIncome($connect) { } function getRiceIncome($connect, $nationNo, $rate, $admin_rate, $type) { + $level2 = []; + $level3 = []; + $level4 = []; + $query = "select no,city from general where nation='$nationNo' and level=4"; // 태수 $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $count = MYDB_num_rows($result); @@ -452,9 +456,9 @@ function getRiceIncome($connect, $nationNo, $rate, $admin_rate, $type) { $tax1 *= (1 + $city['secu']/$city['secu2']/10); //치안에 따라 최대 10% 추가 $tax2 *= (1 + $city['secu']/$city['secu2']/10); //치안에 따라 최대 10% 추가 //도시 관직 추가 세수 - if($level4[$city['gen1']] == $city['city']) { $tax1 *= 1.05; $tax2 *= 1.05; } - if($level3[$city['gen2']] == $city['city']) { $tax1 *= 1.05; $tax2 *= 1.05; } - if($level2[$city['gen3']] == $city['city']) { $tax1 *= 1.05; $tax2 *= 1.05; } + if(Util::array_get($level4[$city['gen1']]) == $city['city']) { $tax1 *= 1.05; $tax2 *= 1.05; } + if(Util::array_get($level3[$city['gen2']]) == $city['city']) { $tax1 *= 1.05; $tax2 *= 1.05; } + if(Util::array_get($level2[$city['gen3']]) == $city['city']) { $tax1 *= 1.05; $tax2 *= 1.05; } //수도 추가 세수 130%~105% if($city['city'] == $nation['capital']) { $tax1 *= 1+(1/3/$nation['level']); $tax2 *= 1+(1/3/$nation['level']); } $income[0] += $tax1;