diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 3720f478..10c01d36 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -23,5 +23,17 @@ module.exports = { '@typescript-eslint/no-floating-promises': 'error', "vue/no-multiple-template-root": "off", "vue/no-v-for-template-key": "off", - } + "vue/multi-word-component-names": "off",//TODO: 삭제 + }, + settings: { + 'import/resolver': { + alias: { + map: [ + ['@', './hwe/ts'], + ['@util', './hwe/ts/util'], + ['@scss', './hwe/scss'], + ] + } + } + }, } \ No newline at end of file diff --git a/f_install/install.php b/f_install/install.php index 83902b44..27c46db6 100644 --- a/f_install/install.php +++ b/f_install/install.php @@ -1,200 +1,187 @@ + 설치 - - - - - + + + + + + + +

삼국지 모의전투 HiDCHe 설치

-
- - + + \ No newline at end of file diff --git a/hwe/_119.php b/hwe/_119.php index 8434faf3..1017a904 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 872907e9..a622e36e 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 f46ea1f8..5721e97c 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 1066a6e7..0f05ba32 100644 --- a/hwe/_admin4.php +++ b/hwe/_admin4.php @@ -40,7 +40,7 @@ function colorBlockedName($general){ - + diff --git a/hwe/_admin5.php b/hwe/_admin5.php index e64ff4c4..a3d7be7d 100644 --- a/hwe/_admin5.php +++ b/hwe/_admin5.php @@ -39,7 +39,7 @@ $sel2[$type2] = "selected"; - + diff --git a/hwe/_admin7.php b/hwe/_admin7.php index 963e4239..1a3ecfd1 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 4b64f458..9fd01fba 100644 --- a/hwe/_admin8.php +++ b/hwe/_admin8.php @@ -31,7 +31,7 @@ $sel[$type] = "selected"; - + diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index 626ff9a0..7efac72a 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -1,4 +1,5 @@ - - - -<?=UniqueConst::$serverName?>: 명장일람 - - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 명장일람 + + + + + + + + - - -
명 장 일 람
- - - - -
- - -
-
- + + 명 장 일 람
+ + + + + + + + +
+ + +
+
+ isunited){ - foreach(RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]){ - $ownerNameList[$ownerID] = $ownerName; - } -} - -$nationName = [0=>'재야']; -$nationColor = [0=>'#000000']; -foreach (getAllNationStaticInfo() as $nation) { - $nationName[$nation['nation']] = $nation['name']; - $nationColor[$nation['nation']] = $nation['color']; -} - -$types = [ - ["명 성", "int", function($v){$v['value'] = $v['experience']; return $v; }], - ["계 급", "int", function($v){$v['value'] = $v['dedication']; return $v; }], - ["계 략 성 공", "int", function($v) use ($gameStor){ - $v['value'] = $v['firenum']; - if($gameStor->isunited){ - return $v; - } - $v['nationName'] = '???'; - $v['pictureFullPath'] = GetImageURL(0)."/default.jpg"; - $v['name'] = '???'; - $v['ownerName'] = null; - $v['bgColor'] = GameConst::$basecolor4; - $v['fgColor'] = newColor($v['bgColor']); - return $v; - }], - ["전 투 횟 수", "int", function($v){$v['value'] = $v['warnum']; return $v; }], - ["승 리", "int", function($v){$v['value'] = $v['killnum']; return $v; }], - ["승 률", "percent", function($v){ - if($v['warnum'] < 10){ - $v['value'] = 0; - } - else{ - $v['value'] = $v['killnum'] / max(1, $v['warnum']); - } - return $v; - }], - ["점 령", "int", function($v){$v['value'] = $v['occupied']; return $v; }], - ["사 살", "int", function($v){$v['value'] = $v['killcrew']; return $v; }], - ["살 상 률", "percent", function($v){ - if($v['warnum'] < 10){ - $v['value'] = 0; - } - else{ - $v['value'] = $v['killcrew'] / max(1, $v['deathcrew']); - } - return $v; - }], - ["대 인 사 살", "int", function($v){$v['value'] = $v['killcrew_person']; return $v; }], - ["대 인 살 상 률", "percent", function($v){ - if($v['warnum'] < 10){ - $v['value'] = 0; - } - else{ - $v['value'] = $v['killcrew_person'] / max(1, $v['deathcrew_person']); - } - return $v; - }], - ["보 병 숙 련 도", "int", function($v){$v['value'] = $v['dex1']; return $v; }], - ["궁 병 숙 련 도", "int", function($v){$v['value'] = $v['dex2']; return $v; }], - ["기 병 숙 련 도", "int", function($v){$v['value'] = $v['dex3']; return $v; }], - ["귀 병 숙 련 도", "int", function($v){$v['value'] = $v['dex4']; return $v; }], - ["차 병 숙 련 도", "int", function($v){$v['value'] = $v['dex5']; return $v; }], - ["전 력 전 승 률", "percent", function($v){ - $totalCnt = $v['ttw']+$v['ttd']+$v['ttl']; - if($totalCnt < 50){ - $v['value'] = 0; - } - else{ - $v['value'] = $v['ttw']/max(1, $totalCnt); - } - return $v; - }], - ["통 솔 전 승 률", "percent", function($v){ - $totalCnt = $v['tlw']+$v['tld']+$v['tll']; - if($totalCnt < 50){ - $v['value'] = 0; - } - else{ - $v['value'] = $v['tlw']/max(1, $totalCnt); - } - return $v; - }], - ["일 기 토 승 률", "percent", function($v){ - $totalCnt = $v['tsw']+$v['tsd']+$v['tsl']; - if($totalCnt < 50){ - $v['value'] = 0; - } - else{ - $v['value'] = $v['tsw']/max(1, $totalCnt); - } - return $v; - }], - ["설 전 승 률", "percent", function($v){ - $totalCnt = $v['tiw']+$v['tid']+$v['til']; - if($totalCnt < 50){ - $v['value'] = 0; - } - else{ - $v['value'] = $v['tiw']/max(1, $totalCnt); + $ownerNameList = []; + if ($gameStor->isunited) { + foreach (RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]) { + $ownerNameList[$ownerID] = $ownerName; + } } - return $v; - }], - ["베 팅 투 자 액", "int", function($v){$v['value'] = $v['betgold']; return $v; }], - ["베 팅 당 첨", "int", function($v){$v['value'] = $v['betwin']; return $v; }], - ["베 팅 수 익 금", "int", function($v){$v['value'] = $v['betwingold']; return $v; }], - ["베 팅 수 익 률", "percent", function($v){ - if($v['betgold'] < GameConst::$defaultGold){ - $v['value'] = 0; + $nationName = [0 => '재야']; + $nationColor = [0 => '#000000']; + foreach (getAllNationStaticInfo() as $nation) { + $nationName[$nation['nation']] = $nation['name']; + $nationColor[$nation['nation']] = $nation['color']; } - else{ - $v['value'] = $v['betwingold']/max(1, $v['betgold']); - } - return $v; - }], -]; -$generals = []; -foreach($db->query( - "SELECT nation,no,name,owner_name as ownerName, owner, picture, imgsvr, + $types = [ + ["명 성", "int", function ($v) { + $v['value'] = $v['experience']; + return $v; + }], + ["계 급", "int", function ($v) { + $v['value'] = $v['dedication']; + return $v; + }], + ["계 략 성 공", "int", function ($v) use ($gameStor) { + $v['value'] = $v['firenum']; + if ($gameStor->isunited) { + return $v; + } + $v['nationName'] = '???'; + $v['pictureFullPath'] = GetImageURL(0) . "/default.jpg"; + $v['name'] = '???'; + $v['ownerName'] = null; + $v['bgColor'] = GameConst::$basecolor4; + $v['fgColor'] = newColor($v['bgColor']); + return $v; + }], + ["전 투 횟 수", "int", function ($v) { + $v['value'] = $v['warnum']; + return $v; + }], + ["승 리", "int", function ($v) { + $v['value'] = $v['killnum']; + return $v; + }], + ["승 률", "percent", function ($v) { + if ($v['warnum'] < 10) { + $v['value'] = 0; + } else { + $v['value'] = $v['killnum'] / max(1, $v['warnum']); + } + return $v; + }], + ["점 령", "int", function ($v) { + $v['value'] = $v['occupied']; + return $v; + }], + ["사 살", "int", function ($v) { + $v['value'] = $v['killcrew']; + return $v; + }], + ["살 상 률", "percent", function ($v) { + if ($v['warnum'] < 10) { + $v['value'] = 0; + } else { + $v['value'] = $v['killcrew'] / max(1, $v['deathcrew']); + } + return $v; + }], + ["대 인 사 살", "int", function ($v) { + $v['value'] = $v['killcrew_person']; + return $v; + }], + ["대 인 살 상 률", "percent", function ($v) { + if ($v['warnum'] < 10) { + $v['value'] = 0; + } else { + $v['value'] = $v['killcrew_person'] / max(1, $v['deathcrew_person']); + } + return $v; + }], + ["보 병 숙 련 도", "int", function ($v) { + $v['value'] = $v['dex1']; + return $v; + }], + ["궁 병 숙 련 도", "int", function ($v) { + $v['value'] = $v['dex2']; + return $v; + }], + ["기 병 숙 련 도", "int", function ($v) { + $v['value'] = $v['dex3']; + return $v; + }], + ["귀 병 숙 련 도", "int", function ($v) { + $v['value'] = $v['dex4']; + return $v; + }], + ["차 병 숙 련 도", "int", function ($v) { + $v['value'] = $v['dex5']; + return $v; + }], + ["전 력 전 승 률", "percent", function ($v) { + $totalCnt = $v['ttw'] + $v['ttd'] + $v['ttl']; + if ($totalCnt < 50) { + $v['value'] = 0; + } else { + $v['value'] = $v['ttw'] / max(1, $totalCnt); + } + return $v; + }], + ["통 솔 전 승 률", "percent", function ($v) { + $totalCnt = $v['tlw'] + $v['tld'] + $v['tll']; + if ($totalCnt < 50) { + $v['value'] = 0; + } else { + $v['value'] = $v['tlw'] / max(1, $totalCnt); + } + return $v; + }], + ["일 기 토 승 률", "percent", function ($v) { + $totalCnt = $v['tsw'] + $v['tsd'] + $v['tsl']; + if ($totalCnt < 50) { + $v['value'] = 0; + } else { + $v['value'] = $v['tsw'] / max(1, $totalCnt); + } + return $v; + }], + ["설 전 승 률", "percent", function ($v) { + $totalCnt = $v['tiw'] + $v['tid'] + $v['til']; + if ($totalCnt < 50) { + $v['value'] = 0; + } else { + $v['value'] = $v['tiw'] / max(1, $totalCnt); + } + + return $v; + }], + ["베 팅 투 자 액", "int", function ($v) { + $v['value'] = $v['betgold']; + return $v; + }], + ["베 팅 당 첨", "int", function ($v) { + $v['value'] = $v['betwin']; + return $v; + }], + ["베 팅 수 익 금", "int", function ($v) { + $v['value'] = $v['betwingold']; + return $v; + }], + ["베 팅 수 익 률", "percent", function ($v) { + if ($v['betgold'] < GameConst::$defaultGold) { + $v['value'] = 0; + } else { + $v['value'] = $v['betwingold'] / max(1, $v['betgold']); + } + return $v; + }], + ]; + + $generals = []; + foreach ($db->query( + "SELECT nation,no,name,owner_name as ownerName, owner, picture, imgsvr, experience, dedication, dex1, dex2, dex3, dex4, dex5, horse, weapon, book, item - FROM general WHERE %l", $btn == "NPC 보기"?"npc>=2":"npc<2") as $general -){ - $generalID = $general['no']; - $general['bgColor'] = $nationColor[$general['nation']]??GameConst::$basecolor4; - $general['fgColor'] = newColor($general['bgColor']); - $general['nationName'] = $nationName[$general['nation']]; + FROM general WHERE %l", + $btn == "NPC 보기" ? "npc>=2" : "npc<2" + ) as $general) { + $generalID = $general['no']; + $general['bgColor'] = $nationColor[$general['nation']] ?? GameConst::$basecolor4; + $general['fgColor'] = newColor($general['bgColor']); + $general['nationName'] = $nationName[$general['nation']]; - if(key_exists('picture', $general)){ - $imageTemp = GetImageURL($general['imgsvr']); - $general['pictureFullPath'] = "$imageTemp/{$general['picture']}"; - } - else{ - $general['pictureFullPath'] = GetImageURL(0)."/default.jpg"; - } - - $generals[$generalID] = $general; -} - -foreach($db->queryAllLists('SELECT general_id, `type`, `value` FROM rank_data') as [$generalID, $typeKey, $value]){ - if(!key_exists($generalID, $generals)){ - continue; - } - $generals[$generalID][$typeKey] = $value; -} - -$templates = new \League\Plates\Engine('templates'); - -foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){ - $validCnt = 0; - $typeGenerals = array_map(function($general) use($typeValue, $typeFunc, &$validCnt, $ownerNameList){ - $general['ownerName'] = $ownerNameList[$general['owner']]??null; - $general = ($typeFunc)($general); - $value = $general['value']; - - if($value > 0){ - $validCnt+=1; - } - - if($typeValue == 'percent'){ - $general['printValue'] = number_format($value*100, 2).'%'; - } - else { - $general['printValue'] = number_format($value); - } - return $general; - }, $generals); - - usort($typeGenerals, function($lhs, $rhs){ - //내림차순 - return -($lhs['value'] <=> $rhs['value']); - }); - - - echo $templates->render('hallOfFrame', [ - 'typeName'=>$typeName, - 'generals'=>array_slice($typeGenerals, 0, min(10, $validCnt)) - ]); -} -?> -
-
-'명 마', - 'weapon'=>'명 검', - 'book'=>'명 서', - 'item'=>'도 구' -]; - -$simpleItemTypes = array_keys($itemTypes); array_map(function($itemType){return $itemType[1];}, $itemTypes); -$itemOwners = []; - -foreach($generals as $general){ - foreach($itemTypes as $itemType=>$itemTypeName){ - $itemClassName = $general[$itemType]; - $itemClass = buildItemClass($itemClassName); - if($itemClass->isBuyable()){ - continue; - } - - if(key_exists($itemClassName, $itemOwners)){ - $itemOwners[$itemClassName][] = $general; - } - else{ - $itemOwners[$itemClassName] = [$general]; - } - - } -} - -foreach(GameConst::$allItems as $itemType=>$itemList){ - $itemNameType = $itemTypes[$itemType]; - $itemList = array_reverse($itemList, true); - - - $itemRanker = []; - foreach($itemList as $itemClassName=>$itemCnt){ - if($itemCnt==0){ - continue; - } - $itemClass = buildItemClass($itemClassName); - - if($itemClass->isBuyable()){ - continue; - } - - $info = $itemClass->getInfo(); - $name = $itemClass->getName(); - - - if($info){ - $name = $templates->render('tooltip', [ - 'text'=>$name, - 'info'=>$info, - ]); - } - foreach(Util::range($itemCnt) as $itemIdx){ - if(($itemOwners[$itemClassName][$itemIdx]??null) === null){ - $emptyCard = [ - 'rankName' => $name, - 'pictureFullPath' => GetImageURL(0)."/default.jpg", - 'value'=>$itemClassName, - 'name'=>'미발견', - 'bgColor'=>GameConst::$basecolor4, - 'fgColor'=>newColor(GameConst::$basecolor4), - ]; - $itemRanker[] = $emptyCard; - continue; + if (key_exists('picture', $general)) { + $imageTemp = GetImageURL($general['imgsvr']); + $general['pictureFullPath'] = "$imageTemp/{$general['picture']}"; + } else { + $general['pictureFullPath'] = GetImageURL(0) . "/default.jpg"; } - $general = $itemOwners[$itemClassName][$itemIdx]; - - $card = [ - 'rankName' => $name, - 'pictureFullPath' => $general['pictureFullPath'], - 'value'=>$itemClassName, - 'nationName'=>$general['nationName'], - 'name'=>$general['name'], - 'bgColor'=>$general['bgColor'], - 'fgColor'=>$general['fgColor'], - ]; - $itemRanker[] = $card; + $generals[$generalID] = $general; } - } - echo $templates->render('hallOfFrame', [ - 'typeName'=>$itemNameType, - 'generals'=>$itemRanker - ]); -} -?> -
- - - -
+ foreach ($db->queryAllLists('SELECT general_id, `type`, `value` FROM rank_data') as [$generalID, $typeKey, $value]) { + if (!key_exists($generalID, $generals)) { + continue; + } + $generals[$generalID][$typeKey] = $value; + } + + $templates = new \League\Plates\Engine('templates'); + + foreach ($types as $idx => [$typeName, $typeValue, $typeFunc]) { + $validCnt = 0; + $typeGenerals = array_map(function ($general) use ($typeValue, $typeFunc, &$validCnt, $ownerNameList) { + $general['ownerName'] = $ownerNameList[$general['owner']] ?? null; + $general = ($typeFunc)($general); + $value = $general['value']; + + if ($value > 0) { + $validCnt += 1; + } + + if ($typeValue == 'percent') { + $general['printValue'] = number_format($value * 100, 2) . '%'; + } else { + $general['printValue'] = number_format($value); + } + return $general; + }, $generals); + + usort($typeGenerals, function ($lhs, $rhs) { + //내림차순 + return - ($lhs['value'] <=> $rhs['value']); + }); + + + echo $templates->render('hallOfFrame', [ + 'typeName' => $typeName, + 'generals' => array_slice($typeGenerals, 0, min(10, $validCnt)) + ]); + } + ?> +
+
+ '명 마', + 'weapon' => '명 검', + 'book' => '명 서', + 'item' => '도 구' + ]; + + $simpleItemTypes = array_keys($itemTypes); + array_map(function ($itemType) { + return $itemType[1]; + }, $itemTypes); + $itemOwners = []; + + foreach ($generals as $general) { + foreach ($itemTypes as $itemType => $itemTypeName) { + $itemClassName = $general[$itemType]; + $itemClass = buildItemClass($itemClassName); + if ($itemClass->isBuyable()) { + continue; + } + + if (key_exists($itemClassName, $itemOwners)) { + $itemOwners[$itemClassName][] = $general; + } else { + $itemOwners[$itemClassName] = [$general]; + } + } + } + + foreach (GameConst::$allItems as $itemType => $itemList) { + $itemNameType = $itemTypes[$itemType]; + $itemList = array_reverse($itemList, true); + + + $itemRanker = []; + foreach ($itemList as $itemClassName => $itemCnt) { + if ($itemCnt == 0) { + continue; + } + $itemClass = buildItemClass($itemClassName); + + if ($itemClass->isBuyable()) { + continue; + } + + $info = $itemClass->getInfo(); + $name = $itemClass->getName(); + + + if ($info) { + $name = $templates->render('tooltip', [ + 'text' => $name, + 'info' => $info, + ]); + } + foreach (Util::range($itemCnt) as $itemIdx) { + if (($itemOwners[$itemClassName][$itemIdx] ?? null) === null) { + $emptyCard = [ + 'rankName' => $name, + 'pictureFullPath' => GetImageURL(0) . "/default.jpg", + 'value' => $itemClassName, + 'name' => '미발견', + 'bgColor' => GameConst::$basecolor4, + 'fgColor' => newColor(GameConst::$basecolor4), + ]; + $itemRanker[] = $emptyCard; + continue; + } + + $general = $itemOwners[$itemClassName][$itemIdx]; + + $card = [ + 'rankName' => $name, + 'pictureFullPath' => $general['pictureFullPath'], + 'value' => $itemClassName, + 'nationName' => $general['nationName'], + 'name' => $general['name'], + 'bgColor' => $general['bgColor'], + 'fgColor' => $general['fgColor'], + ]; + $itemRanker[] = $card; + } + } + + echo $templates->render('hallOfFrame', [ + 'typeName' => $itemNameType, + 'generals' => $itemRanker + ]); + } + ?> +
+ + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/a_emperior.php b/hwe/a_emperior.php index 8247a824..6294f2d3 100644 --- a/hwe/a_emperior.php +++ b/hwe/a_emperior.php @@ -1,4 +1,5 @@ - - - -<?=UniqueConst::$serverName?>: 왕조일람 - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 왕조일람 + + + + + + + - - -
역 대 왕 조
-
-
+ + + + +
역 대 왕 조
+
+
-query('SELECT * FROM emperior ORDER BY `no` DESC'); + $emperiors = $db->query('SELECT * FROM emperior ORDER BY `no` DESC'); -if($emperiors){ - $serverID = $emperior[0]['server_id']??($emperior[0]['serverID']??null); - if($serverID == UniqueConst::$serverID){ - $showCurrentNation = false; + if ($emperiors) { + $serverID = $emperior[0]['server_id'] ?? ($emperior[0]['serverID'] ?? null); + if ($serverID == UniqueConst::$serverID) { + $showCurrentNation = false; + } } -} -if ($showCurrentNation) { - $gameStor = KVStorage::getStorage($db, 'game_env'); - [$year, $month] = $gameStor->getValuesAsArray(['year', 'month']); -?> + if ($showCurrentNation) { + $gameStor = KVStorage::getStorage($db, 'game_env'); + [$year, $month] = $gameStor->getValuesAsArray(['year', 'month']); + ?> - - - - -
- 현재 (月) - -
+ + + + +
+ 현재 (月) + +
- + foreach ($emperiors as $emperior) { + $serverID = $emperior['server_id'] ?? ($emperior['serverID'] ?? null); + ?> - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ - + - - - -
;background-color:' colspan=8> - (月) -
국 력장 수속 령성 향
황 제승 상표 기 장 군사 공
거 기 장 군태 위위 장 군사 도
+ + + +
;background-color:' colspan=8> + (月) +
국 력장 수속 령성 향
황 제승 상표 기 장 군사 공
거 기 장 군태 위위 장 군사 도
- + - - - -
+ + + + + + + +
+ \ No newline at end of file diff --git a/hwe/a_emperior_detail.php b/hwe/a_emperior_detail.php index 5bb18292..1a3ea255 100644 --- a/hwe/a_emperior_detail.php +++ b/hwe/a_emperior_detail.php @@ -26,9 +26,8 @@ $serverID = $emperior['server_id']??($emperior['serverID']??null); <?=UniqueConst::$serverName?>: 왕조일람 - - + diff --git a/hwe/a_genList.php b/hwe/a_genList.php index de37dcc8..c8f62b0b 100644 --- a/hwe/a_genList.php +++ b/hwe/a_genList.php @@ -1,4 +1,5 @@ 15) { } $ownerNameList = []; -if($gameStor->isunited){ - foreach(RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]){ +if ($gameStor->isunited) { + foreach (RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]) { $ownerNameList[$ownerID] = $ownerName; } } @@ -39,75 +40,81 @@ if($gameStor->isunited){ - - - -<?=UniqueConst::$serverName?>: 장수일람 - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 장수일람 + + + + + + + - - - -
장 수 일 람
정렬순서 : - -
-
- + + 장 수 일 람
+ + + +
정렬순서 : + + +
+ + + + ['nation', false], - 2=>['leadership', true], - 3=>['strength', true], - 4=>['intel', true], - 5=>['experience', true], - 6=>['dedication', true], - 7=>['officer_level', true], - 8=>['killturn', false], - 9=>['connect', true], - 10=>['experience', true], - 11=>['personal', true], - 12=>['special', true], - 13=>['special2', true], - 14=>['age', true], - 15=>['npc', true], -][$type]; + [$orderKey, $orderDesc] = [ + 1 => ['nation', false], + 2 => ['leadership', true], + 3 => ['strength', true], + 4 => ['intel', true], + 5 => ['experience', true], + 6 => ['dedication', true], + 7 => ['officer_level', true], + 8 => ['killturn', false], + 9 => ['connect', true], + 10 => ['experience', true], + 11 => ['personal', true], + 12 => ['special', true], + 13 => ['special2', true], + 14 => ['age', true], + 15 => ['npc', true], + ][$type]; -$generalList = $db->query('SELECT owner,no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leadership,strength,intel,experience,dedication,officer_level,killturn,connect from general order by %b %l', $orderKey, $orderDesc?'desc':''); + $generalList = $db->query('SELECT owner,no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leadership,strength,intel,experience,dedication,officer_level,killturn,connect from general order by %b %l', $orderKey, $orderDesc ? 'desc' : ''); -echo" + echo " @@ -126,90 +133,94 @@ echo" "; -foreach($generalList as $general){ - $nation = $nationname[$general['nation']]; + foreach ($generalList as $general) { + $nation = $nationname[$general['nation']]; - $lbonus = calcLeadershipBonus($general['officer_level'], $nationlevel[$general['nation']]??0); - if ($lbonus > 0) { - $lbonusText = "+{$lbonus}"; - } else { - $lbonusText = ""; - } + $lbonus = calcLeadershipBonus($general['officer_level'], $nationlevel[$general['nation']] ?? 0); + if ($lbonus > 0) { + $lbonusText = "+{$lbonus}"; + } else { + $lbonusText = ""; + } - if ($general['injury'] > 0) { - $leadership = intdiv($general['leadership'] * (100 - $general['injury']), 100); - $strength = intdiv($general['strength'] * (100 - $general['injury']), 100); - $intel = intdiv($general['intel'] * (100 - $general['injury']), 100); - $leadership = "{$leadership}{$lbonusText}"; - $strength = "{$strength}"; - $intel = "{$intel}"; - } else { - $leadership = "{$general['leadership']}{$lbonusText}"; - $strength = "{$general['strength']}"; - $intel = "{$general['intel']}"; - } + if ($general['injury'] > 0) { + $leadership = intdiv($general['leadership'] * (100 - $general['injury']), 100); + $strength = intdiv($general['strength'] * (100 - $general['injury']), 100); + $intel = intdiv($general['intel'] * (100 - $general['injury']), 100); + $leadership = "{$leadership}{$lbonusText}"; + $strength = "{$strength}"; + $intel = "{$intel}"; + } else { + $leadership = "{$general['leadership']}{$lbonusText}"; + $strength = "{$general['strength']}"; + $intel = "{$general['intel']}"; + } - if ($general['npc'] >= 2) { - $name = "{$general['name']}"; - } elseif ($general['npc'] == 1) { - $name = "{$general['name']}"; - } else { - $name = "{$general['name']}"; - } + if ($general['npc'] >= 2) { + $name = "{$general['name']}"; + } elseif ($general['npc'] == 1) { + $name = "{$general['name']}"; + } else { + $name = "{$general['name']}"; + } - if(key_exists($general['owner'], $ownerNameList)){ - $name = $name.'
('.$ownerNameList[$general['owner']].')'; - } + if (key_exists($general['owner'], $ownerNameList)) { + $name = $name . '
(' . $ownerNameList[$general['owner']] . ')'; + } - $general['connect'] = Util::round($general['connect'], -1); + $general['connect'] = Util::round($general['connect'], -1); - $imageTemp = GetImageURL($general['imgsvr']); - echo " + $imageTemp = GetImageURL($general['imgsvr']); + echo " =2?'true':'false')."' + data-is-npc='" . ($general['npc'] >= 2 ? 'true' : 'false') . "' > - - - + + + - - + + + echo getOfficerLevelText($general['officer_level']); + echo " + echo "
【" . getConnect($general['connect']) . "】"; -} -echo " + } + echo "
얼 굴삭턴 벌점
$name {$general['age']}세".displayCharInfo($general['personal'])."".displaySpecialDomesticInfo($general['special'])." / ".displaySpecialWarInfo($general['special2'])."Lv ".getExpLevel($general['experience'])."" . displayCharInfo($general['personal']) . "" . displaySpecialDomesticInfo($general['special']) . " / " . displaySpecialWarInfo($general['special2']) . "Lv " . getExpLevel($general['experience']) . " {$nation}".getHonor($general['experience'])."".getDed($general['dedication'])."" . getHonor($general['experience']) . "" . getDed($general['dedication']) . " "; - echo getOfficerLevelText($general['officer_level']); - echo " $leadership $strength $intel {$general['killturn']} {$general['connect']}"; - echo "
【".getConnect($general['connect'])."】
"; -?> + ?> - - - -
- + + + + + + + +
+ - + \ No newline at end of file diff --git a/hwe/a_hallOfFame.php b/hwe/a_hallOfFame.php index 01ee2402..b4b89813 100644 --- a/hwe/a_hallOfFame.php +++ b/hwe/a_hallOfFame.php @@ -1,4 +1,5 @@ query('SELECT season, scenario_name as name, count(scenario) as cnt, scenario from ng_games group by season, scenario order by season desc, scenario asc') as $scenarioInfo){ + $scenarioList = []; + foreach ($db->query('SELECT season, scenario_name as name, count(scenario) as cnt, scenario from ng_games group by season, scenario order by season desc, scenario asc') as $scenarioInfo) { $seasonIdx = $scenarioInfo['season']; $scenarioIdx = $scenarioInfo['scenario']; - if(!key_exists($seasonIdx, $scenarioList)){ + if (!key_exists($seasonIdx, $scenarioList)) { $scenarioList[$seasonIdx] = []; } $scenarioList[$seasonIdx][$scenarioIdx] = $scenarioInfo; @@ -28,11 +29,10 @@ $scenarioList = (function(){ -if($scenarioIdx && key_exists($scenarioIdx, $scenarioList[$seasonIdx]??[])){ +if ($scenarioIdx && key_exists($scenarioIdx, $scenarioList[$seasonIdx] ?? [])) { $searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name']; $searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx); -} -else{ +} else { $searchScenarioName = '* 모두 *'; $searchFilter = $db->sqleval('season = %i', $seasonIdx); } @@ -42,134 +42,132 @@ else{ - - - -<?=UniqueConst::$serverName?>: 명예의 전당 - - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 명예의 전당 + + + + + + + + - - - -
명 예 의 전 당
-시나리오 검색 : -
-
-['명 성', 'int'], - 'dedication'=>['계 급', 'int'], - 'firenum'=>['계 략 성 공', 'int'], - 'warnum'=>['전 투 횟 수', 'int'], - 'killnum'=>['승 리', 'int'], - 'winrate'=>['승 률', 'percent'], - 'occupied'=>['점 령', 'int'], - 'killcrew'=>['사 살', 'int'], - 'killrate'=>['살 상 률', 'percent'], - 'killcrew_person'=>['대 인 사 살', 'int'], - 'killrate_person'=>['대 인 살 상 률', 'percent'], - 'dex1'=>['보 병 숙 련 도', 'int'], - 'dex2'=>['궁 병 숙 련 도', 'int'], - 'dex3'=>['기 병 숙 련 도', 'int'], - 'dex4'=>['귀 병 숙 련 도', 'int'], - 'dex5'=>['차 병 숙 련 도', 'int'], - 'ttrate'=>['전 력 전 승 률', 'percent'], - 'tlrate'=>['통 솔 전 승 률', 'percent'], - 'tsrate'=>['일 기 토 승 률', 'percent'], - 'tirate'=>['설 전 승 률', 'percent'], - 'betgold'=>['베 팅 투 자 액', 'int'], - 'betwin'=>['베 팅 당 첨', 'int'], - 'betwingold'=>['베 팅 수 익 금', 'int'], - 'betrate'=>['베 팅 수 익 률', 'percent'], -]; + + + + + + + +
명 예 의 전 당
+ 시나리오 검색 : +
+
+ ['명 성', 'int'], + 'dedication' => ['계 급', 'int'], + 'firenum' => ['계 략 성 공', 'int'], + 'warnum' => ['전 투 횟 수', 'int'], + 'killnum' => ['승 리', 'int'], + 'winrate' => ['승 률', 'percent'], + 'occupied' => ['점 령', 'int'], + 'killcrew' => ['사 살', 'int'], + 'killrate' => ['살 상 률', 'percent'], + 'killcrew_person' => ['대 인 사 살', 'int'], + 'killrate_person' => ['대 인 살 상 률', 'percent'], + 'dex1' => ['보 병 숙 련 도', 'int'], + 'dex2' => ['궁 병 숙 련 도', 'int'], + 'dex3' => ['기 병 숙 련 도', 'int'], + 'dex4' => ['귀 병 숙 련 도', 'int'], + 'dex5' => ['차 병 숙 련 도', 'int'], + 'ttrate' => ['전 력 전 승 률', 'percent'], + 'tlrate' => ['통 솔 전 승 률', 'percent'], + 'tsrate' => ['일 기 토 승 률', 'percent'], + 'tirate' => ['설 전 승 률', 'percent'], + 'betgold' => ['베 팅 투 자 액', 'int'], + 'betwin' => ['베 팅 당 첨', 'int'], + 'betwingold' => ['베 팅 수 익 금', 'int'], + 'betrate' => ['베 팅 수 익 률', 'percent'], + ]; -$templates = new \League\Plates\Engine('templates'); + $templates = new \League\Plates\Engine('templates'); -$ownerNameList = []; -foreach(RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]){ - $ownerNameList[$ownerID] = $ownerName; -} - -foreach($types as $typeName=>[$typeDescribe, $typeValue]) { - $hallResult = $db->query('SELECT * FROM hall WHERE `type`=%s AND %? ORDER BY `value` DESC LIMIT 10', $typeName, $searchFilter); - - $hallResult = array_map(function($general)use($typeValue, $ownerNameList){ - $aux = Json::decode($general['aux']); - $general += $aux; - - if(key_exists($general['owner'], $ownerNameList)){ - $general['ownerName'] = $ownerNameList[$general['owner']]; + $ownerNameList = []; + foreach (RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]) { + $ownerNameList[$ownerID] = $ownerName; } - if(!key_exists('bgColor', $general)){ - if(!key_exists('color', $general)){ - $general['bgColor'] = GameConst::$basecolor4; - } - else{ - $general['bgColor'] = $general['color']; - } - } + foreach ($types as $typeName => [$typeDescribe, $typeValue]) { + $hallResult = $db->query('SELECT * FROM hall WHERE `type`=%s AND %? ORDER BY `value` DESC LIMIT 10', $typeName, $searchFilter); - if(!key_exists('fgColor', $general)){ - $general['fgColor'] = newColor($general['bgColor']); - } + $hallResult = array_map(function ($general) use ($typeValue, $ownerNameList) { + $aux = Json::decode($general['aux']); + $general += $aux; - if(key_exists('picture', $general)){ - $imageTemp = GetImageURL($general['imgsvr']); - $general['pictureFullPath'] = "$imageTemp/{$general['picture']}"; - } - else{ - $general['pictureFullPath'] = GetImageURL(0)."/default.jpg"; - } + if (key_exists($general['owner'], $ownerNameList)) { + $general['ownerName'] = $ownerNameList[$general['owner']]; + } - if(!key_exists('printValue', $general)){ - $value = $general['value']; - if($typeValue == 'percent'){ - $general['printValue'] = number_format($value*100, 2).'%'; - } - else { - $general['printValue'] = number_format($value); - } + if (!key_exists('bgColor', $general)) { + if (!key_exists('color', $general)) { + $general['bgColor'] = GameConst::$basecolor4; + } else { + $general['bgColor'] = $general['color']; + } + } + + if (!key_exists('fgColor', $general)) { + $general['fgColor'] = newColor($general['bgColor']); + } + + if (key_exists('picture', $general)) { + $imageTemp = GetImageURL($general['imgsvr']); + $general['pictureFullPath'] = "$imageTemp/{$general['picture']}"; + } else { + $general['pictureFullPath'] = GetImageURL(0) . "/default.jpg"; + } + + if (!key_exists('printValue', $general)) { + $value = $general['value']; + if ($typeValue == 'percent') { + $general['printValue'] = number_format($value * 100, 2) . '%'; + } else { + $general['printValue'] = number_format($value); + } + } + + return $general; + }, $hallResult); + + echo $templates->render('hallOfFrame', [ + 'typeName' => $typeDescribe, + 'generals' => $hallResult + ]); } - - return $general; - }, $hallResult); - - echo $templates->render('hallOfFrame', [ - 'typeName'=>$typeDescribe, - 'generals'=>$hallResult - ]); -} -?> -
- - - -
+ ?> +
+ + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/a_history.php b/hwe/a_history.php index dba2e153..cb4c9618 100644 --- a/hwe/a_history.php +++ b/hwe/a_history.php @@ -1,4 +1,5 @@ getValues(['startyear','year','month','map_theme']); +$admin = $gameStor->getValues(['startyear', 'year', 'month', 'map_theme']); $me = $db->queryFirstRow('SELECT con, turntime FROM general WHERE owner = %i', $userID); @@ -37,7 +38,7 @@ if ($con >= 2) { [$s_year, $s_month] = $db->queryFirstList('SELECT year, month FROM ng_history WHERE server_id = %s ORDER BY year ASC, month ASC LIMIT 1', $serverID); $s = $s_year * 12 + $s_month; -if($s_year === null){ +if ($s_year === null) { echo '인자 에러'; exit(); } @@ -45,19 +46,17 @@ if($s_year === null){ [$e_year, $e_month] = $db->queryFirstList('SELECT year, month FROM ng_history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', $serverID); $e = $e_year * 12 + $e_month; -if($serverID !== UniqueConst::$serverID){ - $mapTheme = $db->queryFirstField('SELECT map FROM ng_games WHERE server_id=%s', $serverID)?:'che'; -} -else{ - $mapTheme = $admin['map_theme']??'che'; +if ($serverID !== UniqueConst::$serverID) { + $mapTheme = $db->queryFirstField('SELECT map FROM ng_games WHERE server_id=%s', $serverID) ?: 'che'; +} else { + $mapTheme = $admin['map_theme'] ?? 'che'; } //FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요. -if($serverID !== UniqueConst::$serverID && !$yearmonth){ +if ($serverID !== UniqueConst::$serverID && !$yearmonth) { $year = $s_year; $month = $s_month; -} -else if (!$yearmonth) { +} else if (!$yearmonth) { $year = $admin['year']; $month = $admin['month'] - 1; } else { @@ -70,7 +69,7 @@ else if (!$yearmonth) { $month += 1; } } -$now = ($year*12) + $month; +$now = ($year * 12) + $month; if ($now < $s) { $now = $s; @@ -95,107 +94,124 @@ $nations = Json::decode($history['nations']); - - - -<?=UniqueConst::$serverName?>: 연감 - - - - - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 연감 + + + + + + + + + + + - - - -
연 감
-
- 연월 선택 : - - - - -
-
- - - - - - - - - - - - - - - - -
중 원 지 도
- - - - - - - - - - - - - - - - - - - - - - -
국명국력장수속령
;background-color:'>
-
중 원 정 세
- -
장 수 동 향
- -
- - - -
- + + + + + + + +
연 감
+
+ 연월 선택 : + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
중 원 지 도
+ + + + + + + + + + + + + + + + + + + + + + +
국명국력장수속령
;background-color:'>
+
중 원 정 세
+ +
장 수 동 향
+ +
+ + + + + + + +
+ - + + \ No newline at end of file diff --git a/hwe/a_kingdomList.php b/hwe/a_kingdomList.php index a9cec9d0..95f8e09d 100644 --- a/hwe/a_kingdomList.php +++ b/hwe/a_kingdomList.php @@ -1,4 +1,5 @@ queryFirstRow('SELECT con, turntime FROM general WHERE owner=%i', $userID); $con = checkLimit($me['con']); -if($con >= 2) { printLimitMsg($me['turntime']); exit(); } +if ($con >= 2) { + printLimitMsg($me['turntime']); + exit(); +} ?> - - - -<?=UniqueConst::$serverName?>: 세력일람 - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 세력일람 + + + + + + + - - -
세 력 일 람
- + + 세 력 일 람
+ + + $lhs['power'];}); + $nations = getAllNationStaticInfo(); + uasort($nations, function ($lhs, $rhs) { + return $rhs['power'] <=> $lhs['power']; + }); -$nations[0] = getNationStaticInfo(0); + $nations[0] = getNationStaticInfo(0); -foreach($db->query('SELECT npc,name,city,nation,officer_level,penalty,permission FROM general ORDER BY dedication DESC') as $general){ - $nationID = $general['nation']; + foreach ($db->query('SELECT npc,name,city,nation,officer_level,penalty,permission FROM general ORDER BY dedication DESC') as $general) { + $nationID = $general['nation']; - if(!key_exists('generals', $nations[$nationID])){ - $nations[$nationID]['generals'] = []; - } - $nations[$nationID]['generals'][] = $general; -} - -foreach ($db->queryAllLists('SELECT city, name, nation FROM city') as [$cityID, $cityName, $nationID]) { - if(!key_exists('cities', $nations[$nationID])){ - $nations[$nationID]['cities'] = []; - } - $nations[$nationID]['cities'][$cityID] = $cityName; -} - -foreach ($nations as $nation) { - if ($nation['nation'] == 0) { - //재야 도시, 장수 - continue; - } - $generals = $nation['generals']; - - $chiefs = []; - $ambassadors = []; - $auditors = []; - foreach($generals as $general){ - $officerLevel = $general['officer_level']; - if($officerLevel >= 5){ - $chiefs[$officerLevel] = $general; - } - $generalPermission = checkSecretPermission($general, false); - if($generalPermission == 4){ - $ambassadors[] = $general['name']; - } - else if($generalPermission == 3){ - $auditors[] = $general['name']; + if (!key_exists('generals', $nations[$nationID])) { + $nations[$nationID]['generals'] = []; } + $nations[$nationID]['generals'][] = $general; } - echo " + foreach ($db->queryAllLists('SELECT city, name, nation FROM city') as [$cityID, $cityName, $nationID]) { + if (!key_exists('cities', $nations[$nationID])) { + $nations[$nationID]['cities'] = []; + } + $nations[$nationID]['cities'][$cityID] = $cityName; + } + + foreach ($nations as $nation) { + if ($nation['nation'] == 0) { + //재야 도시, 장수 + continue; + } + $generals = $nation['generals']; + + $chiefs = []; + $ambassadors = []; + $auditors = []; + foreach ($generals as $general) { + $officerLevel = $general['officer_level']; + if ($officerLevel >= 5) { + $chiefs[$officerLevel] = $general; + } + $generalPermission = checkSecretPermission($general, false); + if ($generalPermission == 4) { + $ambassadors[] = $general['name']; + } else if ($generalPermission == 3) { + $auditors[] = $general['name']; + } + } + + echo " - + - + - + - + "; - for($chiefLevel = 12; $chiefLevel >= 5; $chiefLevel--){ - if($chiefLevel % 4 == 0){ - echo ''; - } - $chief = $chiefs[$chiefLevel]??['name'=>'-','npc'=>0]; - $officerLevelText = getOfficerLevelText($chiefLevel, $nation['level']); - $chiefText = getColoredName($chief['name'], $chief['npc']); - echo " + for ($chiefLevel = 12; $chiefLevel >= 5; $chiefLevel--) { + if ($chiefLevel % 4 == 0) { + echo ''; + } + $chief = $chiefs[$chiefLevel] ?? ['name' => '-', 'npc' => 0]; + $officerLevelText = getOfficerLevelText($chiefLevel, $nation['level']); + $chiefText = getColoredName($chief['name'], $chief['npc']); + echo ""; - } - echo " + } + echo " + echo join(', ', $ambassadors); + echo "
【 {$nation['name']} 】【 {$nation['name']} 】
성 향".getNationType($nation['type'])."" . getNationType($nation['type']) . " 작 위".getNationLevel($nation['level'])."" . getNationLevel($nation['level']) . " 국 력 {$nation['power']} 장수 / 속령{$nation['gennum']} / ".count($nation['cities']??[])."{$nation['gennum']} / " . count($nation['cities'] ?? []) . "
{$officerLevelText}
{$officerLevelText} {$chiefText}
외교권자"; - echo join(', ', $ambassadors); - echo "조언자"; - echo count($auditors).'명'; - echo "
조언자"; + echo count($auditors) . '명'; + echo "
"; - if($nation['level'] > 0) { - echo "속령 일람 : "; + if ($nation['level'] > 0) { + echo "속령 일람 : "; - foreach($nation['cities'] as $cityID => $cityName) { - if($cityID == $nation['capital']) { - echo "[{$cityName}], "; - } else { - echo "{$cityName}, "; + foreach ($nation['cities'] as $cityID => $cityName) { + if ($cityID == $nation['capital']) { + echo "[{$cityName}], "; + } else { + echo "{$cityName}, "; + } } - } - } else { - $cityName = CityConst::byID($chiefs[12]['city'])->name; + } else { + $cityName = CityConst::byID($chiefs[12]['city'])->name; - echo "현재 위치 : {$cityName}"; - } - echo" + echo "현재 위치 : {$cityName}"; + } + echo "
장수 일람 : "; - foreach($generals as $general){ - if($general['npc'] >= 2) { echo "{$general['name']}, "; } - elseif($general['npc'] == 1) { echo "{$general['name']}, "; } - else { echo "{$general['name']}, "; } - } - echo" + foreach ($generals as $general) { + if ($general['npc'] >= 2) { + echo "{$general['name']}, "; + } elseif ($general['npc'] == 1) { + echo "{$general['name']}, "; + } else { + echo "{$general['name']}, "; + } + } + echo "

"; -} + } -//재야 -echo " + //재야 + echo " @@ -163,33 +174,37 @@ echo " - +
【 재 야 】장 수 {$nations[0]['gennum']} 속 령".count($nations[0]['cities']??[])."" . count($nations[0]['cities'] ?? []) . "
속령 일람 : "; -foreach($nations[0]['cities']??[] as $cityName) { - echo "{$cityName}, "; -} -echo" + foreach ($nations[0]['cities'] ?? [] as $cityName) { + echo "{$cityName}, "; + } + echo "
장수 일람 : "; - foreach($nations[0]['generals'] as $general) { + foreach ($nations[0]['generals'] as $general) { $generalText = getColoredName($general['name'], $general['npc']); echo "{$generalText}, "; } - echo" + echo "
"; -?> + ?> - - - -
+ + + + + + + +
- + \ No newline at end of file diff --git a/hwe/a_npcList.php b/hwe/a_npcList.php index d7ede0d0..6d43dbd1 100644 --- a/hwe/a_npcList.php +++ b/hwe/a_npcList.php @@ -1,4 +1,5 @@ 8){ +if ($type <= 0 || $type > 8) { $type = 1; } @@ -22,112 +23,121 @@ $sel[$type] = "selected"; - - - -<?=UniqueConst::$serverName?>: 빙의일람 - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 빙의일람 + + + + + + + - - - -
빙 의 일 람
정렬순서 : - -
-
- + + 빙 의 일 람
+ + + +
정렬순서 : + + +
+ + + + query('SELECT npc,nation,name,owner_name,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1'); -$generalListFromPool = $db->query('SELECT npc,nation,name,owner_name,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general JOIN select_pool on general.no = select_pool.general_id where npc=0'); + $generalList = $db->query('SELECT npc,nation,name,owner_name,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1'); + $generalListFromPool = $db->query('SELECT npc,nation,name,owner_name,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general JOIN select_pool on general.no = select_pool.general_id where npc=0'); -if($generalListFromPool){ - $generalList = array_merge($generalListFromPool, $generalList); -} + if ($generalListFromPool) { + $generalList = array_merge($generalListFromPool, $generalList); + } -$sortType = [ - 1 => ['name', true], - 2 => ['nation', true], - 3 => ['sum', false], - 4 => ['leadership', false], - 5 => ['strength', false], - 6 => ['intel', false], - 7 => ['experience', false], - 8 => ['dedication', false], -]; + $sortType = [ + 1 => ['name', true], + 2 => ['nation', true], + 3 => ['sum', false], + 4 => ['leadership', false], + 5 => ['strength', false], + 6 => ['intel', false], + 7 => ['experience', false], + 8 => ['dedication', false], + ]; -[$sortKey, $isAsc] = $sortType[$type]; + [$sortKey, $isAsc] = $sortType[$type]; -if($isAsc){ - usort($generalList, function($lhs, $rhs)use($sortKey){ - return $lhs[$sortKey] <=> $rhs[$sortKey]; - }); -} -else{ - usort($generalList, function($lhs, $rhs)use($sortKey){ - return $rhs[$sortKey] <=> $lhs[$sortKey]; - }); -} + if ($isAsc) { + usort($generalList, function ($lhs, $rhs) use ($sortKey) { + return $lhs[$sortKey] <=> $rhs[$sortKey]; + }); + } else { + usort($generalList, function ($lhs, $rhs) use ($sortKey) { + return $rhs[$sortKey] <=> $lhs[$sortKey]; + }); + } -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
희생된 장수악령 이름레벨국가성격특기종능통솔무력지력명성계급
Lv /
- - - -
+ ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
희생된 장수악령 이름레벨국가성격특기종능통솔무력지력명성계급
Lv /
+ + + + + + + +
- + \ No newline at end of file diff --git a/hwe/a_status.php b/hwe/a_status.php index 031cb9e8..667161af 100644 --- a/hwe/a_status.php +++ b/hwe/a_status.php @@ -1,4 +1,5 @@ map_theme??'che'; +$mapTheme = $gameStor->map_theme ?? 'che'; $me = $db->queryFirstRow('SELECT con,turntime from general where owner=%i', $userID); $con = checkLimit($me['con']); -if($con >= 2) { printLimitMsg($me['turntime']); exit(); } +if ($con >= 2) { + printLimitMsg($me['turntime']); + exit(); +} ?> + - - - -<?=UniqueConst::$serverName?>: 세력도 - - - - - - - - - - - - + }); + + + + + + - - -
세 력 도
- - - - - - - - -
- - - -
- -
- - - -
+ + + + +
세 력 도
+ + + + + + + + +
+ + + +
+ +
+ + + + + + + +
- + \ No newline at end of file diff --git a/hwe/a_traffic.php b/hwe/a_traffic.php index 856e9951..615e76df 100644 --- a/hwe/a_traffic.php +++ b/hwe/a_traffic.php @@ -1,4 +1,5 @@ getValues(['year','month','refresh','maxrefresh','maxonline']); +$admin = $gameStor->getValues(['year', 'month', 'refresh', 'maxrefresh', 'maxonline']); -$log = getRawFileLogRecent(__DIR__.'/logs/'.UniqueConst::$serverID.'/_traffic.txt', 11, 100); +$log = getRawFileLogRecent(__DIR__ . '/logs/' . UniqueConst::$serverID . '/_traffic.txt', 11, 100); $date = []; $year = []; @@ -20,7 +21,7 @@ $refresh = []; $online = []; $curonline = getOnlineNum(); -foreach($log as $i=>$value){ +foreach ($log as $i => $value) { $parse = Json::decode($value); $date[$i] = $parse[0]; $year[$i] = $parse[1]; @@ -47,155 +48,183 @@ if ($admin['maxonline'] < $curonline) { ?> + -<?=UniqueConst::$serverName?>: 트래픽정보 - - - - - - - - - - - + .little_bar { + float: left; + position: relative; + height: 17px; + } + + span.out_bar { + line-height: 30px; + margin-left: 1ch; + } + + - - -
트 래 픽 정 보
-
- -
- - -$value){ - $w = round($value / $admin['maxrefresh'] * 100, 1); - $color = getTrafficColor($w); - $dt = substr($date[$i], 11, 5); ?> - - - - - - -
접 속 량
- - - -
- -
- + + + + +
트 래 픽 정 보
+
+ + + + + +
+ + + + + $value) { + $w = round($value / $admin['maxrefresh'] * 100, 1); + $color = getTrafficColor($w); + $dt = substr($date[$i], 11, 5); ?> + + + + + + + + + + + + + + + +
+ 접 속 량 +
+ + + +
+ +
+ +
최고기록:
+
+ + + + + $value) { + $w = round($value / $admin['maxonline'] * 100, 1); + $color = getTrafficColor($w); + $dt = substr($date[$i], 11, 5); ?> + + + + + + + + + + + + + +
+ 접 속 자 +
+ + + +
+ +
+ + +
최고기록:
+
+
+ + + + + queryFirstRow('SELECT sum(refresh) as refresh, sum(`connect`) as `connect` from general'); + $max_refresh['name'] = '접속자 총합'; + + $refresh_result = array_merge([$max_refresh], $db->query('SELECT `name`,refresh,`connect` FROM general ORDER BY refresh DESC LIMIT 5')); + + foreach ($refresh_result as $i => $user) { + $w = round($user['refresh'] / max(1, $max_refresh['refresh']) * 100, 1); + $w2 = round(100 - $w, 1); + $color = getTrafficColor($w); + ?> + + + + - - - - - - - -
+ 주 의 대 상 자 (순간과도갱신) +
() + + +
+ +
+
최고기록:
-
- - -$value){ - $w = round($value / $admin['maxonline'] * 100, 1); - $color = getTrafficColor($w); - $dt = substr($date[$i], 11, 5); ?> - - - - - - - - - - - -
접 속 자
- - - -
- -
- - -
최고기록:
-
-
- - -queryFirstRow('SELECT sum(refresh) as refresh, sum(`connect`) as `connect` from general'); -$max_refresh['name'] = '접속자 총합'; - -$refresh_result = array_merge([$max_refresh], $db->query('SELECT `name`,refresh,`connect` FROM general ORDER BY refresh DESC LIMIT 5')); - -foreach ($refresh_result as $i=>$user) { - $w = round($user['refresh'] / max(1, $max_refresh['refresh']) * 100, 1); - $w2 = round(100 - $w, 1); - $color = getTrafficColor($w); -?> - - - - - - -
주 의 대 상 자 (순간과도갱신)
() - - -
- -
- -
-
- - - -
+ +
+
+ + + + + + + +
+ acl[DB::prefix()]??[]); +$isVoteAdmin = in_array('vote', $session->acl[DB::prefix()] ?? []); $isVoteAdmin = $isVoteAdmin || $session->userGrade >= 5; $me = $db->queryFirstRow('SELECT no,vote from general where owner=%i', $userID); -$admin = $gameStor->getValues(['develcost','voteopen','vote_title','vote','votecomment']); -$vote_title = $admin['vote_title']??'-'; -$vote = $admin['vote']?:['-']; +$admin = $gameStor->getValues(['develcost', 'voteopen', 'vote_title', 'vote', 'votecomment']); +$vote_title = $admin['vote_title'] ?? '-'; +$vote = $admin['vote'] ?: ['-']; ?> + -<?=UniqueConst::$serverName?>: 설문조사 - - - - - - - - - - - - + <?= UniqueConst::$serverName ?>: 설문조사 + + + + + + + + + + + + - - - -
설 문 조 사
- - - - +
설 문 조 사 (금과 추첨으로 유니크템 증정!)
+ + + +
설 문 조 사
+ + + + + + "; -} + } -$vote_title = Tag2Code($vote_title); -echo " + $vote_title = Tag2Code($vote_title); + echo " "; -$voteCount = $db->queryFirstField('SELECT count(no) FROM general WHERE vote>0 AND npc<2'); -$allCount = $db->queryFirstField('SELECT count(no) FROM general WHERE npc<2'); + $voteCount = $db->queryFirstField('SELECT count(no) FROM general WHERE vote>0 AND npc<2'); + $allCount = $db->queryFirstField('SELECT count(no) FROM general WHERE npc<2'); -$percentage = round($voteCount / $allCount * 100, 1); + $percentage = round($voteCount / $allCount * 100, 1); -$voteTypeCount = count($vote); -for ($i=1; $i < $voteTypeCount; $i++) { - echo " + $voteTypeCount = count($vote); + for ($i = 1; $i < $voteTypeCount; $i++) { + echo " - + "; -} + } -echo " + echo " "; -if ($me['vote'] == 0 && $me['no'] > 0) { - echo " + if ($me['vote'] == 0 && $me['no'] > 0) { + echo " "; -} else { - echo " + } else { + echo " "; -} -echo " + } + echo " "; -if ($isVoteAdmin) { - echo " + if ($isVoteAdmin) { + echo " "; -} + } -if ($admin['votecomment']) { - $comment = $admin['votecomment']; - $commentCount = count($comment); -} else { - $commentCount = 0; -} -echo " + if ($admin['votecomment']) { + $comment = $admin['votecomment']; + $commentCount = count($comment); + } else { + $commentCount = 0; + } + echo "
+ 설 문 조 사 (금과 추첨으로 유니크템 증정!) +
제 목  {$vote_title}
{$i}.{$i}. "; - if ($me['vote'] == 0 && $me['no'] > 0) { - echo " + if ($me['vote'] == 0 && $me['no'] > 0) { + echo " "; - } elseif ($admin['voteopen'] >= 1 || $isVoteAdmin) { - $vCount = $db->queryFirstField('SELECT count(no) FROM general WHERE vote=%i', $i); + } elseif ($admin['voteopen'] >= 1 || $isVoteAdmin) { + $vCount = $db->queryFirstField('SELECT count(no) FROM general WHERE vote=%i', $i); - $per = @round($vCount / $voteCount * 100, 1); - echo "{$vCount} 표 ({$per}%)"; - } else { - echo "추후공개"; - } - $vote[$i] = Tag2Code($vote[$i]); - echo " + $per = @round($vCount / $voteCount * 100, 1); + echo "{$vCount} 표 ({$per}%)"; + } else { + echo "추후공개"; + } + $vote[$i] = Tag2Code($vote[$i]); + echo "  {$vote[$i]}
투표 결산 투표율 : {$voteCount} / {$allCount} ({$percentage} %)
"; -for ($i=0; $i < $commentCount; $i++) { - $cmt = $comment[$i]; - $cmt[2] = Tag2Code($cmt[2]); - $j = $i+1; - echo " + for ($i = 0; $i < $commentCount; $i++) { + $cmt = $comment[$i]; + $cmt[2] = Tag2Code($cmt[2]); + $j = $i + 1; + echo " @@ -167,202 +176,205 @@ for ($i=0; $i < $commentCount; $i++) { "; -} -if ($me['no'] > 0) { - echo " + } + if ($me['no'] > 0) { + echo " "; -} -?> -
댓 글
{$j}. {$cmt[0]} {$cmt[2]}
-
-
- -
- 전 체 통 계 - +
+
+ + + "; -if ($admin['voteopen'] >= 1 || $isVoteAdmin) { - echo " + if ($admin['voteopen'] >= 1 || $isVoteAdmin) { + echo " "; -} + } -if ($admin['voteopen'] >= 2 || $isVoteAdmin) { - $memCount = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=0 AND npc <2'); - if ($memCount == 0) { - $memCount = 1; - } + if ($admin['voteopen'] >= 2 || $isVoteAdmin) { + $memCount = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=0 AND npc <2'); + if ($memCount == 0) { + $memCount = 1; + } - if (!isset($nationVoteCount[0])) { - $nationVoteCount[0] = 0; - } - $percentage = round($nationVoteCount[0] / $memCount * 100, 1); + if (!isset($nationVoteCount[0])) { + $nationVoteCount[0] = 0; + } + $percentage = round($nationVoteCount[0] / $memCount * 100, 1); - echo " + echo " "; - foreach($db->query('SELECT nation,color,name,gennum from nation order by gennum desc') as $i=>$nation){ - $memCount = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc<2', $nation['nation']); + foreach ($db->query('SELECT nation,color,name,gennum from nation order by gennum desc') as $i => $nation) { + $memCount = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc<2', $nation['nation']); - $voteCount = $nationVoteCount[$nation['nation']] ?? 0; - if($memCount == 0){ - $percentage = 100; - } - else{ - $percentage = round($voteCount / $memCount * 100, 1); - } + $voteCount = $nationVoteCount[$nation['nation']] ?? 0; + if ($memCount == 0) { + $percentage = 100; + } else { + $percentage = round($voteCount / $memCount * 100, 1); + } - echo " + echo " - + "; - } -} -?> - -
+ + 전 체 통 계 + "; -} -echo " + } + echo "
전 체 {$voteCount} / {$allCount} ({$percentage} %) "; - $memCount = max(1, $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2')); + $memCount = max(1, $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2')); - $totalVote = []; - $nationVoteCount = []; - $nationVote = []; + $totalVote = []; + $nationVoteCount = []; + $nationVote = []; - foreach ($db->query("SELECT nation, vote, count(`no`) as cnt FROM general WHERE npc<2 GROUP BY nation, vote") as $row) { - $nation = $row['nation']; - $ownVote = $row['vote']; - $cnt = $row['cnt']; + foreach ($db->query("SELECT nation, vote, count(`no`) as cnt FROM general WHERE npc<2 GROUP BY nation, vote") as $row) { + $nation = $row['nation']; + $ownVote = $row['vote']; + $cnt = $row['cnt']; - if (!isset($totalVote[$ownVote])) { - $totalVote[$ownVote] = 0; - } + if (!isset($totalVote[$ownVote])) { + $totalVote[$ownVote] = 0; + } - if (!isset($nationVoteCount[$nation])) { - $nationVoteCount[$nation] = 0; - $nationVote[$nation] = []; - } + if (!isset($nationVoteCount[$nation])) { + $nationVoteCount[$nation] = 0; + $nationVote[$nation] = []; + } - if (!isset($nationVote[$nation][$ownVote])) { - $nationVote[$nation][$ownVote] = 0; - } + if (!isset($nationVote[$nation][$ownVote])) { + $nationVote[$nation][$ownVote] = 0; + } - $totalVote[$ownVote] += $cnt; - $nationVoteCount[$nation] += $cnt; - $nationVote[$nation][$ownVote] += $cnt; - } + $totalVote[$ownVote] += $cnt; + $nationVoteCount[$nation] += $cnt; + $nationVote[$nation][$ownVote] += $cnt; + } - $totalPer = 0; - for ($i=0; $i < $voteTypeCount; $i++) { - $per = round(($totalVote[$i]??0) * 100 / $memCount, 1); - if($i == $voteTypeCount-1){ - $per = 100-$totalPer; - } - else{ - $totalPer += $per; - } + $totalPer = 0; + for ($i = 0; $i < $voteTypeCount; $i++) { + $per = round(($totalVote[$i] ?? 0) * 100 / $memCount, 1); + if ($i == $voteTypeCount - 1) { + $per = 100 - $totalPer; + } else { + $totalPer += $per; + } -// if($per < 5) { $vote['cnt'] = " "; } -?> - - -
- -
- - + + +
+ +
+ +
재 야 {$nationVoteCount[0]} / {$memCount} ({$percentage} %) "; - $totalPer = 0; - for ($i=0; $i < $voteTypeCount; $i++) { - $per = round(Util::array_get($nationVote[0][$i], 0) / $memCount * 100, 1); - if($i == $voteTypeCount-1){ - $per = 100-$totalPer; - } - else{ - $totalPer += $per; - } -// if($per < 5) { $vote['cnt'] = " "; } -?> - - -
- -
- - + + +
+ +
+ +
{$nation['name']}{$nation['name']} {$voteCount} / {$memCount} ({$percentage} %) "; - $totalPer = 0; - for ($k=0; $k < $voteTypeCount; $k++) { - if($memCount == 0){ - $per = 0; - continue; - } + $totalPer = 0; + for ($k = 0; $k < $voteTypeCount; $k++) { + if ($memCount == 0) { + $per = 0; + continue; + } - $per = round(($nationVote[$nation['nation']][$k]??0) / $memCount * 100, 1); + $per = round(($nationVote[$nation['nation']][$k] ?? 0) / $memCount * 100, 1); - if($i == $voteTypeCount-1){ - $per = 100-$totalPer; - } - else{ - $totalPer += $per; - } + if ($i == $voteTypeCount - 1) { + $per = 100 - $totalPer; + } else { + $totalPer += $per; + } -// if($per < 5) { $vote['cnt'] = " "; } -?> - - -
- -
- - + + +
+ +
+ +
- - - -
+ } + } + ?> + + + + + + + + + +
+ - -<?=UniqueConst::$serverName?>: 거래장 - - - - - - - - - - - - - - - -
거 래 장
거 래 장
- - - - - - - - - - - - - - - - -query('SELECT * from auction where type=0 order by expire') as $auction){ - $radio = ""; - $alert = ""; - $alert2 = ""; - if ($auction['no1'] == $me['no']) { - $radio = " disabled"; - } elseif ($auction['no2'] > 0 && $auction['amount'] * 2 <= $auction['value']) { - $radio = " disabled"; - $alert = ""; - $alert2 = ""; - } elseif ($auction['no2'] > 0 && $auction['topv'] <= $auction['value']) { - $radio = " disabled"; - $alert = ""; - $alert2 = ""; - } elseif ($chk == 0) { - $radio = " checked"; - $chk = 1; - } - $pv = round($auction['value'] * 100 / $auction['amount']) / 100 + 0.001; - $pv = substr((string)$pv, 0, 4); - echo " + + <?= UniqueConst::$serverName ?>: 거래장 + + + + + + + + + + + + + +
팝 니 다
거래번호선택판매자물품수량시작판매가현재판매가즉시판매가단가구매 예정자거래종료
+ + + + + + +
거 래 장
+ 거 래 장 +
+ + + + + + + + + + + + + + + + + + + query('SELECT * from auction where type=0 order by expire') as $auction) { + $radio = ""; + $alert = ""; + $alert2 = ""; + if ($auction['no1'] == $me['no']) { + $radio = " disabled"; + } elseif ($auction['no2'] > 0 && $auction['amount'] * 2 <= $auction['value']) { + $radio = " disabled"; + $alert = ""; + $alert2 = ""; + } elseif ($auction['no2'] > 0 && $auction['topv'] <= $auction['value']) { + $radio = " disabled"; + $alert = ""; + $alert2 = ""; + } elseif ($chk == 0) { + $radio = " checked"; + $chk = 1; + } + $pv = round($auction['value'] * 100 / $auction['amount']) / 100 + 0.001; + $pv = substr((string)$pv, 0, 4); + + echo " @@ -116,79 +129,83 @@ foreach($db->query('SELECT * from auction where type=0 order by expire') as $auc "; -} -?> - - - - - - - - - - - - - - - - -
+ 팝 니 다 +
거래번호선택판매자물품수량시작판매가현재판매가즉시판매가단가구매 예정자거래종료
{$auction['no']} {$auction['expire']}
등록결과
입찰등록 -  지불할 금액: - name=btn value='구매시도' onclick='return confirm("정말 입찰하시겠습니까?");'> -
거래등록 -  종료: 턴 후 -  물품: 쌀 -  판매량: -  시작가: -  즉구가: - name=btn value='판매' onclick='return confirm("정말 판매하시겠습니까?");'> -
- ㆍHint) 거래자가 판매(물품 판매, 금 수령), 입찰자가 구매(물품 구입, 금 지불).
- ㆍHint) 단가가 1.00보다 높을수록 판매자 유리.
- ㆍHint) 단가가 1.00보다 낮을수록 입찰자 유리.
-
-
- - - - - - - - - - - - - - - - -query('SELECT * from auction where type=1 order by expire') as $auction){ - $radio = ""; - $alert = ""; - $alert2 = ""; - if ($auction['no1'] == $me['no']) { - $radio = " disabled"; - } elseif ($auction['no2'] > 0 && $auction['amount'] >= $auction['value'] * 2) { - $radio = " disabled"; - $alert = ""; - $alert2 = ""; - } elseif ($auction['no2'] > 0 && $auction['topv'] >= $auction['value']) { - $radio = " disabled"; - $alert = ""; - $alert2 = ""; - } elseif ($chk == 0) { - $radio = " checked"; - $chk = 1; - } - $pv = round($auction['value'] * 100 / $auction['amount']) / 100 + 0.001; - $pv = substr((string)$pv, 0, 4); - echo " + } + ?> + + + + + + + + + + + + + + + + +
삽 니 다
거래번호선택구매자물품수량시작구매가현재구매가즉시구매가단가판매 예정자거래종료
등록결과
입찰등록 +  지불할 금액: + name=btn value='구매시도' onclick='return confirm("정말 입찰하시겠습니까?");'> +
거래등록 +  종료: 턴 후 +  물품: 쌀 +  판매량: +  시작가: +  즉구가: + name=btn value='판매' onclick='return confirm("정말 판매하시겠습니까?");'> +
+ ㆍHint) 거래자가 판매(물품 판매, 금 수령), 입찰자가 구매(물품 구입, 금 지불).
+ ㆍHint) 단가가 1.00보다 높을수록 판매자 유리.
+ ㆍHint) 단가가 1.00보다 낮을수록 입찰자 유리.
+
+
+ + + + + + + + + + + + + + + + + + + query('SELECT * from auction where type=1 order by expire') as $auction) { + $radio = ""; + $alert = ""; + $alert2 = ""; + if ($auction['no1'] == $me['no']) { + $radio = " disabled"; + } elseif ($auction['no2'] > 0 && $auction['amount'] >= $auction['value'] * 2) { + $radio = " disabled"; + $alert = ""; + $alert2 = ""; + } elseif ($auction['no2'] > 0 && $auction['topv'] >= $auction['value']) { + $radio = " disabled"; + $alert = ""; + $alert2 = ""; + } elseif ($chk == 0) { + $radio = " checked"; + $chk = 1; + } + $pv = round($auction['value'] * 100 / $auction['amount']) / 100 + 0.001; + $pv = substr((string)$pv, 0, 4); + echo " @@ -203,73 +220,90 @@ foreach($db->query('SELECT * from auction where type=1 order by expire') as $auc "; -} -?> - - - - - - - - - - - - - - - - -
+ 삽 니 다 +
거래번호선택구매자물품수량시작구매가현재구매가즉시구매가단가판매 예정자거래종료
{$auction['no']} {$auction['expire']}
등록결과
입찰등록 -  수령할 금액: - name=btn value='판매시도' onclick='return confirm("정말 입찰하시겠습니까?");'> -
거래등록 -  종료: 턴 후 -  물품: 쌀 -  구입량: -  시작가: -  즉구가: - name=btn value='구매' onclick='return confirm("정말 구매하시겠습니까?");'> -
- ㆍHint) 거래자가 구매(물품 구매, 금 지불), 입찰자가 판매(물품 판매, 금 수령).
- ㆍHint) 단가가 1.00보다 낮을수록 구매자 유리.
- ㆍHint) 단가가 1.00보다 높을수록 입찰자 유리.
-
-
- - - - - - - -
최 근 기 록
- -
도 움 말
- -ㆍ판매거래는 거래자가 판매할 물품을 거래하면, 구입을 희망하는 사람이 현재가보다 높게 입찰하여 구입하는 방식입니다.
-ㆍHint) 쌀이 귀한 경우는 입찰자가 많아서 자연스레 단가가 오르게 됩니다. (해당 물품을 사려는 가격이 오름)
-ㆍHint) 쌀이 흔한 경우는 초기 가격을 낮게 책정해야 판매가 가능할 겁니다.
-ㆍ구매거래는 거래자가 구입할 물품을 거래하면, 판매를 희망하는 사람이 현재가보다 낮게 입찰하여 판매하는 방식입니다.
-ㆍHint) 쌀이 흔한 경우는 입찰자가 많아서 자연스레 단가가 내리게 됩니다. (해당 물품을 팔려는 가격이 내림)
-ㆍHint) 쌀이 귀한 경우는 초기 가격을 높게 책정해야 구입이 가능할 겁니다.
-ㆍ마감임박때 입찰하는 경우 입찰후 1턴 후로 종료시간이 연장됩니다.
-ㆍ즉시구매가로 입찰하는 경우 입찰후 1턴 후로 종료시간이 결정됩니다.
-ㆍ악용 방지를 위해 50% ~ 200%의 가격에서 거래시작이 가능합니다.
-ㆍ악용 방지를 위해 즉시판매가는 110% 이상, 즉시구매가는 90% 이하의 시세로 가능합니다.
-ㆍ악용 방지를 위해 즉시판매가는 시작판매가의 110% 이상, 즉시구매가는 시작구매가의 90% 이하로 가능합니다.
-ㆍ1인당 도합 1건의 거래와 입찰이 가능합니다.
-ㆍ기본금쌀 1000은 거래에 사용되지 못합니다.
-ㆍ유찰될 때는 거래 과실자에게 거래금의 1%가 벌금으로 부과됩니다.
-ㆍ10단위로 거래가 가능합니다. 1자리는 반올림 처리 됩니다.
-ㆍ★ 최고가 거래 ★ 혹은 ★ 최저가 거래 ★ 는 암거래 및 악용의 가능성이니 감시 부탁드립니다.
-ㆍ거래와 입찰은 취소가 불가능하니 주의하세요!
-ㆍHint) 단가는 금/쌀로 쌀1을 거래하기 위한 금의 양입니다.
-ㆍHint) 단가가 높으면(>1.00) 쌀이 비싸므로 판매가 이득입니다.
-ㆍHint) 단가가 낮으면(<1.00) 금이 비싸므로 구매가 이득입니다.
-ㆍ즐거운 거래! -
-
+ } + ?> + + 등록결과 + + + + 입찰등록 + +  수령할 금액: + name=btn value='판매시도' onclick='return confirm("정말 입찰하시겠습니까?");'> + + + + 거래등록 + +  종료: 턴 후 +  물품: 쌀 +  구입량: +  시작가: +  즉구가: + name=btn value='구매' onclick='return confirm("정말 구매하시겠습니까?");'> + + + + + ㆍHint) 거래자가 구매(물품 구매, 금 지불), 입찰자가 판매(물품 판매, 금 수령).
+ ㆍHint) 단가가 1.00보다 낮을수록 구매자 유리.
+ ㆍHint) 단가가 1.00보다 높을수록 입찰자 유리.
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ 최 근 기 록 +
+ +
+ 도 움 말 +
+ + ㆍ판매거래는 거래자가 판매할 물품을 거래하면, 구입을 희망하는 사람이 현재가보다 높게 입찰하여 구입하는 방식입니다.
+ ㆍHint) 쌀이 귀한 경우는 입찰자가 많아서 자연스레 단가가 오르게 됩니다. (해당 물품을 사려는 가격이 오름)
+ ㆍHint) 쌀이 흔한 경우는 초기 가격을 낮게 책정해야 판매가 가능할 겁니다.
+ ㆍ구매거래는 거래자가 구입할 물품을 거래하면, 판매를 희망하는 사람이 현재가보다 낮게 입찰하여 판매하는 방식입니다.
+ ㆍHint) 쌀이 흔한 경우는 입찰자가 많아서 자연스레 단가가 내리게 됩니다. (해당 물품을 팔려는 가격이 내림)
+ ㆍHint) 쌀이 귀한 경우는 초기 가격을 높게 책정해야 구입이 가능할 겁니다.
+ ㆍ마감임박때 입찰하는 경우 입찰후 1턴 후로 종료시간이 연장됩니다.
+ ㆍ즉시구매가로 입찰하는 경우 입찰후 1턴 후로 종료시간이 결정됩니다.
+ ㆍ악용 방지를 위해 50% ~ 200%의 가격에서 거래시작이 가능합니다.
+ ㆍ악용 방지를 위해 즉시판매가는 110% 이상, 즉시구매가는 90% 이하의 시세로 가능합니다.
+ ㆍ악용 방지를 위해 즉시판매가는 시작판매가의 110% 이상, 즉시구매가는 시작구매가의 90% 이하로 가능합니다.
+ ㆍ1인당 도합 1건의 거래와 입찰이 가능합니다.
+ ㆍ기본금쌀 1000은 거래에 사용되지 못합니다.
+ ㆍ유찰될 때는 거래 과실자에게 거래금의 1%가 벌금으로 부과됩니다.
+ ㆍ10단위로 거래가 가능합니다. 1자리는 반올림 처리 됩니다.
+ ㆍ★ 최고가 거래 ★ 혹은 ★ 최저가 거래 ★ 는 암거래 및 악용의 가능성이니 감시 부탁드립니다.
+ ㆍ거래와 입찰은 취소가 불가능하니 주의하세요!
+ ㆍHint) 단가는 금/쌀로 쌀1을 거래하기 위한 금의 양입니다.
+ ㆍHint) 단가가 높으면(>1.00) 쌀이 비싸므로 판매가 이득입니다.
+ ㆍHint) 단가가 낮으면(<1.00) 금이 비싸므로 구매가 이득입니다.
+ ㆍ즐거운 거래! +
+
- + + \ No newline at end of file diff --git a/hwe/b_battleCenter.php b/hwe/b_battleCenter.php index 6ace18a1..46184e62 100644 --- a/hwe/b_battleCenter.php +++ b/hwe/b_battleCenter.php @@ -1,4 +1,5 @@ rule('required', 'gen') -->rule('integer', 'gen'); + ->rule('integer', 'gen'); $btn = Util::getReq('btn'); $gen = Util::getReq('gen', 'int', 0); @@ -14,24 +15,24 @@ $reqQueryType = Util::getReq('query_type', 'string', null); // $queryTypeText, $reqArgType(0=>None, 1=>AdditionalColumn, 2=>rankVal, 3=>aux), $comp $queryMap = [ - 'turntime' => ['최근턴', 0, function($lhs, $rhs){ - return -($lhs['turntime']<=>$rhs['turntime']); + 'turntime' => ['최근턴', 0, function ($lhs, $rhs) { + return - ($lhs['turntime'] <=> $rhs['turntime']); }], - 'recent_war' => ['최근전투', 1, function($lhs, $rhs){ - return -($lhs['recent_war']<=>$rhs['recent_war']); + 'recent_war' => ['최근전투', 1, function ($lhs, $rhs) { + return - ($lhs['recent_war'] <=> $rhs['recent_war']); }], - 'name' => ['장수명', 0, function($lhs, $rhs){ - if($lhs['npc'] !== $rhs['npc']){ - return $lhs['npc']<=>$rhs['npc']; + 'name' => ['장수명', 0, function ($lhs, $rhs) { + if ($lhs['npc'] !== $rhs['npc']) { + return $lhs['npc'] <=> $rhs['npc']; } - return $lhs['name']<=>$rhs['name']; + return $lhs['name'] <=> $rhs['name']; }], - 'warnum' => ['전투수', 2, function($lhs, $rhs){ - return -($lhs['warnum']<=>$rhs['warnum']); + 'warnum' => ['전투수', 2, function ($lhs, $rhs) { + return - ($lhs['warnum'] <=> $rhs['warnum']); }] ]; -if($reqQueryType === null || !key_exists($reqQueryType, $queryMap)){ +if ($reqQueryType === null || !key_exists($reqQueryType, $queryMap)) { $reqQueryType = Util::array_first_key($queryMap); } @@ -60,11 +61,10 @@ if ($con >= 2) { } $permission = checkSecretPermission($me); -if($permission < 0){ +if ($permission < 0) { echo '국가에 소속되어있지 않습니다.'; die(); -} -else if ($permission < 1) { +} else if ($permission < 1) { echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다."; die(); } @@ -80,34 +80,33 @@ if ($btn == '정렬하기') { [$queryTypeText, $reqArgType, $comp] = $queryMap[$reqQueryType]; -if($reqArgType===0){ +if ($reqArgType === 0) { $generalBasicList = $db->query('SELECT no, name, npc, turntime, officer_level FROM general WHERE nation = %i', $nationID); -} -else if($reqArgType===1){ +} else if ($reqArgType === 1) { $generalBasicList = $db->query('SELECT no, name, npc, turntime, officer_level, %b FROM general WHERE nation = %i', $reqQueryType, $nationID); -} -else if($reqArgType===2){ - $generalBasicList = $db->query('SELECT no, name, npc, turntime, officer_level, value as %b +} else if ($reqArgType === 2) { + $generalBasicList = $db->query( + 'SELECT no, name, npc, turntime, officer_level, value as %b FROM general LEFT JOIN rank_data ON general.no = rank_data.general_id WHERE rank_data.type = %s AND general.nation = %i', - $reqQueryType, $reqQueryType, $nationID + $reqQueryType, + $reqQueryType, + $nationID ); -} -else if($reqArgType===3){ - $generalBasicList = array_map(function($arr){ +} else if ($reqArgType === 3) { + $generalBasicList = array_map(function ($arr) { $arr['aux'] = Json::decode($arr['aux']); return $arr; }, $db->query('SELECT no, name, npc, turntime, officer_level, aux FROM general WHERE nation = %i', $nationID)); -} -else{ +} else { throw new \sammo\MustNotBeReachedException(); } usort($generalBasicList, $comp); -if(!$gen){ +if (!$gen) { $gen = $generalBasicList[0]['no']; } $showGeneral = General::createGeneralObjFromDB($gen); @@ -116,84 +115,106 @@ $showGeneral = General::createGeneralObjFromDB($gen); -<?=UniqueConst::$serverName?>: 감찰부 - - - - - - - - - - + <?= UniqueConst::$serverName ?>: 감찰부 + + + + + + + + + + - - - -
감 찰 부
-
- 정렬순서 : - - - 대상장수 : - - -
-
- - - - - - - - - - - - - - - - - -getNPCType() > 1 || $permission >= 2): ?> - - - - - - - - - -
장 수 정 보장 수 열 전
- - - -
전투 기록전투 결과
- - - -
개인 기록 
- - -
- - - -
+ + + + + + + +
감 찰 부
+
+ 정렬순서 : + + + 대상장수 : + + +
+
+ + + + + + + + + + + + + + + + + + getNPCType() > 1 || $permission >= 2) : ?> + + + + + + + + + +
+ 장 수 정 보 + + 장 수 열 전 +
+ + + +
+ 전투 기록 + + 전투 결과 +
+ + + +
+ 개인 기록 + +   +
+ + +
+ + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/b_betting.php b/hwe/b_betting.php index 58a4a2a6..aacb141f 100644 --- a/hwe/b_betting.php +++ b/hwe/b_betting.php @@ -1,4 +1,5 @@ queryFirstRow('SELECT no,tournament,con,turntime from general where o $myBetTotal = array_sum($myBet); $globalBetTotal = array_sum($globalBet); -$admin = $gameStor->getValues(['tournament','phase','tnmt_type','develcost']); +$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'develcost']); $con = checkLimit($me['con']); if ($con >= 2) { @@ -35,21 +36,42 @@ if ($con >= 2) { } switch ($admin['tnmt_type']) { -default: throw new \RuntimeException('Invalid tnmt_type'); -case 0: $tnmt_type = "전력전"; $tp = "total"; $tp2 = "종합"; $tp3 = "total"; break; -case 1: $tnmt_type = "통솔전"; $tp = "leadership"; $tp2 = "통솔"; $tp3 = "leadership"; break; -case 2: $tnmt_type = "일기토"; $tp = "strength"; $tp2 = "무력"; $tp3 = "strength"; break; -case 3: $tnmt_type = "설전"; $tp = "intel"; $tp2 = "지력"; $tp3 = "intel"; break; + default: + throw new \RuntimeException('Invalid tnmt_type'); + case 0: + $tnmt_type = "전력전"; + $tp = "total"; + $tp2 = "종합"; + $tp3 = "total"; + break; + case 1: + $tnmt_type = "통솔전"; + $tp = "leadership"; + $tp2 = "통솔"; + $tp3 = "leadership"; + break; + case 2: + $tnmt_type = "일기토"; + $tp = "strength"; + $tp2 = "무력"; + $tp3 = "strength"; + break; + case 3: + $tnmt_type = "설전"; + $tp = "intel"; + $tp2 = "지력"; + $tp3 = "intel"; + break; } $str1 = getTournament($admin['tournament']); $str2 = getTournamentTime(); -if($str2){ - $str2 = ', '.$str2; +if ($str2) { + $str2 = ', ' . $str2; } $str3 = getTournamentTerm(); -if($str3){ - $str3 = ', '.$str3; +if ($str3) { + $str3 = ', ' . $str3; } ?> @@ -58,306 +80,349 @@ if($str3){ + - - - -<?=UniqueConst::$serverName?>: 베팅장 - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 베팅장 + + + + + + + - - -
베 팅 장
- - - - -
()
16강 상황
(전체 금액 : / 내 투자 금액 : )
- - - -query('SELECT npc,name,win from tournament where grp>=60 order by grp, grp_no LIMIT 1'); -while(count($generalList) < 1){ - $generalList[] = [ - 'name'=>'-', - 'npc'=>0, - 'win'=>0 - ]; -} -foreach($generalList as $i=>$general){ - if ($general['name'] == "") { - $general['name'] = "-"; - } - if ($general['npc'] >= 2) { - $general['name'] = "".$general['name'].""; - } elseif ($general['npc'] == 1) { - $general['name'] = "".$general['name'].""; - } - echo ""; -} +
{$general['name']}
+ + + +
베 팅 장
+ + + + + + + + + + +
+ () +
+ 16강 상황
+ (전체 금액 : / 내 투자 금액 : ) +
+ + + + + + query('SELECT npc,name,win from tournament where grp>=60 order by grp, grp_no LIMIT 1'); + while (count($generalList) < 1) { + $generalList[] = [ + 'name' => '-', + 'npc' => 0, + 'win' => 0 + ]; + } + foreach ($generalList as $i => $general) { + if ($general['name'] == "") { + $general['name'] = "-"; + } + if ($general['npc'] >= 2) { + $general['name'] = "" . $general['name'] . ""; + } elseif ($general['npc'] == 1) { + $general['name'] = "" . $general['name'] . ""; + } + echo ""; + } -echo " + echo " "; -$cent = []; -$line = []; -$gen = []; -for ($i=0; $i < 1; $i++) { - $cent[$i] = ""; -} -$generalList = $db->query('SELECT npc,name,win from tournament where grp>=50 order by grp, grp_no LIMIT 2'); -while(count($generalList) < 2){ - $generalList[] = [ - 'name'=>'-', - 'npc'=>0, - 'win'=>0 - ]; -} -foreach($generalList as $i=>$general){ - if ($general['name'] == "") { - $general['name'] = "-"; - } - if ($general['npc'] >= 2) { - $general['name'] = "".$general['name'].""; - } elseif ($general['npc'] == 1) { - $general['name'] = "".$general['name'].""; - } - if ($general['win'] > 0) { - $line[$i] = ""; - $cent[intdiv($i, 2)] = ""; - } else { - $line[$i] = ""; - } - $gen[$i] = $general['name']; -} -for ($i=0; $i < 1; $i++) { - $cent[$i] = $cent[$i]."┻".""; - $line[$i*2] = $line[$i*2]."┏━━━━━━━━━━━━━━━━━━━━━━━━━━━".""; - $line[$i*2+1] = $line[$i*2+1]."━━━━━━━━━━━━━━━━━━━━━━━━━━━┓".""; - echo ""; -} -echo " + $cent = []; + $line = []; + $gen = []; + for ($i = 0; $i < 1; $i++) { + $cent[$i] = ""; + } + $generalList = $db->query('SELECT npc,name,win from tournament where grp>=50 order by grp, grp_no LIMIT 2'); + while (count($generalList) < 2) { + $generalList[] = [ + 'name' => '-', + 'npc' => 0, + 'win' => 0 + ]; + } + foreach ($generalList as $i => $general) { + if ($general['name'] == "") { + $general['name'] = "-"; + } + if ($general['npc'] >= 2) { + $general['name'] = "" . $general['name'] . ""; + } elseif ($general['npc'] == 1) { + $general['name'] = "" . $general['name'] . ""; + } + if ($general['win'] > 0) { + $line[$i] = ""; + $cent[intdiv($i, 2)] = ""; + } else { + $line[$i] = ""; + } + $gen[$i] = $general['name']; + } + for ($i = 0; $i < 1; $i++) { + $cent[$i] = $cent[$i] . "┻" . ""; + $line[$i * 2] = $line[$i * 2] . "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━" . ""; + $line[$i * 2 + 1] = $line[$i * 2 + 1] . "━━━━━━━━━━━━━━━━━━━━━━━━━━━┓" . ""; + echo ""; + } + echo " "; -for ($i=0; $i < 2; $i++) { - echo ""; -} + for ($i = 0; $i < 2; $i++) { + echo ""; + } -echo " + echo " "; -for ($i=0; $i < 2; $i++) { - $cent[$i] = ""; -} -$generalList = $db->query('SELECT npc,name,win from tournament where grp>=40 order by grp, grp_no LIMIT 4'); -while(count($generalList) < 4){ - $generalList[] = [ - 'name'=>'-', - 'npc'=>0, - 'win'=>0 - ]; -} -foreach($generalList as $i=>$general){ - if ($general['name'] == "") { - $general['name'] = "-"; - } - if ($general['npc'] >= 2) { - $general['name'] = "".$general['name'].""; - } elseif ($general['npc'] == 1) { - $general['name'] = "".$general['name'].""; - } - if ($general['win'] > 0) { - $line[$i] = ""; - $cent[intdiv($i, 2)] = ""; - } else { - $line[$i] = ""; - } - $gen[$i] = $general['name']; -} -for ($i=0; $i < 2; $i++) { - $cent[$i] = $cent[$i]."┻".""; - $line[$i*2] = $line[$i*2]."┏━━━━━━━━━━━━━".""; - $line[$i*2+1] = $line[$i*2+1]."━━━━━━━━━━━━━┓".""; - echo ""; -} -echo " + for ($i = 0; $i < 2; $i++) { + $cent[$i] = ""; + } + $generalList = $db->query('SELECT npc,name,win from tournament where grp>=40 order by grp, grp_no LIMIT 4'); + while (count($generalList) < 4) { + $generalList[] = [ + 'name' => '-', + 'npc' => 0, + 'win' => 0 + ]; + } + foreach ($generalList as $i => $general) { + if ($general['name'] == "") { + $general['name'] = "-"; + } + if ($general['npc'] >= 2) { + $general['name'] = "" . $general['name'] . ""; + } elseif ($general['npc'] == 1) { + $general['name'] = "" . $general['name'] . ""; + } + if ($general['win'] > 0) { + $line[$i] = ""; + $cent[intdiv($i, 2)] = ""; + } else { + $line[$i] = ""; + } + $gen[$i] = $general['name']; + } + for ($i = 0; $i < 2; $i++) { + $cent[$i] = $cent[$i] . "┻" . ""; + $line[$i * 2] = $line[$i * 2] . "┏━━━━━━━━━━━━━" . ""; + $line[$i * 2 + 1] = $line[$i * 2 + 1] . "━━━━━━━━━━━━━┓" . ""; + echo ""; + } + echo " "; -for ($i=0; $i < 4; $i++) { - echo ""; -} + for ($i = 0; $i < 4; $i++) { + echo ""; + } -echo " + echo " "; -for ($i=0; $i < 4; $i++) { - $cent[$i] = ""; -} -$generalList = $db->query('SELECT npc,name,win from tournament where grp>=30 order by grp, grp_no LIMIT 8'); -while(count($generalList) < 8){ - $generalList[] = [ - 'name'=>'-', - 'npc'=>0, - 'win'=>0 - ]; -} -foreach($generalList as $i=>$general){ - if ($general['name'] == "") { - $general['name'] = "-"; - } - if ($general['npc'] >= 2) { - $general['name'] = "".$general['name'].""; - } elseif ($general['npc'] == 1) { - $general['name'] = "".$general['name'].""; - } - if ($general['win'] > 0) { - $line[$i] = ""; - $cent[intdiv($i, 2)] = ""; - } else { - $line[$i] = ""; - } - $gen[$i] = $general['name']; -} -for ($i=0; $i < 4; $i++) { - $cent[$i] = $cent[$i]."┻".""; - $line[$i*2] = $line[$i*2]."┏━━━━━━".""; - $line[$i*2+1] = $line[$i*2+1]."━━━━━━┓".""; - echo ""; -} -echo " + for ($i = 0; $i < 4; $i++) { + $cent[$i] = ""; + } + $generalList = $db->query('SELECT npc,name,win from tournament where grp>=30 order by grp, grp_no LIMIT 8'); + while (count($generalList) < 8) { + $generalList[] = [ + 'name' => '-', + 'npc' => 0, + 'win' => 0 + ]; + } + foreach ($generalList as $i => $general) { + if ($general['name'] == "") { + $general['name'] = "-"; + } + if ($general['npc'] >= 2) { + $general['name'] = "" . $general['name'] . ""; + } elseif ($general['npc'] == 1) { + $general['name'] = "" . $general['name'] . ""; + } + if ($general['win'] > 0) { + $line[$i] = ""; + $cent[intdiv($i, 2)] = ""; + } else { + $line[$i] = ""; + } + $gen[$i] = $general['name']; + } + for ($i = 0; $i < 4; $i++) { + $cent[$i] = $cent[$i] . "┻" . ""; + $line[$i * 2] = $line[$i * 2] . "┏━━━━━━" . ""; + $line[$i * 2 + 1] = $line[$i * 2 + 1] . "━━━━━━┓" . ""; + echo ""; + } + echo " "; -for ($i=0; $i < 8; $i++) { - echo ""; -} + for ($i = 0; $i < 8; $i++) { + echo ""; + } -echo " + echo " "; -for ($i=0; $i < 8; $i++) { - $cent[$i] = ""; -} -$generalList = $db->query('SELECT npc,name,win from tournament where grp>=20 order by grp, grp_no LIMIT 16'); -while(count($generalList) < 16){ - $generalList[] = [ - 'name'=>'-', - 'npc'=>0, - 'win'=>0 - ]; -} -foreach($generalList as $i=>$general){ - if ($general['name'] == "") { - $general['name'] = "-"; - } - if ($general['npc'] >= 2) { - $general['name'] = "".$general['name'].""; - } elseif ($general['npc'] == 1) { - $general['name'] = "".$general['name'].""; - } - if ($general['win'] > 0) { - $line[$i] = ""; - $cent[intdiv($i, 2)] = ""; - } else { - $line[$i] = ""; - } - $gen[$i] = $general['name']; -} -for ($i=0; $i < 8; $i++) { - $cent[$i] = $cent[$i]."┻".""; - $line[$i*2] = $line[$i*2]."┏━━".""; - $line[$i*2+1] = $line[$i*2+1]."━━┓".""; - echo ""; -} -echo " + for ($i = 0; $i < 8; $i++) { + $cent[$i] = ""; + } + $generalList = $db->query('SELECT npc,name,win from tournament where grp>=20 order by grp, grp_no LIMIT 16'); + while (count($generalList) < 16) { + $generalList[] = [ + 'name' => '-', + 'npc' => 0, + 'win' => 0 + ]; + } + foreach ($generalList as $i => $general) { + if ($general['name'] == "") { + $general['name'] = "-"; + } + if ($general['npc'] >= 2) { + $general['name'] = "" . $general['name'] . ""; + } elseif ($general['npc'] == 1) { + $general['name'] = "" . $general['name'] . ""; + } + if ($general['win'] > 0) { + $line[$i] = ""; + $cent[intdiv($i, 2)] = ""; + } else { + $line[$i] = ""; + } + $gen[$i] = $general['name']; + } + for ($i = 0; $i < 8; $i++) { + $cent[$i] = $cent[$i] . "┻" . ""; + $line[$i * 2] = $line[$i * 2] . "┏━━" . ""; + $line[$i * 2 + 1] = $line[$i * 2 + 1] . "━━┓" . ""; + echo ""; + } + echo " "; -for ($i=0; $i < 16; $i++) { - echo ""; -} + for ($i = 0; $i < 16; $i++) { + echo ""; + } -$bet = []; -$gold = []; + $bet = []; + $gold = []; -for ($i=0; $i < 16; $i++) { - if($globalBet[$i] == 0){ - $bet[$i] = "∞"; - } - else{ - $bet[$i] = round($globalBetTotal / $globalBet[$i], 2); - } -} + for ($i = 0; $i < 16; $i++) { + if ($globalBet[$i] == 0) { + $bet[$i] = "∞"; + } else { + $bet[$i] = round($globalBetTotal / $globalBet[$i], 2); + } + } -for ($i=0; $i < 16; $i++) { - if(!is_numeric($bet[$i])){ - $gold[$i] = 0; - } - else{ - $gold[$i] = Util::round($myBet[$i] * $bet[$i]); - } - -} -?> - -
{$general['name']}
{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}{$line[$i * 2]}{$cent[$i]}{$line[$i * 2 + 1]}
{$gen[$i]}{$gen[$i]}
{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}{$line[$i * 2]}{$cent[$i]}{$line[$i * 2 + 1]}
{$gen[$i]}{$gen[$i]}
{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}{$line[$i * 2]}{$cent[$i]}{$line[$i * 2 + 1]}
{$gen[$i]}{$gen[$i]}
{$line[$i*2]}{$cent[$i]}{$line[$i*2+1]}{$line[$i * 2]}{$cent[$i]}{$line[$i * 2 + 1]}
{$gen[$i]}{$gen[$i]}
- - - + +
+ + + + + "; -for ($i=0; $i < 16; $i++) { - echo ""; -} -?> - - - - - - -{$myBet[$i]}"; -} -?> - - - - - - -{$gold[$i]}"; -} + for ($i = 0; $i < 16; $i++) { + echo ""; + } + ?> + + + + + + + + + + + + + + + + + + + + + {$myBet[$i]}"; + } + ?> + + + + + + + + + + + + + + + + + + + + + {$gold[$i]}"; + } -echo " + echo " "; -if ($admin['tournament'] == 6) { - echo " + if ($admin['tournament'] == 6) { + echo " "; - for ($i=0; $i < 16; $i++) { - echo " + for ($i = 0; $i < 16; $i++) { + echo " "; - } + } - echo " + echo " "; - for ($i=0; $i < 16; $i++) { - echo " + for ($i = 0; $i < 16; $i++) { + echo " "; - } + } - echo ""; -} + echo ""; + } -?> - - - - -
{$bet[$i]}
××××××××××××××××
{$bet[$i]}
××××××××××××××××
- 배당률 × 베팅금 = 적중시 환수금
- ( 베팅후 500원 이하일땐 베팅이 불가능합니다. ) -
- - - - - + + + + + + +
토너먼트 랭킹
순위 / 장수명 / 능력치 / 경기수 / 승리 / 무승부 / 패배 / 집계점수 / 우승횟수
+ 배당률 × 베팅금 = 적중시 환수금
+ ( 베팅후 500원 이하일땐 베팅이 불가능합니다. ) +
+ + + + + + + + + [ - '종합', - function(General $general){return $general->getVar('leadership')+$general->getVar('strength')+$general->getVar('intel');}, - 'tt', - ], - '통 솔 전'=>[ - '통솔', - function(General $general){return $general->getVar('leadership');}, - 'tl', - ], - '일 기 토'=>[ - '무력', - function(General $general){return $general->getVar('strength');}, - 'ts', - ], - '설 전'=>[ - '지력', - function(General $general){return $general->getVar('intel');}, - 'ti', - ], -]; + $tournamentType = [ + '전 력 전' => [ + '종합', + function (General $general) { + return $general->getVar('leadership') + $general->getVar('strength') + $general->getVar('intel'); + }, + 'tt', + ], + '통 솔 전' => [ + '통솔', + function (General $general) { + return $general->getVar('leadership'); + }, + 'tl', + ], + '일 기 토' => [ + '무력', + function (General $general) { + return $general->getVar('strength'); + }, + 'ts', + ], + '설 전' => [ + '지력', + function (General $general) { + return $general->getVar('intel'); + }, + 'ti', + ], + ]; -$type1 = array("전 력 전", "통 솔 전", "일 기 토", "설 전"); -$type2 = array("종합", "통솔", "무력", "지력"); -$type3 = array("tt", "tl", "ts", "ti"); -$type4 = array("total", "leadership", "strength", "intel"); + $type1 = array("전 력 전", "통 솔 전", "일 기 토", "설 전"); + $type2 = array("종합", "통솔", "무력", "지력"); + $type3 = array("tt", "tl", "ts", "ti"); + $type4 = array("total", "leadership", "strength", "intel"); -foreach($tournamentType as $tournamentTypeText=>[$statTypeText,$statFunc,$rankColumn]): ?> - - - - - - -
+ 토너먼트 랭킹 +
+ 순위 / 장수명 / 능력치 / 경기수 / 승리 / 무승부 / 패배 / 집계점수 / 우승횟수 +
- - - -queryFirstColumn('SELECT general_id FROM rank_data WHERE `type`= %s ORDER BY value DESC LIMIT 40', $gameColumn), - [$prizeColumn, $gameColumn, $winColumn, $drawColumn, $loseColumn,'leadership', 'strength', 'intel', 'no', 'npc', 'name'], - 0 - ); - usort($tournamentRankerList, function(General $lhs, General $rhs) use($gameColumn, $winColumn, $drawColumn, $loseColumn){ - $result = -($lhs->getRankVar($gameColumn) <=> $rhs->getRankVar($gameColumn)); - if($result !== 0) return $result; - $result = -( - ($lhs->getRankVar($winColumn)+$lhs->getRankVar($drawColumn)+$lhs->getRankVar($loseColumn)) - <=> - ($rhs->getRankVar($winColumn)+$rhs->getRankVar($drawColumn)+$rhs->getRankVar($loseColumn)) - ); - if($result !== 0) return $result; - $result = -($lhs->getRankVar($winColumn) <=> $rhs->getRankVar($winColumn)); - if($result !== 0) return $result; - $result = -($lhs->getRankVar($drawColumn) <=> $rhs->getRankVar($drawColumn)); - if($result !== 0) return $result; - return $lhs->getRankVar($loseColumn) <=> $rhs->getRankVar($loseColumn); - }); - $tournamentRankerList = array_splice($tournamentRankerList, 0, 30); - foreach($tournamentRankerList as $rank=>$ranker){ - printRow( - $rank, - $ranker->getNPCType(), - $ranker->getName(), - ($statFunc)($ranker), - $ranker->getRankVar($winColumn)+$ranker->getRankVar($drawColumn)+$ranker->getRankVar($loseColumn), - $ranker->getRankVar($winColumn), - $ranker->getRankVar($drawColumn), - $ranker->getRankVar($loseColumn), - $ranker->getRankVar($gameColumn), - $ranker->getRankVar($prizeColumn), - 0 - ); - } -?> -
장수
-ㆍ토너먼트의 16강 대진표가 완성되면, 베팅 기간이 주어집니다.
-ㆍ유저들의 베팅 상황에 따라 배당률이 실시간 결정되며, 자신의 베팅금에 따른 예상 환급금을 알 수 있습니다.
-ㆍ베팅은 16슬롯에 각각 베팅 가능하며, 도합 최대 금 1000씩 베팅 가능합니다.
-ㆍ소지금 500원 이하일땐 베팅이 불가능합니다. -ㆍ삼모와 더불어 토너먼트, 베팅기능으로 즐거운 삼모 되세요!
-
- - - -
+ foreach ($tournamentType as $tournamentTypeText => [$statTypeText, $statFunc, $rankColumn]) : ?> + + + + + + + + + + + + + + + + + queryFirstColumn('SELECT general_id FROM rank_data WHERE `type`= %s ORDER BY value DESC LIMIT 40', $gameColumn), + [$prizeColumn, $gameColumn, $winColumn, $drawColumn, $loseColumn, 'leadership', 'strength', 'intel', 'no', 'npc', 'name'], + 0 + ); + usort($tournamentRankerList, function (General $lhs, General $rhs) use ($gameColumn, $winColumn, $drawColumn, $loseColumn) { + $result = - ($lhs->getRankVar($gameColumn) <=> $rhs->getRankVar($gameColumn)); + if ($result !== 0) return $result; + $result = - ( + ($lhs->getRankVar($winColumn) + $lhs->getRankVar($drawColumn) + $lhs->getRankVar($loseColumn)) + <=> + ($rhs->getRankVar($winColumn) + $rhs->getRankVar($drawColumn) + $rhs->getRankVar($loseColumn)) + ); + if ($result !== 0) return $result; + $result = - ($lhs->getRankVar($winColumn) <=> $rhs->getRankVar($winColumn)); + if ($result !== 0) return $result; + $result = - ($lhs->getRankVar($drawColumn) <=> $rhs->getRankVar($drawColumn)); + if ($result !== 0) return $result; + return $lhs->getRankVar($loseColumn) <=> $rhs->getRankVar($loseColumn); + }); + $tournamentRankerList = array_splice($tournamentRankerList, 0, 30); + foreach ($tournamentRankerList as $rank => $ranker) { + printRow( + $rank, + $ranker->getNPCType(), + $ranker->getName(), + ($statFunc)($ranker), + $ranker->getRankVar($winColumn) + $ranker->getRankVar($drawColumn) + $ranker->getRankVar($loseColumn), + $ranker->getRankVar($winColumn), + $ranker->getRankVar($drawColumn), + $ranker->getRankVar($loseColumn), + $ranker->getRankVar($gameColumn), + $ranker->getRankVar($prizeColumn), + 0 + ); + } + ?> +
+ +
장수
+ + + + + + ㆍ토너먼트의 16강 대진표가 완성되면, 베팅 기간이 주어집니다.
+ ㆍ유저들의 베팅 상황에 따라 배당률이 실시간 결정되며, 자신의 베팅금에 따른 예상 환급금을 알 수 있습니다.
+ ㆍ베팅은 16슬롯에 각각 베팅 가능하며, 도합 최대 금 1000씩 베팅 가능합니다.
+ ㆍ소지금 500원 이하일땐 베팅이 불가능합니다. + ㆍ삼모와 더불어 토너먼트, 베팅기능으로 즐거운 삼모 되세요!
+ + + + + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/b_chiefcenter.php b/hwe/b_chiefcenter.php index fc1f11c1..94532e31 100644 --- a/hwe/b_chiefcenter.php +++ b/hwe/b_chiefcenter.php @@ -1,4 +1,5 @@ generalID); ?> + - - - -<?=UniqueConst::$serverName?>: 사령부 - - - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 사령부 + + + + + + + + + -
-
사 령 부
-
-
수뇌부 일정
-
.
- >
- >
- >
- :  
- >
 
 
- >
- >
.
- >
- >

