From 8ede84c17696e924b01a29354a5d314ecc64a688 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 12 Dec 2021 19:26:27 +0900 Subject: [PATCH] =?UTF-8?q?build(WIP):=20printDist=EB=A5=BC=20=EB=AA=A8?= =?UTF-8?q?=EB=93=A0=20=EC=BD=94=EB=93=9C=EC=97=90=20=EC=A0=81=EC=9A=A9=20?= =?UTF-8?q?-=20=ED=98=84=EC=9E=AC=20summernote=20=EB=AF=B8=EC=9E=91?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- f_install/install.php | 14 +- hwe/_119.php | 2 +- hwe/_admin1.php | 2 +- hwe/_admin2.php | 2 +- hwe/_admin4.php | 23 +- hwe/_admin5.php | 8 +- hwe/_admin7.php | 2 +- hwe/_admin8.php | 152 ++-- hwe/a_bestGeneral.php | 5 +- hwe/a_emperior.php | 5 +- hwe/a_emperior_detail.php | 359 ++++---- hwe/a_genList.php | 5 +- hwe/a_hallOfFame.php | 5 +- hwe/a_history.php | 6 +- hwe/a_kingdomList.php | 6 +- hwe/a_npcList.php | 6 +- hwe/a_status.php | 15 +- hwe/a_traffic.php | 7 +- hwe/a_vote.php | 7 +- hwe/b_auction.php | 5 +- hwe/b_battleCenter.php | 5 +- hwe/b_betting.php | 5 +- hwe/b_chiefcenter.php | 5 +- hwe/b_currentCity.php | 5 +- hwe/b_dipcenter.php | 8 +- hwe/b_diplomacy.php | 15 +- hwe/b_genList.php | 5 +- hwe/b_myBossInfo.php | 6 +- hwe/b_myCityInfo.php | 6 +- hwe/b_myGenInfo.php | 6 +- hwe/b_myKingdomInfo.php | 6 +- hwe/b_myPage.php | 8 +- hwe/b_processing.php | 7 +- hwe/b_tournament.php | 793 ++++++++++-------- hwe/b_troop.php | 11 +- hwe/battle_simulator.php | 5 +- hwe/func_legacy.php | 135 +-- hwe/func_template.php | 79 +- hwe/install.php | 5 +- hwe/install_db.php | 5 +- hwe/recent_map.php | 5 +- .../dipcenter.css => scss/dipcenter.scss} | 4 +- hwe/select_general_from_pool.php | 8 +- hwe/select_npc.php | 6 +- hwe/t_diplomacy.php | 5 +- hwe/ts/dipcenter.ts | 7 +- hwe/ts/summernote-image-flip.ts | 2 +- hwe/v_NPCControl.php | 7 +- hwe/v_board.php | 6 +- hwe/v_inheritPoint.php | 6 +- hwe/v_join.php | 7 +- i_entrance/admin_userlist.php | 7 +- i_entrance/entrance.php | 13 +- i_entrance/user_info.php | 7 +- index.php | 8 +- oauth_kakao/join.php | 6 +- showErrorLog.php | 5 +- src/sammo/WebUtil.php | 46 +- webpack.config.cjs | 4 +- 59 files changed, 961 insertions(+), 954 deletions(-) rename hwe/{css/dipcenter.css => scss/dipcenter.scss} (81%) diff --git a/f_install/install.php b/f_install/install.php index 27c46db6..e1c1b265 100644 --- a/f_install/install.php +++ b/f_install/install.php @@ -13,13 +13,17 @@ require(__DIR__ . '/../vendor/autoload.php'); 설치 + - - - - - + + + + + + + + diff --git a/hwe/_119.php b/hwe/_119.php index 1017a904..513301d1 100644 --- a/hwe/_119.php +++ b/hwe/_119.php @@ -24,7 +24,7 @@ $plock = $db->queryFirstField('SELECT plock FROM plock'); - + diff --git a/hwe/_admin1.php b/hwe/_admin1.php index a622e36e..8e9fd584 100644 --- a/hwe/_admin1.php +++ b/hwe/_admin1.php @@ -22,7 +22,7 @@ $admin = getAdmin(); - + diff --git a/hwe/_admin2.php b/hwe/_admin2.php index 5721e97c..87b2bb2b 100644 --- a/hwe/_admin2.php +++ b/hwe/_admin2.php @@ -23,7 +23,7 @@ $db = DB::db(); - + diff --git a/hwe/_admin4.php b/hwe/_admin4.php index 0f05ba32..2ef4c18f 100644 --- a/hwe/_admin4.php +++ b/hwe/_admin4.php @@ -23,8 +23,9 @@ $ipGroupList = Util::arrayGroupBy( 'ip_c' ); -function colorBlockedName($general){ - if(!$general['blocked']){ +function colorBlockedName($general) +{ + if (!$general['blocked']) { return $general['name']; } return "{$general['name']}"; @@ -40,7 +41,7 @@ function colorBlockedName($general){ - + @@ -108,14 +109,14 @@ function colorBlockedName($general){ IP ID -$users): ?> - - ',array_map('\sammo\colorBlockedName', $users))?> - ',array_column($users, 'lastconnect'))?> - ',array_column($users, 'ip'))?> - ',array_column($users, 'owner'))?> - - + $users) : ?> + + ', array_map('\sammo\colorBlockedName', $users)) ?> + ', array_column($users, 'lastconnect')) ?> + ', array_column($users, 'ip')) ?> + ', array_column($users, 'owner')) ?> + + - + @@ -212,7 +212,7 @@ GROUP BY B.nation $query .= " order by avg(B.dex5) desc"; break; } - foreach($db->query($query) as $nation){ + foreach ($db->query($query) as $nation) { $gen = $db->queryFirstRow('SELECT COUNT(*) as cnt, ROUND(AVG(gold)) as avgg, ROUND(AVG(rice)) as avgr, @@ -221,7 +221,7 @@ GROUP BY B.nation ROUND(AVG(intel), 1) as avgi, ROUND(AVG(explevel), 1) as avge, SUM(crew) as crew -from general where nation=%i',$nation['nation']); +from general where nation=%i', $nation['nation']); $city = $db->queryFirstRow('SELECT COUNT(*) as cnt, SUM(pop) as pop, SUM(pop_max) as pop_max, @@ -312,7 +312,7 @@ from city where nation=%i', $nation['nation']); ?> query('SELECT * from statistic where month=1 or no=1') as $stat){ + foreach ($db->query('SELECT * from statistic where month=1 or no=1') as $stat) { echo " {$stat['year']} diff --git a/hwe/_admin7.php b/hwe/_admin7.php index 1a3ecfd1..25078733 100644 --- a/hwe/_admin7.php +++ b/hwe/_admin7.php @@ -86,7 +86,7 @@ $generalObj = General::createGeneralObjFromDB($gen); - + diff --git a/hwe/_admin8.php b/hwe/_admin8.php index 9fd01fba..b9fb03c0 100644 --- a/hwe/_admin8.php +++ b/hwe/_admin8.php @@ -1,4 +1,5 @@ + -외교정보 - - - - - - + 외교정보 + + + + + + + - - - -
외 교 정 보
-
- 정렬순서 : - - -
-
- - +
외 교 관 계
+ + + + + + +
외 교 정 보
+
+ 정렬순서 : + + +
+
+ + + + + + + + + + + query('SELECT * from diplomacy where me < you order by state desc') as $dip) { + $me = $dip['me']; + $you = $dip['you']; + + if ($dip['state'] == 2) { + continue; + } + + switch ($dip['state']) { + case 0: + $state = "교 전"; + break; + case 1: + $state = "선포중"; + break; + case 2: + $state = "통 상"; + break; + case 7: + $state = "불가침"; + break; + } + + $date = TimeUtil::now(); + + echo " - - - - - -query('SELECT * from diplomacy where me < you order by state desc') as $dip){ - $me = $dip['me']; - $you = $dip['you']; - - if ($dip['state'] == 2) { - continue; - } - - switch ($dip['state']) { - case 0: $state = "교 전"; break; - case 1: $state = "선포중"; break; - case 2: $state = "통 상"; break; - case 7: $state = "불가침"; break; - } - - $date = TimeUtil::now(); - - echo " - - - + + "; -} -?> -
외 교 관 계
국 가 명국 가 명상 태기 간
국 가 명국 가 명상 태기 간
$nationName[$me]$nationName[$you]$nationName[$me]$nationName[$you] $state {$dip['term']} 개월
- - - -
+ } + ?> + + + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index 7efac72a..37967b4d 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -27,13 +27,10 @@ $templates = new \League\Plates\Engine(__DIR__ . '/templates'); <?= UniqueConst::$serverName ?>: 명장일람 - - - - + diff --git a/hwe/a_emperior.php b/hwe/a_emperior.php index 6294f2d3..8444f331 100644 --- a/hwe/a_emperior.php +++ b/hwe/a_emperior.php @@ -18,12 +18,9 @@ increaseRefresh("왕조일람", 1); <?= UniqueConst::$serverName ?>: 왕조일람 - - - - + diff --git a/hwe/a_emperior_detail.php b/hwe/a_emperior_detail.php index 1a3ea255..a852745c 100644 --- a/hwe/a_emperior_detail.php +++ b/hwe/a_emperior_detail.php @@ -1,4 +1,5 @@ registerFunction('ConvertLog', '\sammo\ConvertLog'); $templates->registerFunction('newColor', '\sammo\newColor'); increaseRefresh("왕조일람", 1); -$emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i',$select); -$serverID = $emperior['server_id']??($emperior['serverID']??null); +$emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i', $select); +$serverID = $emperior['server_id'] ?? ($emperior['serverID'] ?? null); ?> @@ -22,193 +23,199 @@ $serverID = $emperior['server_id']??($emperior['serverID']??null); - - - -<?=UniqueConst::$serverName?>: 왕조일람 - - - + + + + <?= UniqueConst::$serverName ?>: 왕조일람 + + + - - +
역 대 왕 조
- -
+ + + -
역 대 왕 조
+ +
+ - + if ($emperior) : + ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
국 가 수
(최종 / 최대)
장 수 수
(최종 / 최대)
등 장 국 가
국가별 성향
장 수 성 격
장 수 특 기
; bgcolor= colspan=6> - (月) -
국 력성 향
장 수속 령
총 인 구인 구 율
국 고병 량
황 제 승 상 
위 장 군 사 공 
표 기 장 군 태 위 
거 기 장 군 사 도 
오 호 장 군
건 안 칠 자
장 수 들
(공헌도 순서)
역 사 기 록
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
국 가 수
(최종 / 최대)
장 수 수
(최종 / 최대)
등 장 국 가
국가별 성향
장 수 성 격
장 수 특 기
; bgcolor= colspan=6> + (月) +
국 력성 향
장 수속 령
총 인 구인 구 율
국 고병 량
황 제 승 상 
위 장 군 사 공 
표 기 장 군 태 위 
거 기 장 군 사 도 
오 호 장 군
건 안 칠 자
장 수 들
(공헌도 순서)
역 사 기 록
-query('SELECT * FROM ng_old_nations WHERE server_id=%s ORDER BY date DESC', $serverID); - foreach($nations as $nation){ - if(!$nation['nation']??null){ - continue; - } - $nation += Json::decode($nation['data']); - - $nation['typeName'] = getNationType($nation['type']); - $nation['levelName'] = getNationLevel($nation['level']); - /** @var int[]|null $nationGenerals */ - $nationGenerals = $nation['generals']; - - if($nationGenerals){ - $generals = $db->query('SELECT `general_no`, `name`, `last_yearmonth` FROM ng_old_generals WHERE server_id=%s AND general_no IN %li', $serverID, $nationGenerals); - - if(count($generals) != count($nationGenerals) && $serverID == UniqueConst::$serverID){ - $liveGenerals = $nationGenerals; - foreach($generals as $general){ - if(in_array($general['general_no'], $nationGenerals)){ - unset($nationGenerals[$general['general_no']]); - } - } - $liveGenerals = $db->query('SELECT `no`as`general_no`, `name` FROM general WHERE no IN %li', $liveGenerals); - $nation['generalsFull'] = array_merge($liveGenerals, $generals); - } - else{ - $nation['generalsFull'] = $generals; - } - } - else{ - $nation['generalsFull'] = []; - } - - if(key_exists('aux', $nation) && !is_array($nation['aux'])){ - $nation += Json::decode($nation['aux']); - } - - echo $templates->render('oldNation', $nation); + if (!$serverID) { + $serverID = UniqueConst::$serverID; } -} -?> - - - -
+ if ($showServers) { + $nations = $db->query('SELECT * FROM ng_old_nations WHERE server_id=%s ORDER BY date DESC', $serverID); + foreach ($nations as $nation) { + if (!$nation['nation'] ?? null) { + continue; + } + $nation += Json::decode($nation['data']); + + $nation['typeName'] = getNationType($nation['type']); + $nation['levelName'] = getNationLevel($nation['level']); + /** @var int[]|null $nationGenerals */ + $nationGenerals = $nation['generals']; + + if ($nationGenerals) { + $generals = $db->query('SELECT `general_no`, `name`, `last_yearmonth` FROM ng_old_generals WHERE server_id=%s AND general_no IN %li', $serverID, $nationGenerals); + + if (count($generals) != count($nationGenerals) && $serverID == UniqueConst::$serverID) { + $liveGenerals = $nationGenerals; + foreach ($generals as $general) { + if (in_array($general['general_no'], $nationGenerals)) { + unset($nationGenerals[$general['general_no']]); + } + } + $liveGenerals = $db->query('SELECT `no`as`general_no`, `name` FROM general WHERE no IN %li', $liveGenerals); + $nation['generalsFull'] = array_merge($liveGenerals, $generals); + } else { + $nation['generalsFull'] = $generals; + } + } else { + $nation['generalsFull'] = []; + } + + if (key_exists('aux', $nation) && !is_array($nation['aux'])) { + $nation += Json::decode($nation['aux']); + } + + echo $templates->render('oldNation', $nation); + } + } + ?> + + + + + + + + +
+ \ No newline at end of file diff --git a/hwe/a_genList.php b/hwe/a_genList.php index c8f62b0b..b83e4e3b 100644 --- a/hwe/a_genList.php +++ b/hwe/a_genList.php @@ -45,12 +45,9 @@ if ($gameStor->isunited) { <?= UniqueConst::$serverName ?>: 장수일람 - - - - + diff --git a/hwe/a_hallOfFame.php b/hwe/a_hallOfFame.php index b4b89813..68c573c4 100644 --- a/hwe/a_hallOfFame.php +++ b/hwe/a_hallOfFame.php @@ -47,13 +47,10 @@ if ($scenarioIdx && key_exists($scenarioIdx, $scenarioList[$seasonIdx] ?? [])) { <?= UniqueConst::$serverName ?>: 명예의 전당 - - - - + diff --git a/hwe/a_history.php b/hwe/a_history.php index cb4c9618..cffb467f 100644 --- a/hwe/a_history.php +++ b/hwe/a_history.php @@ -99,15 +99,13 @@ $nations = Json::decode($history['nations']); <?= UniqueConst::$serverName ?>: 연감 - - - - + + - - - - - - diff --git a/hwe/a_traffic.php b/hwe/a_traffic.php index 615e76df..106e9397 100644 --- a/hwe/a_traffic.php +++ b/hwe/a_traffic.php @@ -54,12 +54,7 @@ if ($admin['maxonline'] < $curonline) { - - - - - + + diff --git a/hwe/a_vote.php b/hwe/a_vote.php index 92fed25d..e526689f 100644 --- a/hwe/a_vote.php +++ b/hwe/a_vote.php @@ -30,12 +30,7 @@ $vote = $admin['vote'] ?: ['-']; - - - - - + + + diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index 2e1813e4..38d63e50 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -35,13 +35,9 @@ $templates = new \League\Plates\Engine('templates'); - - - - + diff --git a/hwe/b_dipcenter.php b/hwe/b_dipcenter.php index 452d774d..03df6d72 100644 --- a/hwe/b_dipcenter.php +++ b/hwe/b_dipcenter.php @@ -62,15 +62,9 @@ $nationStor->cacheValues(['notice', 'scout_msg', 'available_war_setting_cnt']); ]) ?>; - - - - - - - + diff --git a/hwe/b_diplomacy.php b/hwe/b_diplomacy.php index 236977cd..7b54f766 100644 --- a/hwe/b_diplomacy.php +++ b/hwe/b_diplomacy.php @@ -92,11 +92,12 @@ $neutralStateCharMap = [ <?= UniqueConst::$serverName ?>: 중원 정보 - - - - + + + + + - - - - - - diff --git a/hwe/b_genList.php b/hwe/b_genList.php index 9295bde6..5d8dd06f 100644 --- a/hwe/b_genList.php +++ b/hwe/b_genList.php @@ -55,12 +55,9 @@ $templates = new \League\Plates\Engine('templates'); <?= UniqueConst::$serverName ?>: 암행부 - - - - + diff --git a/hwe/b_myBossInfo.php b/hwe/b_myBossInfo.php index 54d0c97c..3336c9da 100644 --- a/hwe/b_myBossInfo.php +++ b/hwe/b_myBossInfo.php @@ -35,19 +35,15 @@ $nation = $db->queryFirstRow('SELECT nation,name,level,color,chief_set from nati <?= UniqueConst::$serverName ?>: 인사부 - - - - - + "selected"]; <?= UniqueConst::$serverName ?>: 세력도시 - - - - - + diff --git a/hwe/b_myGenInfo.php b/hwe/b_myGenInfo.php index 8dec4b95..015559e7 100644 --- a/hwe/b_myGenInfo.php +++ b/hwe/b_myGenInfo.php @@ -46,13 +46,9 @@ if ($gameStor->isunited) { <?= UniqueConst::$serverName ?>: 세력장수 - - - - - + diff --git a/hwe/b_myKingdomInfo.php b/hwe/b_myKingdomInfo.php index 05d9c4c2..39c7ccc0 100644 --- a/hwe/b_myKingdomInfo.php +++ b/hwe/b_myKingdomInfo.php @@ -29,13 +29,9 @@ if ($nationID == 0) { <?= UniqueConst::$serverName ?>: 세력정보 - - - - - + diff --git a/hwe/b_myPage.php b/hwe/b_myPage.php index bc6b26e8..270e945a 100644 --- a/hwe/b_myPage.php +++ b/hwe/b_myPage.php @@ -53,14 +53,10 @@ $use_auto_nation_turn = $me->getAuxVar('use_auto_nation_turn') ?? 1; - - - - - - + + diff --git a/hwe/b_processing.php b/hwe/b_processing.php index dc3b1a60..5a398fab 100644 --- a/hwe/b_processing.php +++ b/hwe/b_processing.php @@ -76,11 +76,7 @@ $cssList = $commandObj->getCSSFiles(); - - - - + @@ -233,7 +225,6 @@ uasort($troops, function ($lhs, $rhs) { - \ No newline at end of file diff --git a/hwe/battle_simulator.php b/hwe/battle_simulator.php index 7277f3a7..7e7f6cb7 100644 --- a/hwe/battle_simulator.php +++ b/hwe/battle_simulator.php @@ -46,18 +46,15 @@ if ($nationID) { - - - - + diff --git a/hwe/func_legacy.php b/hwe/func_legacy.php index a2e4d070..bfc56589 100644 --- a/hwe/func_legacy.php +++ b/hwe/func_legacy.php @@ -1,58 +1,72 @@ - - - -접속제한 - - - - - - - - - -접속 제한중입니다. 1턴 이내에 너무 많은 갱신을 하셨습니다. (다음 접속 가능 시각 : )
-(자신의 턴이 되면 다시 접속 가능합니다. 당신의 건강을 위해 잠시 쉬어보시는 것은 어떨까요? ^^)
-
- - + + + + + 접속제한 + + + + + + + + + + + 접속 제한중입니다. 1턴 이내에 너무 많은 갱신을 하셨습니다. (다음 접속 가능 시각 : )
+ (자신의 턴이 되면 다시 접속 가능합니다. 당신의 건강을 위해 잠시 쉬어보시는 것은 어떨까요? ^^)
+
+ + + -
-
+
+
"; return $str; } -function optionsForCities(callable $infoCall=null) { +function optionsForCities(callable $infoCall = null) +{ - if(!$infoCall){ - return join('', array_map(function($city){ + if (!$infoCall) { + return join('', array_map(function ($city) { return ""; }, CityConst::all())); } $infoList = []; $noInfoList = []; - foreach(CityConst::all() as $city){ + foreach (CityConst::all() as $city) { $info = $infoCall($city); - if(!$info){ + if (!$info) { $noInfoList[] = ""; continue; } @@ -62,7 +76,8 @@ function optionsForCities(callable $infoCall=null) { return join('', array_merge($infoList, $noInfoList)); } -function Submit($url, $msg="", $msg2="") { +function Submit($url, $msg = "", $msg2 = "") +{ echo "a"; // 파폭 버그 때문 echo "
@@ -74,49 +89,62 @@ function Submit($url, $msg="", $msg2="") { } -function GetNationColors() { - $colors = array("#FF0000", "#800000", "#A0522D", "#FF6347", "#FFA500", "#FFDAB9", "#FFD700", "#FFFF00", +function GetNationColors() +{ + $colors = array( + "#FF0000", "#800000", "#A0522D", "#FF6347", "#FFA500", "#FFDAB9", "#FFD700", "#FFFF00", "#7CFC00", "#00FF00", "#808000", "#008000", "#2E8B57", "#008080", "#20B2AA", "#6495ED", "#7FFFD4", "#AFEEEE", "#87CEEB", "#00FFFF", "#00BFFF", "#0000FF", "#000080", "#483D8B", "#7B68EE", "#BA55D3", - "#800080", "#FF00FF", "#FFC0CB", "#F5F5DC", "#E0FFFF", "#FFFFFF", "#A9A9A9"); + "#800080", "#FF00FF", "#FFC0CB", "#F5F5DC", "#E0FFFF", "#FFFFFF", "#A9A9A9" + ); return $colors; } -function backButton() { +function backButton() +{ return "
"; } -function CoreBackButton() { +function CoreBackButton() +{ return "
"; } -function closeButton() { +function closeButton() +{ return "
"; } -function printCitiesBasedOnDistance(int $cityNo, int $maxDistance=1):string { +function printCitiesBasedOnDistance(int $cityNo, int $maxDistance = 1): string +{ $distanceList = searchDistance($cityNo, $maxDistance, true); $result = []; - for($dist = 1; $dist <= $maxDistance; $dist++){ - $cityList = array_map(function($cityID){ + for ($dist = 1; $dist <= $maxDistance; $dist++) { + $cityList = array_map(function ($cityID) { return CityConst::byID($cityID)->name; }, Util::array_get($distanceList[$dist], [])); $cityStr = join(', ', $cityList); - switch($dist) { - case 1: $color = "magenta"; break; - case 2: $color = "orange"; break; - default: $color = "yellow"; break; + switch ($dist) { + case 1: + $color = "magenta"; + break; + case 2: + $color = "orange"; + break; + default: + $color = "yellow"; + break; } $result[] = "{$dist}칸 떨어진 도시 : {$cityStr}"; @@ -125,7 +153,8 @@ function printCitiesBasedOnDistance(int $cityNo, int $maxDistance=1):string { } -function info($type=0) { +function info($type = 0) +{ $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); @@ -136,14 +165,14 @@ function info($type=0) { $gencount = $db->queryFirstField('SELECT count(no) FROM general WHERE npc < 2'); $npccount = $db->queryFirstField('SELECT count(no) FROM general WHERE npc >= 2'); - switch($type) { - case 0: - return "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)
등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; - case 1: - return "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)          등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; - case 2: - return "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)"; - case 3: - return "등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; + switch ($type) { + case 0: + return "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)
등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; + case 1: + return "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)          등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; + case 2: + return "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)"; + case 3: + return "등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; } } diff --git a/hwe/func_template.php b/hwe/func_template.php index 17287026..8b029dba 100644 --- a/hwe/func_template.php +++ b/hwe/func_template.php @@ -11,10 +11,10 @@ namespace sammo; * TODO: side effect를 제거 */ - /** - * 관리자 권한이 필요함을 출력. - * @return void - */ +/** + * 관리자 권한이 필요함을 출력. + * @return void + */ function requireAdminPermissionHTML() { ob_start(); @@ -28,8 +28,8 @@ function requireAdminPermissionHTML() - - + + @@ -119,7 +119,7 @@ function displaySpecialDomesticInfo(?string $type): string ]); } -function allButton(bool $seizeNPCMode, array $opts=[]) +function allButton(bool $seizeNPCMode, array $opts = []) { if ($seizeNPCMode) { $site = "a_npcList.php"; @@ -143,7 +143,7 @@ function allButton(bool $seizeNPCMode, array $opts=[]) } -function commandButton(array $opts=[]) +function commandButton(array $opts = []) { $session = Session::getInstance(); $userID = Session::getUserID(); @@ -196,13 +196,13 @@ function formatDefenceTrain(int $value): string { if ($value === 999) { return "×"; - } else if ($value >= 90){ + } else if ($value >= 90) { return "☆"; } else if ($value >= 80) { return "◎"; } else if ($value >= 60) { return "○"; - } else{ + } else { return "△"; } } @@ -253,36 +253,49 @@ function getInvitationList(array $nationList) } -function getAutorunInfo($autorunOption){ - $templates = new \League\Plates\Engine(__DIR__.'/templates'); +function getAutorunInfo($autorunOption) +{ + $templates = new \League\Plates\Engine(__DIR__ . '/templates'); $auto_info = []; - foreach($autorunOption['options'] as $auto_option => $value){ + foreach ($autorunOption['options'] as $auto_option => $value) { assert($value); - switch($auto_option){ - case 'develop': $auto_info['내정'] = '내정'; break; - case 'warp': $auto_info['순간이동'] = '순간이동'; break; - case 'recruit': $auto_info['징병'] = $auto_info['징병']??'징병'; break; - case 'recruit_high': $auto_info['징병'] = '모병'; break; - case 'train': $auto_info['훈사'] = '훈련/사기진작'; break; - case 'battle': $auto_info['출병'] = '출병'; break; - case 'chief': $auto_info['사령턴'] = '사령턴'; break; + switch ($auto_option) { + case 'develop': + $auto_info['내정'] = '내정'; + break; + case 'warp': + $auto_info['순간이동'] = '순간이동'; + break; + case 'recruit': + $auto_info['징병'] = $auto_info['징병'] ?? '징병'; + break; + case 'recruit_high': + $auto_info['징병'] = '모병'; + break; + case 'train': + $auto_info['훈사'] = '훈련/사기진작'; + break; + case 'battle': + $auto_info['출병'] = '출병'; + break; + case 'chief': + $auto_info['사령턴'] = '사령턴'; + break; } } $limit = Util::toInt($autorunOption['limit_minutes']); - if($limit >= 43200){ + if ($limit >= 43200) { $auto_info['제한'] = '항상 유효'; - } - else if($limit % 60 == 0){ - $auto_info['제한'] = ($limit/60).'시간 유효'; - } - else{ - $auto_info['제한'] = ($limit).'분 유효'; + } else if ($limit % 60 == 0) { + $auto_info['제한'] = ($limit / 60) . '시간 유효'; + } else { + $auto_info['제한'] = ($limit) . '분 유효'; } $auto_info = join(', ', array_values($auto_info)); return $templates->render('tooltip', [ - 'text'=>'자율행동', - 'info'=>$auto_info, - 'style'=>'text-decoration:underline', - 'copyable_info'=>true + 'text' => '자율행동', + 'info' => $auto_info, + 'style' => 'text-decoration:underline', + 'copyable_info' => true ]); -} \ No newline at end of file +} diff --git a/hwe/install.php b/hwe/install.php index 3a624bc9..25969c90 100644 --- a/hwe/install.php +++ b/hwe/install.php @@ -31,11 +31,8 @@ if ($session->userGrade < 5 && !$allowReset) { - - - - + diff --git a/hwe/install_db.php b/hwe/install_db.php index b815cde4..b2779906 100644 --- a/hwe/install_db.php +++ b/hwe/install_db.php @@ -24,12 +24,9 @@ if ($session->userGrade == 5) { - - - - + diff --git a/hwe/recent_map.php b/hwe/recent_map.php index 8583b35b..c09f537c 100644 --- a/hwe/recent_map.php +++ b/hwe/recent_map.php @@ -19,14 +19,12 @@ include "func.php"; 'serverNick' => DB::prefix(), 'serverID' => UniqueConst::$serverID ]) ?> - - - +