From 5c9cdd052478dc4ae678ca85b88fe2ba684f8fe3 Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 5 Oct 2018 21:49:53 +0900 Subject: [PATCH] =?UTF-8?q?getGeneralTurnBrief=20=EC=97=B0=EB=8F=99=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/b_currentCity.php | 4 +++- hwe/b_genList.php | 11 +++++------ hwe/commandlist.php | 14 ++++++++------ hwe/func_command.php | 1 + 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index 8178f829..29c513c5 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -286,7 +286,9 @@ for($j=0; $j < $gencount; $j++) { if($ourGeneral && !$isNPC){ $turnText = []; - foreach(getGeneralTurnBrief($general, 1) as $turnRawIdx=>$turn){ + $generalObj = new General($general, null, 0, 0, false); + $turnBrief = getGeneralTurnBrief($genralObj, $generalTurnList[$generalObj->getID()]); + foreach($turnBrief as $turnRawIdx=>$turn){ $turnIdx = $turnRawIdx+1; $turnText[] = "{$turnIdx} : $turn"; } diff --git a/hwe/b_genList.php b/hwe/b_genList.php index ddf7e955..555499bc 100644 --- a/hwe/b_genList.php +++ b/hwe/b_genList.php @@ -175,14 +175,13 @@ foreach ($generals as &$general) { if ($general['npc'] < 2) { $generalObj = new General($general, null, 0, 0, false); - $turnBrief = getGeneralTurnBrief($genralObj, $generalTurnList[$general['no']]); + $turnBrief = getGeneralTurnBrief($genralObj, $generalTurnList[$generalObj->getID()]); $turntext = []; - $turn = getGeneralTurnBrief($general, 1, 0); - foreach($turnBrief as $turnIdx=>$text) { - $text = StringUtil::subStringForWidth($text, 0, 41); - $printIdx = $turnIdx+1; - $turntext[] = " $printIdx : $text"; + foreach($turnBrief as $turnRawIdx=>$turn){ + $turn = StringUtil::subStringForWidth($turn, 0, 41); + $turnIdx = $turnRawIdx+1; + $turntext[] = " $turnIdx : $turn"; } $general['turntext'] = join("
\n", $turntext); } diff --git a/hwe/commandlist.php b/hwe/commandlist.php index 01b2e978..666cccab 100644 --- a/hwe/commandlist.php +++ b/hwe/commandlist.php @@ -83,7 +83,9 @@ function myCommandList() { echo "로그인 되어있지 않습니다."; return; } - $turn = getGeneralTurnBrief($me, 2); + $generalObj = new General($me, null, 1, 1, false); + $turnList = $db->query('SELECT turn_idx, action, arg FROM general_turn WHERE general_id = %i ORDER BY turn_idx ASC', $generalObj->getID()); + $turnBrief = getGeneralTurnBrief($generalObj, $turnList); echo " @@ -99,19 +101,19 @@ function myCommandList() { $totaldate = $me['turntime']; - for($i=0; $i < 24; $i++) { + foreach($turnBrief as $rawTurnIdx => $turn) { if($month == 13) { $month = 1; $year++; } - $j = $i + 1; + $turnIdx = $rawTurnIdx + 1; $turndate = substr($totaldate,11, 5); echo " - - + + - + "; $month++; $totaldate = addTurn($totaldate, $admin['turnterm']); diff --git a/hwe/func_command.php b/hwe/func_command.php index 74644aa6..94bbc2ea 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -12,6 +12,7 @@ function getGeneralTurnBrief(General $generalObj, array $turnList) { } return $result; + //TODO: 정리가 끝나면 삭제 $turn = []; $turn[0] = $general["turn0"];
$j{$year}年 {$month}月$turnIdx{$year}年 {$month}月 $turndate$turn[$i]{$turn}