.
- >
- >
- >
- :  
- >
 
 
- >
- >
.
- >
- >
-
+
+
사 령 부
+
+
수뇌부 일정
+
+
+
.
> +
> +
> +
+
- :  
> +
+
 
+
 
+
> +
> +
+
.
> +
> +
+
+
+
+
+
+

+
+
+
+
+
.
> +
> +
> +
+
- :  
> +
+
 
+
 
+
> +
> +
+
.
> +
> +
+
+
+
- + + \ No newline at end of file diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index ff0a9dff..2e1813e4 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -1,4 +1,5 @@ queryFirstRow('SELECT no,nation,officer_level,city from general where owner=%i', $userID); -$myNation = $db->queryFirstRow('SELECT nation,level,spy FROM nation WHERE nation=%i', $me['nation'])??[ - 'nation'=>0, - 'level'=>0, - 'spy'=>'' +$myNation = $db->queryFirstRow('SELECT nation,level,spy FROM nation WHERE nation=%i', $me['nation']) ?? [ + 'nation' => 0, + 'level' => 0, + 'spy' => '' ]; $templates = new \League\Plates\Engine('templates'); @@ -29,117 +30,129 @@ $templates = new \League\Plates\Engine('templates'); -<?=UniqueConst::$serverName?>: 도시정보 - - - - - - - - - - - - - + .general_turn_text { + font-size: x-small; + } + - - -
도 시 정 보
+ + + + +
도 시 정 보
- - - +
-
-
도시선택 : -
+ +
도시선택 : +

명령 화면에서 도시를 클릭하셔도 됩니다.

@@ -148,378 +161,379 @@ echo "

"; -unset($city); + unset($city); -// 첩보된 도시까지만 허용 + // 첩보된 도시까지만 허용 -$showDetailedInfo = false; -if($valid){ - $showDetailedInfo = true; -} + $showDetailedInfo = false; + if ($valid) { + $showDetailedInfo = true; + } -if(!key_exists($citylist, CityConst::all())){ - $citylist = $me['city']; - $showDetailedInfo = true; - $valid = 1; -} + if (!key_exists($citylist, CityConst::all())) { + $citylist = $me['city']; + $showDetailedInfo = true; + $valid = 1; + } -if($userGrade >= 5){ - $valid = true; - $showDetailedInfo = true; -} + if ($userGrade >= 5) { + $valid = true; + $showDetailedInfo = 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; - } - } -} + 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; + } + } + } -$city = $db->queryFirstRow('SELECT * FROM city WHERE city=%i', $citylist); -$cityNation = getNationStaticInfo($city['nation']); + $city = $db->queryFirstRow('SELECT * FROM city WHERE city=%i', $citylist); + $cityNation = getNationStaticInfo($city['nation']); -//태수, 군사, 종사 -$officer = [ - 4=>['name'=>'-', 'npc'=>0], - 3=>['name'=>'-', 'npc'=>0], - 2=>['name'=>'-', 'npc'=>0] -]; + //태수, 군사, 종사 + $officer = [ + 4 => ['name' => '-', 'npc' => 0], + 3 => ['name' => '-', 'npc' => 0], + 2 => ['name' => '-', 'npc' => 0] + ]; -foreach($db->query('SELECT `name`, npc, `officer_level` FROM general WHERE `officer_city` = %i', $city['city']) as $officerInfo){ - $officer[$officerInfo['officer_level']] = $officerInfo; -} + foreach ($db->query('SELECT `name`, npc, `officer_level` FROM general WHERE `officer_city` = %i', $city['city']) as $officerInfo) { + $officer[$officerInfo['officer_level']] = $officerInfo; + } -if($city['trade'] === null) { - $city['trade'] = "- "; -} + if ($city['trade'] === null) { + $city['trade'] = "- "; + } -$dbColumns = General::mergeQueryColumn(['npc', 'defence_train', 'no', 'picture', 'imgsvr', 'name', 'injury', 'leadership', 'strength', 'intel', 'officer_level', 'nation', 'crewtype', 'crew', 'train', 'atmos'], 2)[0]; -if($showDetailedInfo){ - $generals = $db->query( - 'SELECT %l from general where city=%i order by turntime', - Util::formatListOfBackticks($dbColumns), - $city['city'] - ); -} -else{ - $generals = []; -} + $dbColumns = General::mergeQueryColumn(['npc', 'defence_train', 'no', 'picture', 'imgsvr', 'name', 'injury', 'leadership', 'strength', 'intel', 'officer_level', 'nation', 'crewtype', 'crew', 'train', 'atmos'], 2)[0]; + if ($showDetailedInfo) { + $generals = $db->query( + 'SELECT %l from general where city=%i order by turntime', + 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 ($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'] = '?'; - } -} + if ($city['nation'] != 0) { + $city['def'] = '?'; + $city['wall'] = '?'; + } + } -$generalTurnList = []; + $generalTurnList = []; -if($generals){ - foreach($db->queryAllLists( - 'SELECT general_id, turn_idx, brief FROM general_turn WHERE general_id IN %li AND turn_idx < 5 ORDER BY general_id ASC, turn_idx ASC', - array_column($generals, 'no') - ) as [$generalID, $turnIdx, $brief] - ){ - if(!key_exists($generalID, $generalTurnList)){ - $generalTurnList[$generalID] = []; - } - $generalTurnList[$generalID][$turnIdx] = $brief; - } -} + if ($generals) { + foreach ($db->queryAllLists( + 'SELECT general_id, turn_idx, brief FROM general_turn WHERE general_id IN %li AND turn_idx < 5 ORDER BY general_id ASC, turn_idx ASC', + array_column($generals, 'no') + ) as [$generalID, $turnIdx, $brief]) { + if (!key_exists($generalID, $generalTurnList)) { + $generalTurnList[$generalID] = []; + } + $generalTurnList[$generalID][$turnIdx] = $brief; + } + } -$nationname = []; -$nationlevel = []; -foreach(getAllNationStaticInfo() as $nation){ - $nationname[$nation['nation']] = $nation['name']; - $nationlevel[$nation['nation']] = $nation['level']; -} + $nationname = []; + $nationlevel = []; + foreach (getAllNationStaticInfo() as $nation) { + $nationname[$nation['nation']] = $nation['name']; + $nationlevel[$nation['nation']] = $nation['level']; + } -//도시명 오 적군 0/0(0) 병장(총) 0/0(4) 90병장 0/0 60병장 0/0 수비○ 0/0 -$generalsFormat = []; + //도시명 오 적군 0/0(0) 병장(총) 0/0(4) 90병장 0/0 60병장 0/0 수비○ 0/0 + $generalsFormat = []; -foreach($generals as $general){ - $nationInfo = getNationStaticInfo($general['nation']); + foreach ($generals as $general) { + $nationInfo = getNationStaticInfo($general['nation']); - if($general['nation'] != 0 && $general['nation'] == $myNation['nation']){ - $ourGeneral = true; - } - else{ - $ourGeneral = false; - } + if ($general['nation'] != 0 && $general['nation'] == $myNation['nation']) { + $ourGeneral = true; + } else { + $ourGeneral = false; + } - if($userGrade == 6){ - $ourGeneral = true; - } + if ($userGrade == 6) { + $ourGeneral = true; + } - $isNPC = $general['npc']>1; - $wounded = $general['injury']; + $isNPC = $general['npc'] > 1; + $wounded = $general['injury']; - $name = $general['name']; - $nameText = formatName($name, $general['npc']); + $name = $general['name']; + $nameText = formatName($name, $general['npc']); - $leadership = $general['leadership']; - $strength = $general['strength']; - $intel = $general['intel']; + $leadership = $general['leadership']; + $strength = $general['strength']; + $intel = $general['intel']; - $leadershipText = formatWounded($leadership, $general['injury']); - $strengthText = formatWounded($strength, $general['injury']); - $intelText = formatWounded($intel, $general['injury']); + $leadershipText = formatWounded($leadership, $general['injury']); + $strengthText = formatWounded($strength, $general['injury']); + $intelText = formatWounded($intel, $general['injury']); - $officerLevel = $general['officer_level']; - $officerLevelText = getOfficerLevelText($officerLevel); + $officerLevel = $general['officer_level']; + $officerLevelText = getOfficerLevelText($officerLevel); - $leadershipBonus = calcLeadershipBonus($officerLevel, $nationInfo['level']); - $leadershipBonusText = formatLeadershipBonus($leadershipBonus); + $leadershipBonus = calcLeadershipBonus($officerLevel, $nationInfo['level']); + $leadershipBonusText = formatLeadershipBonus($leadershipBonus); - if($ourGeneral){ - $defenceTrain = $general['defence_train']; - $defenceTrainText = formatDefenceTrain($defenceTrain); - $crewType = $general['crewtype']; - $crewTypeText = GameUnitConst::byId($crewType)->name; - $crew = $general['crew']; - $train = $general['train']; - $atmos = $general['atmos']; - } - else{ - $defenceTrain = 0; - $defenceTrainText = ''; - $crewType = 0; - $crewTypeText = ''; - $crew = $general['crew']; - $train = -1; - $atmos = -1; + if ($ourGeneral) { + $defenceTrain = $general['defence_train']; + $defenceTrainText = formatDefenceTrain($defenceTrain); + $crewType = $general['crewtype']; + $crewTypeText = GameUnitConst::byId($crewType)->name; + $crew = $general['crew']; + $train = $general['train']; + $atmos = $general['atmos']; + } else { + $defenceTrain = 0; + $defenceTrainText = ''; + $crewType = 0; + $crewTypeText = ''; + $crew = $general['crew']; + $train = -1; + $atmos = -1; - if(!$valid){ - $crew = -1; - } - } + if (!$valid) { + $crew = -1; + } + } - $nation = $general['nation']; - $nationName = $nationInfo['name']; + $nation = $general['nation']; + $nationName = $nationInfo['name']; - if($ourGeneral && !$isNPC){ - $turnText = []; - $generalObj = new General($general, null, null, null, null, null, false); - foreach($generalTurnList[$generalObj->getID()] as $turnRawIdx=>$turn){ - $turnIdx = $turnRawIdx+1; - $turnText[] = "{$turnIdx} : $turn"; - } - $turnText = join('
', $turnText); - } - else{ - $turnText = ''; - } + if ($ourGeneral && !$isNPC) { + $turnText = []; + $generalObj = new General($general, null, null, null, null, null, false); + foreach ($generalTurnList[$generalObj->getID()] as $turnRawIdx => $turn) { + $turnIdx = $turnRawIdx + 1; + $turnText[] = "{$turnIdx} : $turn"; + } + $turnText = join('
', $turnText); + } else { + $turnText = ''; + } - $generalsFormat[] = [ - 'ourGeneral'=>$ourGeneral, - 'iconPath'=>GetImageURL($general['imgsvr']).'/'.$general['picture'], - 'isNPC'=>$isNPC, - 'wounded'=>$wounded, - 'name'=>$name, - 'nameText'=>$nameText, - 'leadership'=>$leadership, - 'leadershipText'=>$leadershipText, - 'leadershipBonus'=>$leadershipBonus, - 'leadershipBonusText'=>$leadershipBonusText, - 'officerLevel'=>$officerLevel, - 'officerLevelText'=>$officerLevelText, - 'strength'=>$strength, - 'strengthText'=>$strengthText, - 'intel'=>$intel, - 'intelText'=>$intelText, - 'defenceTrain'=>$defenceTrain, - 'defenceTrainText'=>$defenceTrainText, - 'crewType'=>$crewType, - 'crewTypeText'=>$crewTypeText, - 'crew'=>$crew, - 'train'=>$train, - 'atmos'=>$atmos, - 'nation'=>$nation, - 'nationName'=>$nationName, - 'turnText'=>$turnText - ]; -} + $generalsFormat[] = [ + 'ourGeneral' => $ourGeneral, + 'iconPath' => GetImageURL($general['imgsvr']) . '/' . $general['picture'], + 'isNPC' => $isNPC, + 'wounded' => $wounded, + 'name' => $name, + 'nameText' => $nameText, + 'leadership' => $leadership, + 'leadershipText' => $leadershipText, + 'leadershipBonus' => $leadershipBonus, + 'leadershipBonusText' => $leadershipBonusText, + 'officerLevel' => $officerLevel, + 'officerLevelText' => $officerLevelText, + 'strength' => $strength, + 'strengthText' => $strengthText, + 'intel' => $intel, + 'intelText' => $intelText, + 'defenceTrain' => $defenceTrain, + 'defenceTrainText' => $defenceTrainText, + 'crewType' => $crewType, + 'crewTypeText' => $crewTypeText, + 'crew' => $crew, + 'train' => $train, + 'atmos' => $atmos, + 'nation' => $nation, + 'nationName' => $nationName, + 'turnText' => $turnText + ]; + } -$generalsName = array_map(function($gen){return getColoredName($gen['name'], $gen['npc']);}, $generals); + $generalsName = array_map(function ($gen) { + return getColoredName($gen['name'], $gen['npc']); + }, $generals); -$enemyCrew = 0; -$enemyCnt = 0; -$enemyArmedCnt = 0; -$crew90 = 0; -$gen90 = 0; -$crew80 = 0; -$gen80 = 0; -$crew60 = 0; -$gen60 = 0; + $enemyCrew = 0; + $enemyCnt = 0; + $enemyArmedCnt = 0; + $crew90 = 0; + $gen90 = 0; + $crew80 = 0; + $gen80 = 0; + $crew60 = 0; + $gen60 = 0; -$crewDef = 0; -$genDef = 0 ; + $crewDef = 0; + $genDef = 0; -$crewTotal = 0; -$armedGenTotal = 0; -$genTotal = 0; + $crewTotal = 0; + $armedGenTotal = 0; + $genTotal = 0; -foreach($generalsFormat as $general){ - if(!$general['nation'] || !$myNation['nation']){ - continue; - } - if($general['nation'] != $myNation['nation']){ - $enemyCnt += 1; - if($general['crew'] >= 0){ - $enemyCrew += $general['crew']; - } - if($general['crew'] > 0){ - $enemyArmedCnt += 1; - } - continue; - } + foreach ($generalsFormat as $general) { + if (!$general['nation'] || !$myNation['nation']) { + continue; + } + if ($general['nation'] != $myNation['nation']) { + $enemyCnt += 1; + if ($general['crew'] >= 0) { + $enemyCrew += $general['crew']; + } + if ($general['crew'] > 0) { + $enemyArmedCnt += 1; + } + continue; + } - $crewTotal += $general['crew']; - $genTotal += 1; + $crewTotal += $general['crew']; + $genTotal += 1; - if($general['crew'] == 0){ - continue; - } - $armedGenTotal += 1; + if ($general['crew'] == 0) { + continue; + } + $armedGenTotal += 1; - $minTrain = min($general['train'], $general['atmos']); + $minTrain = min($general['train'], $general['atmos']); - if($minTrain >= 90){ - $crew90 += $general['crew']; - $gen90 += 1; - } + if ($minTrain >= 90) { + $crew90 += $general['crew']; + $gen90 += 1; + } - $chkDef = false; + $chkDef = false; - if($minTrain >= 80){ - $crew80 += $general['crew']; - $gen80 += 1; - } + if ($minTrain >= 80) { + $crew80 += $general['crew']; + $gen80 += 1; + } - if($minTrain >= 60){ - $crew60 += $general['crew']; - $gen60 += 1; - } + if ($minTrain >= 60) { + $crew60 += $general['crew']; + $gen60 += 1; + } - if($minTrain >= $general['defenceTrain']){ - $crewDef += $general['crew']; - $genDef += 1; - $chkDef = true; - } + if ($minTrain >= $general['defenceTrain']) { + $crewDef += $general['crew']; + $genDef += 1; + $chkDef = true; + } + } + ?> + + + + +
-} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
; background:'>【 | ; background:' class='center'>
주민/농업/상업/치안/수비/성벽/
민심시세%인구%태수군사종사
도시명적군/()병장(총)/()90병장/60병장/수비○/
장수알 수 없음' ?>
-?> - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; background:'>【 | ; background:' class='center'>
주민/농업/상업/치안/수비/성벽/
민심시세%인구%태수군사종사
도시명적군/()병장(총)/()90병장/60병장/수비○/
장수알 수 없음'?>
- -
- - - - - - - - - - - - - - - - - - -render('cityGeneral', $general); -} -?> - -
얼 굴이 름통솔무력지력관 직병 종병 사훈련사기명 령
- - - - -
+
+ + + + + + + + + + + + + + + + + + + + render('cityGeneral', $general); + } + ?> + +
얼 굴이 름통솔무력지력관 직병 종병 사훈련사기명 령
+ + + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/b_dipcenter.php b/hwe/b_dipcenter.php index fa254756..452d774d 100644 --- a/hwe/b_dipcenter.php +++ b/hwe/b_dipcenter.php @@ -1,4 +1,5 @@ = 2) { } $permission = checkSecretPermission($me); -if($permission < 0){ +if ($permission < 0) { echo '국가에 소속되어있지 않습니다.'; die(); -} -else if ($permission < 1) { +} else if ($permission < 1) { echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다."; die(); } @@ -48,241 +48,269 @@ $nationStor->cacheValues(['notice', 'scout_msg', 'available_war_setting_cnt']); ?> + - - - -<?=UniqueConst::$serverName?>: 내무부 - - - - - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 내무부 + + + + + + + + + + + - - -
내 무 부
- - - - - - - - - - - -getValues(['year','month']); +
외 교 관 계
국 가 명국력장수속령상태기간종 료 시 점
+ + + +
내 무 부
+ + + + + + + + + + + + + + getValues(['year', 'month']); -$cityCntList = Util::convertPairArrayToDict($db->queryAllLists('SELECT nation, count(city) FROM city GROUP BY nation')); -$dipStateList = Util::convertArrayToDict($db->query('SELECT you,state,term FROM diplomacy WHERE me = %i', $nationID), 'you'); + $cityCntList = Util::convertPairArrayToDict($db->queryAllLists('SELECT nation, count(city) FROM city GROUP BY nation')); + $dipStateList = Util::convertArrayToDict($db->query('SELECT you,state,term FROM diplomacy WHERE me = %i', $nationID), 'you'); -$nationsList = getAllNationStaticInfo(); -uasort($nationsList, function(array $lhs, array $rhs){ - return -($lhs['power']<=>$rhs['power']); -}); + $nationsList = getAllNationStaticInfo(); + uasort($nationsList, function (array $lhs, array $rhs) { + return - ($lhs['power'] <=> $rhs['power']); + }); -foreach($nationsList as $staticNation): - //속령수 - $staticNationID = $staticNation['nation']; - $cityCnt = $cityCntList[$staticNation['nation']]??0; + foreach ($nationsList as $staticNation) : + //속령수 + $staticNationID = $staticNation['nation']; + $cityCnt = $cityCntList[$staticNation['nation']] ?? 0; - $dipStateText = '-'; - $dipTermText = '-'; - $dipEndDateText = '-'; - if($staticNationID !== $nationID){ - $diplomacyState = $dipStateList[$staticNationID]; + $dipStateText = '-'; + $dipTermText = '-'; + $dipEndDateText = '-'; + if ($staticNationID !== $nationID) { + $diplomacyState = $dipStateList[$staticNationID]; - $dipStateText = [ - 0 => "교 전", - 1 => "선포중", - 2 => "통 상", - 7 => "불가침", - ][$diplomacyState['state']]; + $dipStateText = [ + 0 => "교 전", + 1 => "선포중", + 2 => "통 상", + 7 => "불가침", + ][$diplomacyState['state']]; - if($diplomacyState['term']){ - $dipEndMonth = $admin['month'] + $diplomacyState['term'] - 1; - $dipEndYear = $admin['year'] + intdiv($dipEndMonth, 12); - $dipEndMonth = $dipEndMonth % 12 + 1; + if ($diplomacyState['term']) { + $dipEndMonth = $admin['month'] + $diplomacyState['term'] - 1; + $dipEndYear = $admin['year'] + intdiv($dipEndMonth, 12); + $dipEndMonth = $dipEndMonth % 12 + 1; - $dipTermText = $diplomacyState['term'].'개월'; - $dipEndDateText = "{$dipEndYear}年 {$dipEndMonth}月"; - } + $dipTermText = $diplomacyState['term'] . '개월'; + $dipEndDateText = "{$dipEndYear}年 {$dipEndMonth}月"; + } + } + ?> + + + + + + + + + + + +
외 교 관 계
국 가 명국력장수속령상태기간종 료 시 점
;background-color:'>
+ + query('SELECT * FROM city WHERE nation=%i', $nationID); + $dedicationList = $db->query('SELECT dedication FROM general WHERE nation=%i AND npc!=5', $nationID); + + $goldIncome = getGoldIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); + $warIncome = getWarGoldIncome($nation['type'], $cityList); + $totalGoldIncome = $goldIncome + $warIncome; + + $riceIncome = getRiceIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); + $wallIncome = getWallIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); + $totalRiceIncome = $riceIncome + $wallIncome; + + $outcome = getOutcome($nation['bill'], $dedicationList); + + $budgetgold = $nation['gold'] + $totalGoldIncome - $outcome; + $budgetrice = $nation['rice'] + $totalRiceIncome - $outcome; + $budgetgolddiff = $totalGoldIncome - $outcome; + $budgetricediff = $totalRiceIncome - $outcome; + + if ($budgetgolddiff > 0) { + $budgetgolddiff = '+' . number_format($budgetgolddiff); + } else { + $budgetgolddiff = number_format($budgetgolddiff); + } + if ($budgetricediff > 0) { + $budgetricediff = '+' . number_format($budgetricediff); + } else { + $budgetricediff = number_format($budgetricediff); } -?> - - ;background-color:'> - - - - - - - - - + ?> + + + + + + + + + + + + + + + + + + + +
국 가 방 침 & 임관 권유 메시지
+
+
+
+ 국가 방침 +
+
+ +
+
+ +
+
+
+
+
+
+ 임관 권유 +
+
+ +
+
+
870px x 200px를 넘어서는 내용은 표시되지 않습니다.
+ +
+
+
+
-query('SELECT * FROM city WHERE nation=%i', $nationID); -$dedicationList = $db->query('SELECT dedication FROM general WHERE nation=%i AND npc!=5', $nationID); - -$goldIncome = getGoldIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); -$warIncome = getWarGoldIncome($nation['type'], $cityList); -$totalGoldIncome = $goldIncome + $warIncome; - -$riceIncome = getRiceIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); -$wallIncome = getWallIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); -$totalRiceIncome = $riceIncome + $wallIncome; - -$outcome = getOutcome($nation['bill'], $dedicationList); - -$budgetgold = $nation['gold'] + $totalGoldIncome - $outcome; -$budgetrice = $nation['rice'] + $totalRiceIncome - $outcome; -$budgetgolddiff = $totalGoldIncome - $outcome; -$budgetricediff = $totalRiceIncome - $outcome; - -if ($budgetgolddiff > 0) { - $budgetgolddiff = '+'.number_format($budgetgolddiff); -} else { - $budgetgolddiff = number_format($budgetgolddiff); -} -if ($budgetricediff > 0) { - $budgetricediff = '+'.number_format($budgetricediff); -} else { - $budgetricediff = number_format($budgetricediff); -} - -?> - - - - - - - - - + +
국 가 방 침 & 임관 권유 메시지
-
-
- 국가 방침 -
-
- -
-
- -
-
-
-
- 임관 권유 -
-
- -
-
-
870px x 200px를 넘어서는 내용은 표시되지 않습니다.
- -
-
-
-
- -
예 산 & 정 책
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - -
자금 예산병량 예산
현 재   현 재   
단기수입   +둔전수입   +
세 금   +세 곡   +
수입 / 지출   + / -수입 / 지출   + / -
국고 예산    ()병량 예산    ()
세율 (5 ~ 30%)    name=rate style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=>% name=btn value=세율>봉급 지급률 (20 ~ 200%)    name=bill style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=>% name=btn value=지급률>
기밀 권한 (1 ~ 99년)    name=secretlimit style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=>년 name=btn value=기밀권한>전쟁 허용/금지 변경 가능getValue('available_war_setting_cnt')?>회(월 +회, 최대회)
- +
예 산 & 정 책
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -
자금 예산병량 예산
현 재   현 재   
단기수입   +둔전수입   +
세 금   +세 곡   +
수입 / 지출   + / -수입 / 지출   + / -
국고 예산    ()병량 예산    ()
세율 (5 ~ 30%)    name=rate style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=>% name=btn value=세율>봉급 지급률 (20 ~ 200%)    name=bill style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=>% name=btn value=지급률>
기밀 권한 (1 ~ 99년)    name=secretlimit style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=>년 name=btn value=기밀권한>전쟁 허용/금지 변경 가능getValue('available_war_setting_cnt') ?>회(월 +회, 최대회)
+ "; -} else { - echo " + } else { + echo " "; -} + } -if ($nation['war'] == 0) { - echo " + if ($nation['war'] == 0) { + echo " "; -} else { - echo " + } else { + echo " "; -} -?> -
-
기밀 권한이란, 암행부를 열람할 수 있는 일반 장수의 최소 사관 년수를 의미합니다.
- - - -
+ } + ?> +
+
기밀 권한이란, 암행부를 열람할 수 있는 일반 장수의 최소 사관 년수를 의미합니다.
+ + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/b_diplomacy.php b/hwe/b_diplomacy.php index c6ff53d3..236977cd 100644 --- a/hwe/b_diplomacy.php +++ b/hwe/b_diplomacy.php @@ -1,4 +1,5 @@ map_theme??'che'; +$mapTheme = $gameStor->map_theme ?? 'che'; $me = $db->queryFirstRow('SELECT no,nation FROM general WHERE owner=%i', $userID); $myNationID = $me['nation']; -$nations = array_filter(getAllNationStaticInfo(), function(array $nation){ +$nations = array_filter(getAllNationStaticInfo(), function (array $nation) { return $nation['level']; }); -uasort($nations, function(array $lhs, array $rhs){ - return -($lhs['power']<=>$rhs['power']); +uasort($nations, function (array $lhs, array $rhs) { + return - ($lhs['power'] <=> $rhs['power']); }); $nationCnt = count($nations); -foreach($db->queryAllLists('SELECT nation, count(city) FROM city WHERE nation != 0 GROUP BY nation') as [$nationID, $cityCnt]){ +foreach ($db->queryAllLists('SELECT nation, count(city) FROM city WHERE nation != 0 GROUP BY nation') as [$nationID, $cityCnt]) { $nations[$nationID]['city_cnt'] = $cityCnt; } @@ -34,10 +35,9 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl $cityID, $cityName, $rawConflict -]) -{ +]) { $rawConflict = Json::decode($rawConflict); - if (count($rawConflict)<2) { + if (count($rawConflict) < 2) { continue; } @@ -45,12 +45,12 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl $conflict = []; - foreach ($rawConflict as $nationID=>$killnum) { + foreach ($rawConflict as $nationID => $killnum) { $conflict[$nationID] = [ - 'killnum'=>$killnum, - 'percent'=>round(100*$killnum / $sum, 1), - 'name'=>$nations[$nationID]['name'], - 'color'=>$nations[$nationID]['color'] + 'killnum' => $killnum, + 'percent' => round(100 * $killnum / $sum, 1), + 'name' => $nations[$nationID]['name'], + 'color' => $nations[$nationID]['color'] ]; } @@ -58,8 +58,8 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl }; $diplomacyList = []; -foreach($db->queryAllLists('SELECT me, you, state FROM diplomacy') as [$me, $you, $state]){ - if(!key_exists($me, $diplomacyList)){ +foreach ($db->queryAllLists('SELECT me, you, state FROM diplomacy') as [$me, $you, $state]) { + if (!key_exists($me, $diplomacyList)) { $diplomacyList[$me] = []; } @@ -72,157 +72,170 @@ $cellWidth = intdiv(888, max(1, $nationCnt)); $defaultStateChar = '?'; $sameNationStateChar = '\'; $infomativeStateCharMap = [ - 0=>'', - 1=>'', - 2=>'ㆍ', - 7=>'@' + 0 => '', + 1 => '', + 2 => 'ㆍ', + 7 => '@' ]; $neutralStateCharMap = [ - 0=>'', - 1=>'' + 0 => '', + 1 => '' ]; ?> + - - - -<?=UniqueConst::$serverName?>: 중원 정보 - - - - - - - - - - - - + }); + + + + + + - - -
중 원 정 보
-
- - - - - - - - -$meNation): ?> - - - - - - - - -
align=center bgcolor=blue>외 교 현 황
;>  style='background-color:;color:'>
;color:'>>userGrade >= 5){ - echo $infomativeStateCharMap[$diplomacyList[$me][$you]]??$defaultStateChar; -} -else{ - echo $neutralStateCharMap[$diplomacyList[$me][$you]]??$defaultStateChar; -} -?>
align=center>불가침 : @, 통상 : ㆍ, 선포 : , 교전 :
+ + + + +
중 원 정 보
+
+ + + + + + + + + + + $meNation) : ?> + + + + + + + + + + +
align=center bgcolor=blue>외 교 현 황
;>  style='background-color:;color:'>
;color:'>>userGrade >= 5) { + echo $infomativeStateCharMap[$diplomacyList[$me][$you]] ?? $defaultStateChar; + } else { + echo $neutralStateCharMap[$diplomacyList[$me][$you]] ?? $defaultStateChar; + } + ?>
align=center>불가침 : @, 통상 : ㆍ, 선포 : , 교전 : +
- + -
- - - - - - + + +
분 쟁 현 황
- - +
+
+ + + + - - - + + -
분 쟁 현 황
;background-color:;' - > 
%;background-color:;' - > 
+ + + + + + + + +
;background-color:;'>  +
%;background-color:;'> 
+
+ +
+
- - - - - + - +
+ + + + + + + + +
+ 중 원 지 도 +
+ + + + + + + + + + + + + + + + + + + + + + +
국명국력장수속령
;background-color:'>
+
+
-
- - - - - - - - -
중 원 지 도
- - - - - - - - - - - - - - - - - - - - - - -
국명국력장수속령
;background-color:'>
-
-
- - - - -
+ + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/b_genList.php b/hwe/b_genList.php index 02e8c5b6..9295bde6 100644 --- a/hwe/b_genList.php +++ b/hwe/b_genList.php @@ -1,4 +1,5 @@ = 2) { } $permission = checkSecretPermission($me); -if($permission < 0){ +if ($permission < 0) { echo '국가에 소속되어있지 않습니다.'; die(); -} -else if ($permission < 1) { +} else if ($permission < 1) { echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다."; die(); } @@ -48,199 +48,238 @@ $templates = new \League\Plates\Engine('templates'); + - - - -<?=UniqueConst::$serverName?>: 암행부 - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 암행부 + + + + + + + - - - -
암 행 부
정렬순서 : - -
-
-queryAllLists('SELECT troop_leader, name FROM troop WHERE nation=%i', $me['nation']) as [$troopID, $tName]){ - $troopName[$troopID] = $tName; -} - -$orderSQL = ''; -switch ($type) { - case 1: $orderSQL = "order by gold desc"; break; - case 2: $orderSQL = "order by rice desc"; break; - case 3: $orderSQL = "order by city"; break; - case 4: $orderSQL = "order by crewtype desc"; break; - case 5: $orderSQL = "order by crew desc"; break; - case 6: $orderSQL = "order by killturn"; break; - case 7: $orderSQL = "order by turntime"; break; - case 8: $orderSQL = "order by troop desc"; break; -} - -$generals = $db->query( - 'SELECT npc,defence_train,no,officer_level,troop,city,injury,leadership,strength,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,nation from general WHERE nation = %i %l', - $me['nation'], - $orderSQL -); - -$generalTurnList = []; - -foreach($db->queryAllLists( - 'SELECT general_id, turn_idx, brief FROM general_turn WHERE general_id IN %li AND turn_idx < 5 ORDER BY general_id ASC, turn_idx ASC', - array_column($generals, 'no') - ) as [$generalID, $turnIdx, $brief] -){ - if(!key_exists($generalID, $generalTurnList)){ - $generalTurnList[$generalID] = []; - } - $generalTurnList[$generalID][$turnIdx] = $brief; -} - -$genCntEff = 0; -foreach ($generals as &$general) { - $general['cityText'] = CityConst::byID($general['city'])->name; - $general['troopText'] = $troopName[$general['troop']]??'-'; - - if($general['npc'] != 5){ - $genCntEff += 1; + + + + + + + +
암 행 부
+
정렬순서 : + + +
+
+ queryAllLists('SELECT troop_leader, name FROM troop WHERE nation=%i', $me['nation']) as [$troopID, $tName]) { + $troopName[$troopID] = $tName; } - $lbonus = calcLeadershipBonus($general['officer_level'], $nationLevel); - if ($lbonus > 0) { - $lbonusText = "+{$lbonus}"; - } else { - $lbonusText = ""; - } - $general['lbonus'] = $lbonus; - $general['lbonusText'] = $lbonusText; - - if ($general['injury'] > 0) { - $leadership = intdiv($general['leadership'] * (100 - $general['injury']), 100); - $strength = intdiv($general['strength'] * (100 - $general['injury']), 100); - $intel = intdiv($general['intel'] * (100 - $general['injury']), 100); - $leadership = "{$leadership}{$lbonusText}"; - $strength = "{$strength}"; - $intel = "{$intel}"; - } else { - $leadership = "{$general['leadership']}{$lbonusText}"; - $strength = "{$general['strength']}"; - $intel = "{$general['intel']}"; + $orderSQL = ''; + switch ($type) { + case 1: + $orderSQL = "order by gold desc"; + break; + case 2: + $orderSQL = "order by rice desc"; + break; + case 3: + $orderSQL = "order by city"; + break; + case 4: + $orderSQL = "order by crewtype desc"; + break; + case 5: + $orderSQL = "order by crew desc"; + break; + case 6: + $orderSQL = "order by killturn"; + break; + case 7: + $orderSQL = "order by turntime"; + break; + case 8: + $orderSQL = "order by troop desc"; + break; } - $general['leadershipText'] = $leadership; - $general['strengthText'] = $strength; - $general['intelText'] = $intel; + $generals = $db->query( + 'SELECT npc,defence_train,no,officer_level,troop,city,injury,leadership,strength,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,nation from general WHERE nation = %i %l', + $me['nation'], + $orderSQL + ); - $general['expLevelText'] = getExpLevel($general['experience']); + $generalTurnList = []; - $general['nameText'] = getColoredName($general['name'], $general['npc']); - - $general['modeText'] = formatDefenceTrain($general['defence_train']); - $general['crewtypeText'] = GameUnitConst::byId($general['crewtype'])->name??'-'; - - - if ($general['npc'] < 2) { - $turntext = []; - foreach($generalTurnList[$general['no']] as $turnRawIdx=>$turn){ - $turn = StringUtil::subStringForWidth($turn, 0, 41); - $turnIdx = $turnRawIdx+1; - $turntext[] = " $turnIdx : $turn"; + foreach ($db->queryAllLists( + 'SELECT general_id, turn_idx, brief FROM general_turn WHERE general_id IN %li AND turn_idx < 5 ORDER BY general_id ASC, turn_idx ASC', + array_column($generals, 'no') + ) as [$generalID, $turnIdx, $brief]) { + if (!key_exists($generalID, $generalTurnList)) { + $generalTurnList[$generalID] = []; } - $general['turntext'] = join("
\n", $turntext); - } -} -unset($general); - -$genCnt = countPureGeneralFromRawList($generals); -$totalGold = 0; -$totalRice = 0; -$crew90 = 0; -$gen90 = 0; -$crew80 = 0; -$gen80 = 0; -$crew60 = 0; -$gen60 = 0; -$crewTotal = 0; -//$genTotal = 0; -foreach($generals as $general){ - if($general['npc']==5){ - continue; - } - $totalGold += $general['gold']; - $totalRice += $general['rice']; - - $crewTotal += $general['crew']; - - if($general['crew'] == 0){ - continue; - } - if($general['train'] >= 90 && $general['atmos'] >= 90){ - $crew90 += $general['crew']; - $gen90 += 1; + $generalTurnList[$generalID][$turnIdx] = $brief; } - if($general['train'] >= 80 && $general['atmos'] >= 80){ - $crew80 += $general['crew']; - $gen80 += 1; + $genCntEff = 0; + foreach ($generals as &$general) { + $general['cityText'] = CityConst::byID($general['city'])->name; + $general['troopText'] = $troopName[$general['troop']] ?? '-'; + + if ($general['npc'] != 5) { + $genCntEff += 1; + } + + $lbonus = calcLeadershipBonus($general['officer_level'], $nationLevel); + if ($lbonus > 0) { + $lbonusText = "+{$lbonus}"; + } else { + $lbonusText = ""; + } + $general['lbonus'] = $lbonus; + $general['lbonusText'] = $lbonusText; + + if ($general['injury'] > 0) { + $leadership = intdiv($general['leadership'] * (100 - $general['injury']), 100); + $strength = intdiv($general['strength'] * (100 - $general['injury']), 100); + $intel = intdiv($general['intel'] * (100 - $general['injury']), 100); + $leadership = "{$leadership}{$lbonusText}"; + $strength = "{$strength}"; + $intel = "{$intel}"; + } else { + $leadership = "{$general['leadership']}{$lbonusText}"; + $strength = "{$general['strength']}"; + $intel = "{$general['intel']}"; + } + + $general['leadershipText'] = $leadership; + $general['strengthText'] = $strength; + $general['intelText'] = $intel; + + $general['expLevelText'] = getExpLevel($general['experience']); + + $general['nameText'] = getColoredName($general['name'], $general['npc']); + + $general['modeText'] = formatDefenceTrain($general['defence_train']); + $general['crewtypeText'] = GameUnitConst::byId($general['crewtype'])->name ?? '-'; + + + if ($general['npc'] < 2) { + $turntext = []; + foreach ($generalTurnList[$general['no']] as $turnRawIdx => $turn) { + $turn = StringUtil::subStringForWidth($turn, 0, 41); + $turnIdx = $turnRawIdx + 1; + $turntext[] = " $turnIdx : $turn"; + } + $general['turntext'] = join("
\n", $turntext); + } } + unset($general); - if($general['train'] >= 60 && $general['atmos'] >= 60){ - $crew60 += $general['crew']; - $gen60 += 1; + $genCnt = countPureGeneralFromRawList($generals); + $totalGold = 0; + $totalRice = 0; + $crew90 = 0; + $gen90 = 0; + $crew80 = 0; + $gen80 = 0; + $crew60 = 0; + $gen60 = 0; + $crewTotal = 0; + //$genTotal = 0; + foreach ($generals as $general) { + if ($general['npc'] == 5) { + continue; + } + $totalGold += $general['gold']; + $totalRice += $general['rice']; + + $crewTotal += $general['crew']; + + if ($general['crew'] == 0) { + continue; + } + if ($general['train'] >= 90 && $general['atmos'] >= 90) { + $crew90 += $general['crew']; + $gen90 += 1; + } + + if ($general['train'] >= 80 && $general['atmos'] >= 80) { + $crew80 += $general['crew']; + $gen80 += 1; + } + + if ($general['train'] >= 60 && $general['atmos'] >= 60) { + $crew60 += $general['crew']; + $gen60 += 1; + } } -} -?> + ?> - - ------ - - - - - - - - - - - - - - - -
전체 금전체 쌀평균 금평균 쌀
전체 병력/장수/훈사 90 병력/장수/훈사 80 병력/장수/훈사 60 병력/장수/
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
전체 금전체 쌀평균 금평균 쌀
전체 병력/장수/훈사 90 병력/장수/훈사 80 병력/장수/훈사 60 병력/장수/
-render('generalList', ['generals'=>$generals])?> + render('generalList', ['generals' => $generals]) ?> - - - -
+ + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/b_myBossInfo.php b/hwe/b_myBossInfo.php index bd696ac5..54d0c97c 100644 --- a/hwe/b_myBossInfo.php +++ b/hwe/b_myBossInfo.php @@ -1,4 +1,5 @@ queryFirstRow('SELECT no,nation,officer_level from general where owne $nationID = $me['nation']; $meLevel = $me['officer_level']; -if($meLevel == 0) { +if ($meLevel == 0) { echo "재야입니다."; exit(); } @@ -29,182 +30,202 @@ $nation = $db->queryFirstRow('SELECT nation,name,level,color,chief_set from nati - - - -<?=UniqueConst::$serverName?>: 인사부 - - - - - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 인사부 + + + + + + + + + + + -query('SELECT no, name, officer_level, penalty, permission FROM general WHERE permission = \'ambassador\' AND nation = %i', $nationID); -$auditors = $db->query('SELECT no, name, officer_level, penalty, permission FROM general WHERE permission = \'auditor\' AND nation = %i', $nationID); -$candidateAmbassadors = []; -$candidateAuditors = []; -foreach($ambassadors as $ambassador){ - $candidateAmbassadors[] = $ambassador; -} -foreach($auditors as $auditor){ - $candidateAuditors[] = $auditor; -} -foreach($db->query('SELECT no, name, nation, officer_level, penalty, permission FROM general WHERE nation = %i AND permission = \'normal\' AND officer_level != 12', $nationID) as $candidate){ - $maxPermission = checkSecretMaxPermission($candidate); - if($maxPermission == 4){ - $candidateAmbassadors[] = $candidate; + $ambassadors = $db->query('SELECT no, name, officer_level, penalty, permission FROM general WHERE permission = \'ambassador\' AND nation = %i', $nationID); + $auditors = $db->query('SELECT no, name, officer_level, penalty, permission FROM general WHERE permission = \'auditor\' AND nation = %i', $nationID); + $candidateAmbassadors = []; + $candidateAuditors = []; + foreach ($ambassadors as $ambassador) { + $candidateAmbassadors[] = $ambassador; } - if($maxPermission >= 3){ - $candidateAuditors[] = $candidate; + foreach ($auditors as $auditor) { + $candidateAuditors[] = $auditor; + } + foreach ($db->query('SELECT no, name, nation, officer_level, penalty, permission FROM general WHERE nation = %i AND permission = \'normal\' AND officer_level != 12', $nationID) as $candidate) { + $maxPermission = checkSecretMaxPermission($candidate); + if ($maxPermission == 4) { + $candidateAmbassadors[] = $candidate; + } + if ($maxPermission >= 3) { + $candidateAuditors[] = $candidate; + } } -} -?> - + var candidateAuditors = $value['no'], + 'text' => $value['name'], + "selected" => ($value['permission'] != 'normal') + ]; + }, $candidateAuditors)) ?>; + - - -
인 사 부
-
+ + + + +
인 사 부
+
-= 5) { $btn = "button"; } -else { $btn = "hidden"; } - -$level = Util::convertArrayToDict( - $db->query( - 'SELECT name,officer_level,city,picture,imgsvr,belong from general where nation=%i and officer_level>=%i order by officer_level desc', - $nationID, $lv - ), - 'officer_level' -); - - -$tigers = $db->query('SELECT value, name - FROM rank_data LEFT JOIN general ON rank_data.general_id = general.no - WHERE rank_data.nation_id = %i AND rank_data.type = "killnum" AND value > 0 ORDER BY value DESC LIMIT 5', - $nationID -);// 오호장군 -$tigerstr = join(', ', array_map(function($arr){ - $number = number_format($arr['value']); - return "{$arr['name']}【{$number}】"; -}, $tigers)); - -$eagles = $db->query('SELECT value, name - FROM rank_data LEFT JOIN general ON rank_data.general_id = general.no - WHERE rank_data.nation_id = %i AND rank_data.type = "firenum" AND value > 0 ORDER BY value DESC LIMIT 7', - $nationID -);// 건안칠자 -$eaglestr = join(', ', array_map(function($arr){ - $number = number_format($arr['value']); - return "{$arr['name']}【{$number}】"; -}, $eagles)); - -?> - - - - -= $lv; $i-=2) { - $i1 = $i; $i2 = $i - 1; - $imageTemp1 = GetImageURL($level[$i1]['imgsvr']??0); - $imageTemp2 = GetImageURL($level[$i2]['imgsvr']??0); - ?> - - - - - - - - - - - - - - - - -
; background-color:' colspan=6> - -
");background-size:64px;'>(년)");background-size:64px;'>(년)
오호장군【승전】
건안칠자【계략】
- - - - - - - - + + "; -for($i=10; $i >= $lv; $i--) { - if($i % 2 == 0) { echo ""; } - $officerLevelText = getOfficerLevelText($i, $nation['level']); - echo " + for ($i = 10; $i >= $lv; $i--) { + if ($i % 2 == 0) { + echo ""; + } + $officerLevelText = getOfficerLevelText($i, $nation['level']); + echo " "; - if($i % 2 == 1) { echo ""; } -} -echo " + } else { + $general = $level[$i] ?? null; + if ($general) { + echo "{$general['name']} 【" . CityConst::byID($general['city'])->name . "】"; + } + } + echo ""; + if ($i % 2 == 1) { + echo ""; + } + } + echo "
추 방
대상 장수 -= 5){ - $candidateStrength = $db->query('SELECT no,name,officer_level,city,npc from general where nation=%i and officer_level!=12 and strength>=%i order by npc,binary(name)', $nationID, GameConst::$chiefStatMin); - $candidateIntel = $db->query('SELECT no,name,officer_level,city,npc from general where nation=%i and officer_level!=12 and intel>=%i order by npc,binary(name)', $nationID, GameConst::$chiefStatMin); - $candidateAny = $db->query('SELECT no,name,officer_level,city,npc,leadership,strength,intel,killturn from general where nation=%i and officer_level!=12 order by npc,binary(name)', $nationID); //추방 때문에 조금 더 김 -} -else{ - $candidateStrength = []; - $candidateIntel = []; - $candidateAny = []; -} - - -if($meLevel >= 5 && !isOfficerSet($nation['chief_set'], $meLevel)) { - echo " - + + + + = $lv; $i -= 2) { + $i1 = $i; + $i2 = $i - 1; + $imageTemp1 = GetImageURL($level[$i1]['imgsvr'] ?? 0); + $imageTemp2 = GetImageURL($level[$i2]['imgsvr'] ?? 0); + ?> + + + + + + + + + + + + + + + + + +
; background-color:' colspan=6> + +
+ + ");background-size:64px;'> + (년) + + + ");background-size:64px;'> + (년) +
오호장군【승전】
건안칠자【계략】
+ + + + + + + + + +
추 방
대상 장수 + = 5) { + $candidateStrength = $db->query('SELECT no,name,officer_level,city,npc from general where nation=%i and officer_level!=12 and strength>=%i order by npc,binary(name)', $nationID, GameConst::$chiefStatMin); + $candidateIntel = $db->query('SELECT no,name,officer_level,city,npc from general where nation=%i and officer_level!=12 and intel>=%i order by npc,binary(name)', $nationID, GameConst::$chiefStatMin); + $candidateAny = $db->query('SELECT no,name,officer_level,city,npc,leadership,strength,intel,killturn from general where nation=%i and officer_level!=12 order by npc,binary(name)', $nationID); //추방 때문에 조금 더 김 + } else { + $candidateStrength = []; + $candidateIntel = []; + $candidateAny = []; + } + + + if ($meLevel >= 5 && !isOfficerSet($nation['chief_set'], $meLevel)) { + echo " + "; -} + } -$officerLevelText = getOfficerLevelText(11, $nation['level']); -echo " + $officerLevelText = getOfficerLevelText(11, $nation['level']); + echo "
@@ -212,112 +233,121 @@ echo "
수 뇌 부 임 명
".getOfficerLevelText(12, $nation['level'])."{$level[12]['name']} 【".CityConst::byID($level[12]['city'])->name."】" . getOfficerLevelText(12, $nation['level']) . "{$level[12]['name']} 【" . CityConst::byID($level[12]['city'])->name . "】 {$officerLevelText} "; -if($meLevel >= 5 && !isOfficerSet($nation['chief_set'], 11)) { - echo " + if ($meLevel >= 5 && !isOfficerSet($nation['chief_set'], 11)) { + echo " "; -} else { - if(key_exists(11, $level)){ - echo "{$level[11]['name']} 【".CityConst::byID($level[11]['city'])->name."】"; - } - -} -echo " + } else { + if (key_exists(11, $level)) { + echo "{$level[11]['name']} 【" . CityConst::byID($level[11]['city'])->name . "】"; + } + } + echo "
{$officerLevelText} "; - if($meLevel >= 5 && !isOfficerSet($nation['chief_set'], $i)) { - echo " + if ($meLevel >= 5 && !isOfficerSet($nation['chief_set'], $i)) { + echo " "; - } else { - $general = $level[$i]??null; - if($general){ - echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】"; - } - } - echo "
빨간색은 현재 임명중인 장수, 노란색은 다른 관직에 임명된 장수, 하얀색은 일반 장수를 뜻합니다.
"; -if($meLevel == 12): -?> - - - - - - - - - -
외 교 권 자 임 명
외교권자 - - - 조언자 - - -
- - - -= 5) { - $officerLevelText = getOfficerLevelText(4, $nation['level']); - echo " + if ($meLevel == 12) : + ?> +
+ + + + + + + + + + + + +
외 교 권 자 임 명
외교권자 + + + 조언자 + + +
+ + + + + + = 5) { + $officerLevelText = getOfficerLevelText(4, $nation['level']); + echo " @@ -325,142 +355,142 @@ if($meLevel >= 5) { "; - $officerLevelText = getOfficerLevelText(3, $nation['level']); - echo " + $officerLevelText = getOfficerLevelText(3, $nation['level']); + echo ""; - $officerLevelText = getOfficerLevelText(2, $nation['level']); - echo " + $officerLevelText = getOfficerLevelText(2, $nation['level']); + echo " "; -} -echo " + } + echo " @@ -469,59 +499,73 @@ echo " "; -$citylevel = getCityLevelList(); + $citylevel = getCityLevelList(); -$officerList = []; + $officerList = []; -foreach($db->query('SELECT no,name,npc,city,officer_level,officer_city,belong FROM general WHERE nation = %i AND 2 <= officer_level AND officer_level <= 4', $nationID) as $officer){ - $officerCityID = $officer['officer_city']; - if(!key_exists($officerCityID, $officerList)){ - $officerList[$officerCityID] = []; - } - $officerList[$officerCityID][$officer['officer_level']] = $officer; -} + foreach ($db->query('SELECT no,name,npc,city,officer_level,officer_city,belong FROM general WHERE nation = %i AND 2 <= officer_level AND officer_level <= 4', $nationID) as $officer) { + $officerCityID = $officer['officer_city']; + if (!key_exists($officerCityID, $officerList)) { + $officerList[$officerCityID] = []; + } + $officerList[$officerCityID][$officer['officer_level']] = $officer; + } -$region = 0; -$dummyOfficer = [ - 'name'=>'-', - 'belong'=>0, -]; + $region = 0; + $dummyOfficer = [ + 'name' => '-', + 'belong' => 0, + ]; -$textColor = newColor($nation['color']); -$nationColor = $nation['color']; + $textColor = newColor($nation['color']); + $nationColor = $nation['color']; -foreach($db->query('SELECT city,name,level,region,officer_set from city where nation=%i order by region,level desc,binary(name)', $nationID) as $city) { - $cityID = $city['city']; - $cityOfficerList = $officerList[$cityID]??[]; -?> - - - - - - - + foreach ($db->query('SELECT city,name,level,region,officer_set from city where nation=%i order by region,level desc,binary(name)', $nationID) as $city) { + $cityID = $city['city']; + $cityOfficerList = $officerList[$cityID] ?? []; + ?> + + + + + + + + + + + - - - - - - - - - + + + + + + + + - -
도 시 관 직 임 명
{$officerLevelText} 임명
{$officerLevelText} 임명
{$officerLevelText} 임명
빨간색은 현재 임명중인 장수, 노란색은 다른 관직에 임명된 장수, 하얀색은 일반 장수를 뜻합니다.
도 시 태 수 (사관) 【현재도시】
  
+ +
  (년) 【name?>】-
(년) 【name ?>】-
노란색은 변경 불가능, 하얀색은 변경 가능 관직입니다.
-
- - - -
+ } + ?> + + ※ 노란색은 변경 불가능, 하얀색은 변경 가능 관직입니다. + + +
+ + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/b_myCityInfo.php b/hwe/b_myCityInfo.php index bdca71a5..485bc3ed 100644 --- a/hwe/b_myCityInfo.php +++ b/hwe/b_myCityInfo.php @@ -1,4 +1,5 @@ "selected"]; - - - -<?=UniqueConst::$serverName?>: 세력도시 - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 세력도시 + + + + + + + - - - -
세 력 도 시
정렬순서 : - -
-
- + + 세 력 도 시
+ + + +
정렬순서 : + + +
+ + + + query('SELECT no,name,npc,city,officer_level,officer_city,belong FROM general WHERE nation = %i AND 2 <= officer_level AND officer_level <= 4', $nationID) as $officer){ - $officerCityID = $officer['officer_city']; - if(!key_exists($officerCityID, $officerList)){ - $officerList[$officerCityID] = []; - } - $officerList[$officerCityID][$officer['officer_level']] = $officer; -} - - -$cityList = $db->query('SELECT *,pop/pop_max as poprate from city where nation=%i', $nationID); - - -switch ($type) { - case 1: break; - case 2: usort($cityList, function($lhs, $rhs){return $rhs['pop'] <=> $lhs['pop'];}); break; - case 3: usort($cityList, function($lhs, $rhs){return $rhs['poprate'] <=> $lhs['poprate'];}); break; - case 4: usort($cityList, function($lhs, $rhs){return $rhs['trust'] <=> $lhs['trust'];}); break; - case 5: usort($cityList, function($lhs, $rhs){return $rhs['agri'] <=> $lhs['agri'];}); break; - case 6: usort($cityList, function($lhs, $rhs){return $rhs['comm'] <=> $lhs['comm'];}); break; - case 7: usort($cityList, function($lhs, $rhs){return $rhs['secu'] <=> $lhs['secu'];}); break; - case 8: usort($cityList, function($lhs, $rhs){return $rhs['def'] <=> $lhs['def'];}); break; - case 9: usort($cityList, function($lhs, $rhs){return $rhs['wall'] <=> $lhs['wall'];}); break; - case 10: usort($cityList, function($lhs, $rhs){return $rhs['trade'] <=> $lhs['trade'];}); break; - case 11: usort($cityList, function($lhs, $rhs){ - $cmpTrust = $lhs['region'] <=> $rhs['region']; - if($cmpTrust != 0){ - return $cmpTrust; + $officerList = []; + foreach ($db->query('SELECT no,name,npc,city,officer_level,officer_city,belong FROM general WHERE nation = %i AND 2 <= officer_level AND officer_level <= 4', $nationID) as $officer) { + $officerCityID = $officer['officer_city']; + if (!key_exists($officerCityID, $officerList)) { + $officerList[$officerCityID] = []; } - return $rhs['level']<=>$lhs['level']; - }); break; - case 12: usort($cityList, function($lhs, $rhs){ - $cmpTrust = $rhs['level'] <=> $lhs['level']; - if($cmpTrust != 0){ - return $cmpTrust; + $officerList[$officerCityID][$officer['officer_level']] = $officer; + } + + + $cityList = $db->query('SELECT *,pop/pop_max as poprate from city where nation=%i', $nationID); + + + switch ($type) { + case 1: + break; + case 2: + usort($cityList, function ($lhs, $rhs) { + return $rhs['pop'] <=> $lhs['pop']; + }); + break; + case 3: + usort($cityList, function ($lhs, $rhs) { + return $rhs['poprate'] <=> $lhs['poprate']; + }); + break; + case 4: + usort($cityList, function ($lhs, $rhs) { + return $rhs['trust'] <=> $lhs['trust']; + }); + break; + case 5: + usort($cityList, function ($lhs, $rhs) { + return $rhs['agri'] <=> $lhs['agri']; + }); + break; + case 6: + usort($cityList, function ($lhs, $rhs) { + return $rhs['comm'] <=> $lhs['comm']; + }); + break; + case 7: + usort($cityList, function ($lhs, $rhs) { + return $rhs['secu'] <=> $lhs['secu']; + }); + break; + case 8: + usort($cityList, function ($lhs, $rhs) { + return $rhs['def'] <=> $lhs['def']; + }); + break; + case 9: + usort($cityList, function ($lhs, $rhs) { + return $rhs['wall'] <=> $lhs['wall']; + }); + break; + case 10: + usort($cityList, function ($lhs, $rhs) { + return $rhs['trade'] <=> $lhs['trade']; + }); + break; + case 11: + usort($cityList, function ($lhs, $rhs) { + $cmpTrust = $lhs['region'] <=> $rhs['region']; + if ($cmpTrust != 0) { + return $cmpTrust; + } + return $rhs['level'] <=> $lhs['level']; + }); + break; + case 12: + usort($cityList, function ($lhs, $rhs) { + $cmpTrust = $rhs['level'] <=> $lhs['level']; + if ($cmpTrust != 0) { + return $cmpTrust; + } + return $lhs['region'] <=> $rhs['region']; + }); + break; + } + + $region = 0; + $level = 0; + + foreach ($cityList as $city) { + $cityID = $city['city']; + if ($city['city'] == $nation['capital']) { + $city['name'] = "[{$city['name']}]"; } - return $lhs['region']<=>$rhs['region']; - }); break; -} -$region = 0; -$level = 0; + $officerQuery = []; + $officerName = [ + 2 => '-', + 3 => '-', + 4 => '-' + ]; -foreach($cityList as $city){ - $cityID = $city['city']; - if ($city['city'] == $nation['capital']) { - $city['name'] = "[{$city['name']}]"; - } + $cityOfficerList = $officerList[$cityID] ?? []; + foreach ($cityOfficerList as $cityOfficer) { + $officerName[$cityOfficer['officer_level']] = getColoredName($cityOfficer['name'], $cityOfficer['npc']); + } - $officerQuery = []; - $officerName = [ - 2=>'-', - 3=>'-', - 4=>'-' - ]; + if ($type == 10 && $city['region'] != $region) { + echo "
"; + $region = $city['region']; + } elseif ($type == 11 && $city['level'] != $level) { + echo "
"; + $level = $city['level']; + } - $cityOfficerList = $officerList[$cityID]??[]; - foreach($cityOfficerList as $cityOfficer){ - $officerName[$cityOfficer['officer_level']] = getColoredName($cityOfficer['name'], $cityOfficer['npc']); - } + if ($city['trade'] === null) { + $city['trade'] = "- "; + } - if ($type == 10 && $city['region'] != $region) { - echo "
"; - $region = $city['region']; - } elseif ($type == 11 && $city['level'] != $level) { - echo "
"; - $level = $city['level']; - } - - if ($city['trade'] === null) { - $city['trade'] = "- "; - } - - echo " + echo " - + @@ -164,46 +212,51 @@ foreach($cityList as $city){ - + - + + echo $officerName[4]; + echo " + echo $officerName[3]; + echo " + echo $officerName[2]; + echo "
【 ".CityConst::$regionMap[$city['region']]." | ".CityConst::$levelMap[$city['level']]." 】 {$city['name']}【 " . CityConst::$regionMap[$city['region']] . " | " . CityConst::$levelMap[$city['level']] . " 】 {$city['name']}
주민
민심".round($city['trust'], 1)."" . round($city['trust'], 1) . " 시세 {$city['trade']}% 인구".round($city['pop']/$city['pop_max']*100, 2)." %" . round($city['pop'] / $city['pop_max'] * 100, 2) . " % 태수 "; - echo $officerName[4]; - echo " 군사 "; - echo $officerName[3]; - echo " 종사 "; - echo $officerName[2]; - echo "
장수 "; - $generalList = $db->query('SELECT npc, name FROM general WHERE city = %i AND nation = %i', $city['city'], $me['nation']); - if (!$generalList) { - echo "-"; - } - foreach($generalList as $general) { - echo getColoredName($general['name'], $general['npc']).', '; - } - echo " + $generalList = $db->query('SELECT npc, name FROM general WHERE city = %i AND nation = %i', $city['city'], $me['nation']); + if (!$generalList) { + echo "-"; + } + foreach ($generalList as $general) { + echo getColoredName($general['name'], $general['npc']) . ', '; + } + echo "
"; -} -?> + } + ?> - - - -
+ + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/b_myGenInfo.php b/hwe/b_myGenInfo.php index 6b52c22b..8dec4b95 100644 --- a/hwe/b_myGenInfo.php +++ b/hwe/b_myGenInfo.php @@ -1,11 +1,12 @@ 15) { +if ($type <= 0 || $type > 15) { $type = 1; } @@ -20,7 +21,7 @@ increaseRefresh("세력장수", 1); $me = $db->queryFirstRow('SELECT no,nation,officer_level from general where owner=%i', $userID); -if($me['officer_level'] == 0) { +if ($me['officer_level'] == 0) { echo "재야입니다."; exit(); } @@ -28,8 +29,8 @@ if($me['officer_level'] == 0) { $sel = [$type => "selected"]; $ownerNameList = []; -if($gameStor->isunited){ - foreach(RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]){ +if ($gameStor->isunited) { + foreach (RootDB::db()->queryAllLists('SELECT no, name FROM member') as [$ownerID, $ownerName]) { $ownerNameList[$ownerID] = $ownerName; } } @@ -40,69 +41,75 @@ if($gameStor->isunited){ - - - -<?=UniqueConst::$serverName?>: 세력장수 - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 세력장수 + + + + + + + - - - -
세 력 장 수
정렬순서 : - -
-
- + + 세 력 장 수
+ + + +
정렬순서 : + + +
+ + + + queryFirstField('select level from nation where nation = %i', $me['nation']); + $nationLevel = DB::db()->queryFirstField('select level from nation where nation = %i', $me['nation']); -[$orderKey, $orderDesc] = [ - 1=>['officer_level', true], - 2=>['dedication', true], - 3=>['experience', true], - 4=>['leadership', true], - 5=>['strength', true], - 6=>['intel', true], - 7=>['gold', true], - 8=>['rice', true], - 9=>['crew', true], - 10=>['connect', true], - 11=>['personal', true], - 12=>['special', true], - 13=>['special2', true], - 14=>['belong', true], - 15=>['npc', true], -][$type]; + [$orderKey, $orderDesc] = [ + 1 => ['officer_level', true], + 2 => ['dedication', true], + 3 => ['experience', true], + 4 => ['leadership', true], + 5 => ['strength', true], + 6 => ['intel', true], + 7 => ['gold', true], + 8 => ['rice', true], + 9 => ['crew', true], + 10 => ['connect', true], + 11 => ['personal', true], + 12 => ['special', true], + 13 => ['special2', true], + 14 => ['belong', true], + 15 => ['npc', true], + ][$type]; -$generalList = $db->query('SELECT owner,no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leadership,strength,intel,experience,dedication,officer_level,killturn,connect,gold,rice,crew,belong from general where nation = %i order by %b %l', $me['nation'], $orderKey, $orderDesc?'desc':''); + $generalList = $db->query('SELECT owner,no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leadership,strength,intel,experience,dedication,officer_level,killturn,connect,gold,rice,crew,belong from general where nation = %i order by %b %l', $me['nation'], $orderKey, $orderDesc ? 'desc' : ''); -echo" + echo " @@ -121,66 +128,77 @@ echo" "; -foreach($generalList as $general){ + foreach ($generalList as $general) { - $lbonus = calcLeadershipBonus($general['officer_level'], $nationLevel); - if($lbonus > 0) { - $lbonus = "+{$lbonus}"; - } else { - $lbonus = ""; - } + $lbonus = calcLeadershipBonus($general['officer_level'], $nationLevel); + if ($lbonus > 0) { + $lbonus = "+{$lbonus}"; + } else { + $lbonus = ""; + } - if($general['injury'] > 0) { - $leadership = intdiv($general['leadership'] * (100 - $general['injury']), 100); - $strength = intdiv($general['strength'] * (100 - $general['injury']), 100); - $intel = intdiv($general['intel'] * (100 - $general['injury']), 100); - $leadership = "{$leadership}{$lbonus}"; - $strength = "{$strength}"; - $intel = "{$intel}"; - } else { - $leadership = "{$general['leadership']}{$lbonus}"; - $strength = "{$general['strength']}"; - $intel = "{$general['intel']}"; - } + if ($general['injury'] > 0) { + $leadership = intdiv($general['leadership'] * (100 - $general['injury']), 100); + $strength = intdiv($general['strength'] * (100 - $general['injury']), 100); + $intel = intdiv($general['intel'] * (100 - $general['injury']), 100); + $leadership = "{$leadership}{$lbonus}"; + $strength = "{$strength}"; + $intel = "{$intel}"; + } else { + $leadership = "{$general['leadership']}{$lbonus}"; + $strength = "{$general['strength']}"; + $intel = "{$general['intel']}"; + } - if($general['npc'] >= 2) { $name = "{$general['name']}"; } - elseif($general['npc'] == 1) { $name = "{$general['name']}"; } - else { $name = "{$general['name']}"; } + if ($general['npc'] >= 2) { + $name = "{$general['name']}"; + } elseif ($general['npc'] == 1) { + $name = "{$general['name']}"; + } else { + $name = "{$general['name']}"; + } - if(key_exists($general['owner'], $ownerNameList)){ - $name = $name.'
('.$ownerNameList[$general['owner']].')'; - } + if (key_exists($general['owner'], $ownerNameList)) { + $name = $name . '
(' . $ownerNameList[$general['owner']] . ')'; + } - $imageTemp = GetImageURL($general['imgsvr']); - echo " + $imageTemp = GetImageURL($general['imgsvr']); + echo " - - - - + + + + - - + + - + "; -} + } echo "
얼 굴사 관 벌점
$name"; echo getOfficerLevelText($general['officer_level'], $nationLevel); echo "".getDed($general['dedication'])."".getHonor($general['experience'])."".getBill($general['dedication']).""; + echo getOfficerLevelText($general['officer_level'], $nationLevel); + echo "" . getDed($general['dedication']) . "" . getHonor($general['experience']) . "" . getBill($general['dedication']) . " $leadership $strength $intel {$general['gold']} {$general['rice']}".displayCharInfo($general['personal'])."".displaySpecialDomesticInfo($general['special'])." / ".displaySpecialWarInfo($general['special2'])."" . displayCharInfo($general['personal']) . "" . displaySpecialDomesticInfo($general['special']) . " / " . displaySpecialWarInfo($general['special2']) . " {$general['belong']}{$general['connect']}"; echo "
(".getConnect($general['connect']).")
{$general['connect']}"; + echo "
(" . getConnect($general['connect']) . ")
"; -?> + ?> - - - -
+ + + + + + + +
- + \ No newline at end of file diff --git a/hwe/b_myKingdomInfo.php b/hwe/b_myKingdomInfo.php index 23a112e7..05d9c4c2 100644 --- a/hwe/b_myKingdomInfo.php +++ b/hwe/b_myKingdomInfo.php @@ -1,4 +1,5 @@ queryFirstField('SELECT nation FROM general WHERE owner=%i', $userID); -if($nationID == 0) { +if ($nationID == 0) { echo "재야입니다."; exit(); } @@ -23,139 +24,144 @@ if($nationID == 0) { - - - -<?=UniqueConst::$serverName?>: 세력정보 - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 세력정보 + + + + + + + - - -
세 력 정 보
-
- + + 세 력 정 보
+ + +
+ queryFirstRow('SELECT nation,gennum,power,rate,bill,type,gold,rice,color,name,level,tech,capital FROM nation WHERE nation=%i', $nationID); //국가정보 -$cityList = $db->query('SELECT * FROM city WHERE nation=%i', $nationID); + $nation = $db->queryFirstRow('SELECT nation,gennum,power,rate,bill,type,gold,rice,color,name,level,tech,capital FROM nation WHERE nation=%i', $nationID); //국가정보 + $cityList = $db->query('SELECT * FROM city WHERE nation=%i', $nationID); -$currPop = 0; -$maxPop = 0; -$cityNames = []; + $currPop = 0; + $maxPop = 0; + $cityNames = []; -foreach($cityList as $city){ - $currPop += $city['pop']; - $maxPop += $city['pop_max']; - if($city['city'] == $nation['capital']){ - $cityNames[] = "{$city['name']}"; + foreach ($cityList as $city) { + $currPop += $city['pop']; + $maxPop += $city['pop_max']; + if ($city['city'] == $nation['capital']) { + $cityNames[] = "{$city['name']}"; + } else { + $cityNames[] = $city['name']; + } } - else{ - $cityNames[] = $city['name']; + + [$currCrew, $maxCrew] = $db->queryFirstList('SELECT sum(crew), sum(leadership)*100 FROM general WHERE nation=%i AND npc != 5', $nation['nation']); + $dedicationList = $db->query('SELECT dedication FROM general WHERE nation=%i AND npc!=5', $nationID); + + $goldIncome = getGoldIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); + $warIncome = getWarGoldIncome($nation['type'], $cityList); + $totalGoldIncome = $goldIncome + $warIncome; + + $riceIncome = getRiceIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); + $wallIncome = getWallIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); + $totalRiceIncome = $riceIncome + $wallIncome; + + $outcome = getOutcome($nation['bill'], $dedicationList); + + $budgetgold = $nation['gold'] + $totalGoldIncome - $outcome; + $budgetrice = $nation['rice'] + $totalRiceIncome - $outcome; + $budgetgolddiff = $totalGoldIncome - $outcome; + $budgetricediff = $totalRiceIncome - $outcome; + + if ($budgetgolddiff > 0) { + $budgetgolddiff = '+' . number_format($budgetgolddiff); + } else { + $budgetgolddiff = number_format($budgetgolddiff); + } + if ($budgetricediff > 0) { + $budgetricediff = '+' . number_format($budgetricediff); + } else { + $budgetricediff = number_format($budgetricediff); } -} -[$currCrew, $maxCrew] = $db->queryFirstList('SELECT sum(crew), sum(leadership)*100 FROM general WHERE nation=%i AND npc != 5', $nation['nation']); -$dedicationList = $db->query('SELECT dedication FROM general WHERE nation=%i AND npc!=5', $nationID); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
;background-color:'>【
총주민/총병사/국 력
국 고병 량세 율 %
세금/단기+ / +세곡/둔전+ / +지급률 %
수입/지출+ / -수입/지출+ / -속 령장 수
국고 예산 ()병량 예산 ()기술력작 위
속령일람 :
국가열전
+
-$goldIncome = getGoldIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); -$warIncome = getWarGoldIncome($nation['type'], $cityList); -$totalGoldIncome = $goldIncome + $warIncome; - -$riceIncome = getRiceIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); -$wallIncome = getWallIncome($nation['nation'], $nation['level'], $nation['rate'], $nation['capital'], $nation['type'], $cityList); -$totalRiceIncome = $riceIncome + $wallIncome; - -$outcome = getOutcome($nation['bill'], $dedicationList); - -$budgetgold = $nation['gold'] + $totalGoldIncome - $outcome; -$budgetrice = $nation['rice'] + $totalRiceIncome - $outcome; -$budgetgolddiff = $totalGoldIncome - $outcome; -$budgetricediff = $totalRiceIncome - $outcome; - -if ($budgetgolddiff > 0) { - $budgetgolddiff = '+'.number_format($budgetgolddiff); -} else { - $budgetgolddiff = number_format($budgetgolddiff); -} -if ($budgetricediff > 0) { - $budgetricediff = '+'.number_format($budgetricediff); -} else { - $budgetricediff = number_format($budgetricediff); -} - -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;background-color:'>【
총주민/총병사/국 력
국 고병 량세 율 %
세금/단기+ / +세곡/둔전+ / +지급률 %
수입/지출+ / -수입/지출+ / -속 령장 수
국고 예산 ()병량 예산 ()기술력작 위
속령일람 :
국가열전
-
- - - - -
+ + + + + + + +
- + \ No newline at end of file diff --git a/hwe/b_myPage.php b/hwe/b_myPage.php index c3541a2a..bc6b26e8 100644 --- a/hwe/b_myPage.php +++ b/hwe/b_myPage.php @@ -1,4 +1,5 @@ 0) { } $targetTime = addTurn($me->getVar('lastrefresh'), $gameStor->turnterm, 2); -if($gameStor->turntime <= $gameStor->opentime){ +if ($gameStor->turntime <= $gameStor->opentime) { //서버 가오픈시 할 수 있는 행동 - if($me->getNPCType() == 0){ + if ($me->getNPCType() == 0) { $showDieImmediatelyBtn = true; - if($targetTime <= TimeUtil::now()){ + if ($targetTime <= TimeUtil::now()) { $availableDieImmediately = true; } } } -$use_treatment = $me->getAuxVar('use_treatment')??10; -$use_auto_nation_turn = $me->getAuxVar('use_auto_nation_turn')??1; +$use_treatment = $me->getAuxVar('use_treatment') ?? 10; +$use_auto_nation_turn = $me->getAuxVar('use_auto_nation_turn') ?? 1; ?> + - - - -<?=UniqueConst::$serverName?>: 내정보 - - - - - - - - - + + + + <?= UniqueConst::$serverName ?>: 내정보 + + + + + + + + + - - -
내 정 보
- - - - + + + + + + + + + + + + + + + + + +
- - - + + + + +
내 정 보
+ + + + - - - - - - - - - - - - - - - - - -
+ + + 토너먼트 【 - getVar('tnmt')==0?"checked":""; ?>>수동참여 - getVar('tnmt')==1?"checked":""; ?>>자동참여 + getVar('tnmt') == 0 ? "checked" : ""; ?>>수동참여 + getVar('tnmt') == 1 ? "checked" : ""; ?>>자동참여 】
- ∞개막직전 남는자리가 있을경우 랜덤하게 참여합니다.

+ ∞개막직전 남는자리가 있을경우 랜덤하게 참여합니다.

- 환약 사용 【 + + + + +
- ∞부상을 입었을 때 환약을 사용하는 기준입니다.

-autorun_user['options']['chief'])??false) : ?> - 자동 사령턴 허용 【
- ∞수뇌가 되었을 때 휴식 턴이어도 적당한 턴을 알아서 넣는 것을 허용합니다.

- + ∞부상을 입었을 때 환약을 사용하는 기준입니다.

+ autorun_user['options']['chief']) ?? false) : ?> + 자동 사령턴 허용 【
+ ∞수뇌가 되었을 때 휴식 턴이어도 적당한 턴을 알아서 넣는 것을 허용합니다.

+ 수비 【

- id='set_my_setting' name=btn style=background-color:;color:white;width:160px;height:30px;font-size:14px; value=설정저장>
- ∞설정저장은 이달중 회 남았습니다.

- autorun_user['limit_minutes']??false)): ?> - 휴 가 신 청
-

- - + id='set_my_setting' name=btn style=background-color:;color:white;width:160px;height:30px;font-size:14px; value=설정저장>
+ ∞설정저장은 이달중 회 남았습니다.

+ autorun_user['limit_minutes'] ?? false)) : ?> + 휴 가 신 청
+

+ + - - 가오픈 기간 내 장수 삭제 ( 부터)
-

- + + 가오픈 기간 내 장수 삭제 ( 부터)
+

+ -npcmode==2 && $me->getNPCType()==0): ?> - 다른 장수 선택 (getAuxVar('next_change')??TimeUtil::now(), 0, 19)?> 부터)
-

- + npcmode == 2 && $me->getNPCType() == 0) : ?> + 다른 장수 선택 (getAuxVar('next_change') ?? TimeUtil::now(), 0, 19) ?> 부터)
+

+ - 개인용 CSS
- -
개인 기록전투 기록
-
- -
- -
-
- -
- -
장수 열전전투 결과
- - -
- -
- -
- - - -
+ 개인용 CSS
+ +
+ 개인 기록 + + 전투 기록 +
+
+ +
+ +
+
+ +
+ +
+ 장수 열전 + + 전투 결과 +
+ + +
+ +
+ +
+ + + + + + + +
- + + \ No newline at end of file diff --git a/hwe/b_processing.php b/hwe/b_processing.php index 4e466660..dc3b1a60 100644 --- a/hwe/b_processing.php +++ b/hwe/b_processing.php @@ -1,4 +1,5 @@ setReadOnly(); $db = DB::db(); -if(!$isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableGeneralCommand))){ +if (!$isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableGeneralCommand))) { die_redirect(); } -if($isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableChiefCommand))){ +if ($isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableChiefCommand))) { die_redirect(); } @@ -44,23 +44,22 @@ $gameStor = KVStorage::getStorage($db, 'game_env')->turnOnCache(); $env = $gameStor->getAll(); $general = General::createGeneralObjFromDB($session->generalID); -if(!$isChiefTurn){ +if (!$isChiefTurn) { $commandObj = buildGeneralCommandClass($commandType, $general, $env); -} -else{ - if($general->getVar('officer_level') < 5){ +} else { + if ($general->getVar('officer_level') < 5) { die_redirect(); } $commandObj = buildNationCommandClass($commandType, $general, $env, new LastTurn()); } -if($commandObj->isArgValid()){ +if ($commandObj->isArgValid()) { //인자가 필요없는 타입의 경우 processing에서 '전혀' 처리하지 않음! die_redirect(); } -if(!$commandObj->hasPermissionToReserve()){ +if (!$commandObj->hasPermissionToReserve()) { die_redirect(); } @@ -70,57 +69,68 @@ $cssList = $commandObj->getCSSFiles(); + -<?=$commandObj->getName()?> - - - - - - - - - - - - - - - - - - + <?= $commandObj->getName() ?> + + + + + + + + + + + + + + + + + + - + + - - -
getName()?>
-
-
+ + + + + + + +
getName() ?>
+
+
-
-getForm()?> -
+
+ getForm() ?> +
- -
-
- -
+ + + + +
+
+ +
- + + \ No newline at end of file diff --git a/hwe/b_tournament.php b/hwe/b_tournament.php index a7082811..71911569 100644 --- a/hwe/b_tournament.php +++ b/hwe/b_tournament.php @@ -43,7 +43,7 @@ case 3: $tnmt_type = "설전"; $tp = "intel"; $tp2 = " <?=UniqueConst::$serverName?>: 토너먼트 - + diff --git a/hwe/b_troop.php b/hwe/b_troop.php index 5b687d84..35773333 100644 --- a/hwe/b_troop.php +++ b/hwe/b_troop.php @@ -1,4 +1,5 @@ queryFirstRow('SELECT no,nation,troop FROM general WHERE owner=%i', $userID); $troops = []; -foreach($db->query('SELECT troop_leader,name FROM troop WHERE nation = %i', $me['nation']) as $rawTroop){ +foreach ($db->query('SELECT troop_leader,name FROM troop WHERE nation = %i', $me['nation']) as $rawTroop) { $troops[$rawTroop['troop_leader']] = [ - 'name'=>$rawTroop['name'], - 'users'=>[] + 'name' => $rawTroop['name'], + 'users' => [] ]; } -foreach($db->query( +foreach ($db->query( 'SELECT no,name,turntime,troop,city FROM general WHERE troop!=0 AND nation = %i ORDER BY turntime ASC', $me['nation'] -) as $general -){ - if(!key_exists($general['troop'], $troops)){ +) as $general) { + if (!key_exists($general['troop'], $troops)) { trigger_error("올바르지 않은 부대 소속 {$general['no']}, {$general['name']} : {$general['troop']}"); continue; } @@ -36,33 +36,32 @@ foreach($db->query( $troops[$general['troop']]['users'][] = $general; } -if($troops){ +if ($troops) { $troopLeaders = $db->query( 'SELECT no,name,picture,imgsvr,turntime,city,troop FROM general WHERE no IN %li', array_keys($troops) ); $generalTurnList = []; - foreach($db->queryAllLists( + foreach ($db->queryAllLists( 'SELECT general_id, turn_idx, brief FROM general_turn WHERE general_id IN %li AND turn_idx < 5 ORDER BY general_id ASC, turn_idx ASC', array_column($troopLeaders, 'no') - ) as [$generalID, $turnIdx, $brief] - ){ - if(!key_exists($generalID, $generalTurnList)){ + ) as [$generalID, $turnIdx, $brief]) { + if (!key_exists($generalID, $generalTurnList)) { $generalTurnList[$generalID] = []; } $generalTurnList[$generalID][$turnIdx] = $brief; } - foreach($troopLeaders as $troopLeader){ + foreach ($troopLeaders as $troopLeader) { $imageTemp = GetImageURL($troopLeader['imgsvr']); $troopLeader['pictureFullPath'] = "$imageTemp/{$troopLeader['picture']}"; $troopLeader['cityText'] = CityConst::byID($troopLeader['city'])->name; $turnText = []; - foreach($generalTurnList[$troopLeader['no']] as $rawTurnIdx => $brief){ - if($brief != '집합'){ + foreach ($generalTurnList[$troopLeader['no']] as $rawTurnIdx => $brief) { + if ($brief != '집합') { $brief = '~'; } $turnIdx = $rawTurnIdx + 1; @@ -73,143 +72,168 @@ if($troops){ } } -uasort($troops, function($lhs, $rhs){ - return $lhs['leader']['turntime']<=>$rhs['leader']['turntime']; +uasort($troops, function ($lhs, $rhs) { + return $lhs['leader']['turntime'] <=> $rhs['leader']['turntime']; }) ?> - - - - -<?=UniqueConst::$serverName?>: 부대편성 - - - - - - - - - - + + + + + <?= UniqueConst::$serverName ?>: 부대편성 + + + + + + + + + + -
- - -
부 대 편 성
- - - - - - - - - - - - -$troop) { - $troopLeader = $troop['leader']; - $genlistText = []; - $cityText = $troopLeader['cityText']; - $cityID = $troopLeader['city']; - $leaderID = $troopLeader['no']; +
+
선 택부 대 정 보부 대 장장 수부대장행동
- - - - - - -
+ + + +
부 대 편 성
+ + + + + + + + + + + + + + + + + $troop) { + $troopLeader = $troop['leader']; + $genlistText = []; + $cityText = $troopLeader['cityText']; + $cityID = $troopLeader['city']; + $leaderID = $troopLeader['no']; - foreach ($troop['users'] as $troopUser) { - $spanClass = 'troopUser'; - if ($troopUser['city'] !== $cityID) { - $spanClass.= ' diffCity'; - } - if ($troopUser['no'] == $leaderID) { - $spanClass.= ' leader'; - } - $genlistText[] = " + $genlistText = sprintf('%s (%d명)', join(', ', $genlistText), count($genlistText)); ?> - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + $troop) { + ?> -} //foreach ($troops as $troopNo=>$troop) { -?> + - +
선 택부 대 정 보부 대 장장 수부대장행동
+ + + + + + +

");background-size:64px;'> 
【턴】
+ +

");background-size:64px;'> 
+ 【턴】 + + +
- -
 
");background-size:64px;'>  - -
- - - - -
【턴】
 
");background-size:64px;'>  + +
+ + + + +
+ 【턴】 + + +
+
+ + + + + + + + + + +
부 대 명
- -
- - - - - - - - - - -
부 대 명
- - - - -
-
- + + + + + + + +
+
+ - + + \ No newline at end of file diff --git a/hwe/battle_simulator.php b/hwe/battle_simulator.php index 65b9e737..96d6addd 100644 --- a/hwe/battle_simulator.php +++ b/hwe/battle_simulator.php @@ -1,4 +1,5 @@ year; $me = $db->queryFirstRow('SELECT no, nation, city FROM general WHERE owner =%i', Session::getUserID()); -if($me){ +if ($me) { $generalID = $me['no']; $nationID = $me['nation']; $city = $db->queryFirstRow('SELECT city, level, def, wall FROM city WHERE city = %i', $me['city']); -} -else{ +} else { $generalID = 0; $nationID = 0; $city = [ - 'city'=>0, - 'level'=>5, - 'def'=>1000, - 'wall'=>1000, + 'city' => 0, + 'level' => 5, + 'def' => 1000, + 'wall' => 1000, ]; } -if($nationID){ +if ($nationID) { $nation = $db->queryFirstRow('SELECT level, type, tech, capital FROM nation WHERE nation = %i', $nationID); -} -else{ +} else { $nation = null; } ?> + -<?=UniqueConst::$serverName?>: 전투 시뮬레이터 - - - - - - - - - - - - + <?= UniqueConst::$serverName ?>: 전투 시뮬레이터 + + + + + + + + + + + + + -
-
-
- 전역 설정 -
-
-
-
-
- -
- 년 시작 -
- -
- -
- -
- -
-
-
-
- -
-
-
-
-
-
-
+
+
- 출병국 설정 -
-
-
-
- 국가 성향 -
- -
- 기술 -
- -
- 등급 -
-
-
-
- 국가 규모 -
- -
- 도시 규모 -
- -
- 수도 -
-
- - -
- -
-
- -
-
-
-
-
-
출병자 설정
- -
-
-
-
-
-
- 수비국 설정 + 전역 설정
-
-
- 국가 성향 +
+
+
+ +
년 시작
+ +
+ +
+
- -
- 기술 -
- -
- 등급 -
-
-
-
- 국가 규모 -
- -
- 도시 규모 -
- -
- 수도 -
-
- - -
-
-
-
- 수비 -
- -
- 성벽 -
- -
-
-
-
-
-
수비자 설정
-
-
-
-
수비자 설정
-