diff --git a/hwe/b_myBossInfo.php b/hwe/b_myBossInfo.php
index 772e168a..d920ba43 100644
--- a/hwe/b_myBossInfo.php
+++ b/hwe/b_myBossInfo.php
@@ -137,14 +137,14 @@ $eaglestr = join(', ', array_map(function($arr){
return "{$arr['name']}【{$number}】";
}, $eagles));
-echo "
+?>
- |
+ | ; bgcolor==$nation['color']?>' colspan=6>
【 {$nation['name']} 】
|
-";
+= $lv; $i-=2) {
$i1 = $i; $i2 = $i - 1;
$imageTemp1 = GetImageURL($level[$i1]['imgsvr']??0);
@@ -172,7 +172,6 @@ for($i=12; $i >= $lv; $i-=2) {
|
@@ -217,7 +215,6 @@ echo "
".getLevelText(12, $nation['level'])." |
{$general['name']} 【".CityConst::byID($general['city'])->name."】 |
".getLevelText(11, $nation['level'])." |
-
";
@@ -271,7 +267,6 @@ for($i=10; $i >= $lv; $i--) {
if($i % 2 == 0) { echo ""; }
echo "
| ".getLevelText($i, $nation['level'])." |
-";
+ echo "";
if($i % 2 == 1) { echo "
"; }
}
echo "
@@ -345,7 +340,6 @@ endif;
if($meLevel >= 5) {
echo "
| 도 시 관 직 임 명 |
-
-
-
";
}
echo "
diff --git a/hwe/j_get_nation_general_list.php b/hwe/j_get_nation_general_list.php
new file mode 100644
index 00000000..cf6528bc
--- /dev/null
+++ b/hwe/j_get_nation_general_list.php
@@ -0,0 +1,161 @@
+setReadOnly();
+$userID = Session::getUserID();
+
+$db = DB::db();
+$reqType = Util::getReq('req', 'int', 1);
+$reqForce = Util::getReq('force', 'bool', false);
+$gameStor = KVStorage::getStorage($db, 'game_env');
+
+increaseRefresh("세력장수", 1);
+
+$me = $db->queryFirstRow('SELECT con, turntime, nation, level, permission, penalty FROM general WHERE owner=%i', $userID);
+$con = checkLimit($me['con']);
+if ($con >= 2) {
+ Json::die([
+ 'result'=>false,
+ 'reason'=>'접속 제한중입니다. 1턴 이내에 너무 많은 갱신을 하셨습니다.'
+ ]);
+}
+
+$nationID = $me['nation'];
+$permission = checkSecretPermission($me, true);
+if($reqForce && $reqType > $permission){
+ Json::die([
+ 'result'=>false,
+ 'reason'=>'권한이 부족합니다.'
+ ]);
+}
+$permission = min($reqType, $permission);
+$nationArr = getNationStaticInfo($nationID);
+$viewColumns = [
+ 'no'=>1,
+ 'name'=>1,
+ 'owner_name'=>9,
+ 'nation'=>1,
+ 'city'=>1,
+ 'level'=>1,
+ 'npc'=>1,
+ 'defence_train'=>2,
+ 'troop'=>2,
+ 'injury'=>1,
+ 'leadership'=>1,
+ 'strength'=>1,
+ 'intel'=>1,
+ 'experience'=>1,
+ 'explevel'=>1,
+ 'dedication'=>1,
+ 'dedlevel'=>1,
+ 'gold'=>1,
+ 'rice'=>1,
+ 'crewtype'=>2,
+ 'crew'=>2,
+ 'train'=>2,
+ 'atmos'=>2,
+ 'killturn'=>1,
+ 'turntime'=>2,
+ 'picture'=>1,
+ 'imgsvr'=>1,
+ 'age'=>1,
+ 'special'=>1,
+ 'special2'=>1,
+ 'personal'=>1,
+ 'horse'=>3,
+ 'weapon'=>3,
+ 'book'=>3,
+ 'item'=>3,
+ 'connect'=>1
+];
+
+$customViewColumns = [
+ 'lbonus'=>1,
+ 'ownerName'=>1,
+ 'levelText'=>1,
+ 'honorText'=>1,
+ 'expLevelText'=>1,
+];
+
+$specialViewFilter = [
+ 'special'=>function($rawGeneral){
+ return getGeneralSpecialDomesticName($rawGeneral['special']);
+ },
+ 'special2'=>function($rawGeneral){
+ return getGeneralSpecialWarName($rawGeneral['special2']);
+ },
+ 'personal'=>function($rawGeneral){
+ return getGenChar($rawGeneral['personal']);
+ },
+ 'lbonus'=>function($rawGeneral)use($nationArr){
+ return calcLeadershipBonus($rawGeneral['level'], $nationArr['level']);
+ },
+ 'ownerName'=>function($rawGeneral){
+ if($rawGeneral['npc']!=1){
+ return null;
+ }
+ return $rawGeneral['owner_name'];
+ },
+ 'levelText'=>function($rawGeneral)use($nationArr){
+ return getLevelText($rawGeneral['level'], $nationArr['level']);
+ },
+ 'honorText'=>function($rawGeneral){
+ return getHonor($rawGeneral['experience']);
+ },
+ 'dedLevelText'=>function($rawGeneral){
+ return getDedLevelText($rawGeneral['dedLevel']);
+ },
+ 'turntime'=>function($rawGeneral){
+ //'0000-00-00 11:23';
+ return substr($rawGeneral['turntime'], 11, 5);
+ }
+
+];
+
+$queryColumns = General::mergeQueryColumn(array_keys($viewColumns), 1);
+
+$rawGeneralList = Util::convertArrayToDict($db->queryAllLists('SELECT %lb from general WHERE nation = %i', $queryColumns, $nationID), 'no');
+
+$resultColumns = [];
+foreach($viewColumns as $column=>$reqPermission){
+ if($reqPermission > $permission){
+ continue;
+ }
+ $resultColumns[] = $column;
+}
+
+foreach($customViewColumns as $column=>$reqPermission){
+ if($reqPermission > $permission){
+ continue;
+ }
+ $resultColumns[] = $column;
+}
+
+foreach($rawGeneralList as $rawGeneral){
+ //General 생성?
+
+ $item = [];
+ foreach($resultColumns as $column){
+ $value = $rawGeneral[$column];
+ if(key_exists($column, $specialViewFilter)){
+ $value = $specialViewFilter[$column]($rawGeneral);
+ }
+ $item[] = $value;
+ }
+
+ $generalList[] = $item;
+}
+
+$result = [
+ 'result'=>true,
+ 'column'=>$resultColumns,
+ 'list'=>$generalList,
+];
+
+Json::die($result);
diff --git a/hwe/sammo/General.php b/hwe/sammo/General.php
index a9fdeab6..9fe79d92 100644
--- a/hwe/sammo/General.php
+++ b/hwe/sammo/General.php
@@ -874,9 +874,7 @@ class General implements iAction{
return $caller;
}
- //TODO:createGeneralObjListFromDB로, 조건으로 select query나 generalIDList가 들어가는 녀석이 필요할 수 있음
-
- static private function mergeQueryColumn(?array $reqColumns=null, int $constructMode=2):array{
+ static public function mergeQueryColumn(?array $reqColumns=null, int $constructMode=2):array{
$minimumColumn = ['no', 'name', 'city', 'nation', 'level'];
$defaultEventColumn = [
'no', 'name', 'city', 'nation', 'level',
@@ -1052,6 +1050,7 @@ class General implements iAction{
* @return GeneralCommand[][]
*/
static public function getReservedTurnListByGeneralList(array $generalList, int $turnIdxFrom, int $turnIdxTo, array $env){
+ //XXX: static인데 return값이 General이 아니라고?? GeneralCommandHelper같은게 있어야하지 않을까?
if(!$generalList){
return [];
}