From 93d298ef7551cffb467f7e6496e6630fab1e77f8 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 20 Jul 2019 15:22:51 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=EC=9E=A5=EC=88=98=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EC=8B=9C=20=EB=B3=B8=EB=8B=89=20=ED=95=AD=EC=83=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80.=20=EC=82=AC=EB=A7=9D=EC=8B=9C=20=EB=B3=B8=EB=8B=89?= =?UTF-8?q?=20=EC=B6=9C=EB=A0=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/j_get_general_list.php | 2 +- hwe/join_post.php | 1 + hwe/sammo/General.php | 4 +-- hwe/sammo/TextDecoration/DyingMessage.php | 32 ++++++++++------------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/hwe/j_get_general_list.php b/hwe/j_get_general_list.php index aba61d2e..898035ff 100644 --- a/hwe/j_get_general_list.php +++ b/hwe/j_get_general_list.php @@ -73,7 +73,7 @@ foreach($rawGeneralList as $rawGeneral){ getGeneralSpecialWarName($special2), getGenChar($personal), $name, - $name2, + $npc==1?$name2:null, $injury, $leader, $lbonus, diff --git a/hwe/join_post.php b/hwe/join_post.php index 344ddac6..10698ab8 100644 --- a/hwe/join_post.php +++ b/hwe/join_post.php @@ -223,6 +223,7 @@ $affinity = rand()%150 + 1; $db->insert('general', [ 'owner' => $userID, 'name' => $name, + 'name2' => $member['name'], 'picture' => $face, 'imgsvr' => $imgsvr, 'nation' => 0, diff --git a/hwe/sammo/General.php b/hwe/sammo/General.php index e306d0ac..970dff9f 100644 --- a/hwe/sammo/General.php +++ b/hwe/sammo/General.php @@ -277,7 +277,7 @@ class General implements iAction{ $db->delete('troop', 'troop_leader=%i', $troopLeaderID); } - $dyingMessage = new TextDecoration\DyingMessage($this->getName(), $this->getVar('npc')); + $dyingMessage = new TextDecoration\DyingMessage($this); $logger->pushGlobalActionLog($dyingMessage->getText()); $db->delete('general', 'no=%i', $generalID); @@ -563,7 +563,7 @@ class General implements iAction{ 'no', 'name', 'name2', 'picture', 'imgsvr', 'nation', 'nations', 'city', 'troop', 'injury', 'affinity', 'leader', 'leader2', 'power', 'power2', 'intel', 'intel2', 'weap', 'book', 'horse', 'item', 'experience', 'dedication', 'level', 'gold', 'rice', 'crew', 'crewtype', 'train', 'atmos', 'turntime', - 'makelimit', 'killturn', 'block', 'dedlevel', 'explevel', 'age', 'belong', + 'makelimit', 'killturn', 'block', 'dedlevel', 'explevel', 'age', 'startage', 'belong', 'personal', 'special', 'special2', 'mode', 'npc', 'npc_org', 'deadyear', 'npcmsg', 'dex0', 'dex10', 'dex20', 'dex30', 'dex40', 'warnum', 'killnum', 'deathnum', 'killcrew', 'deathcrew', 'recwar', 'last_turn', 'myset' diff --git a/hwe/sammo/TextDecoration/DyingMessage.php b/hwe/sammo/TextDecoration/DyingMessage.php index 0163ac69..84f778bc 100644 --- a/hwe/sammo/TextDecoration/DyingMessage.php +++ b/hwe/sammo/TextDecoration/DyingMessage.php @@ -7,6 +7,7 @@ use \sammo\JosaUtil; class DyingMessage{ private $name; + private $realName; private $npc; static protected $defaultMessage = ':name::이: 사망했습니다.'; @@ -88,31 +89,21 @@ class DyingMessage{ static::$utilNPCMessages = static::getUtilNPCMessageList(); } - protected function _constructWithObj(General $general){ - $this->name = $general->getName(); - $this->npc = $general->getVar('npc'); - } - - protected function _constructWithRawValue(string $name, int $npc){ - $this->name = $name; - $this->npc = $npc; - } - - function __construct($name, ?int $npc = null) + function __construct(General $general) { if(static::$messages === null){ static::initMessageList(); } - if($name instanceof General){ - $this->_constructWithObj($name); - } - else{ - $this->_constructWithRawValue($name, $npc); + $this->general = $general; + $this->name = $general->getName(); + $this->npc = $general->getVar('npc'); + if($general['owner'] > 0 && $general->getVar('startage') - $general->getVar('age') > 1){ + $this->realName = $general->getVar('name2'); } } public function getText():string{ - $name = $this->name ; + $name = $this->name; $npc = $this->npc; if($npc == 0){ @@ -128,7 +119,12 @@ class DyingMessage{ $text = static::$defaultMessage; } - $text = str_replace(':name:', $name, $text); + if($this->realName){ + $text = str_replace(':name:', $name."({$this->realName})", $text); + } + else{ + $text = str_replace(':name:', $name, $text); + } JosaUtil::batch($text, $name); return $text; From 6f7ac86e7f18257dd894e0539d14f696074acb97 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 20 Jul 2019 15:29:47 +0900 Subject: [PATCH 2/4] =?UTF-8?q?c0a30a2640...ff00990520=20=EA=B9=8C?= =?UTF-8?q?=EC=A7=80=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/index.php | 6 ++++-- hwe/j_general_set_permission.php | 2 +- hwe/sammo/ResetHelper.php | 1 + src/sammo/WebUtil.php | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hwe/index.php b/hwe/index.php index b25a3afc..4fcd2e4d 100644 --- a/hwe/index.php +++ b/hwe/index.php @@ -79,11 +79,13 @@ if ($gameStor->npcmode == 0) { } $color = "cyan"; $mapTheme = $gameStor->map_theme; +$serverName = UniqueConst::$serverName; +$serverCnt = $gameStor->server_cnt; ?> -<?=UniqueConst::$serverName?>: 메인 +<?=$serverName?>: 메인 @@ -129,7 +131,7 @@ $(function(){
- + diff --git a/hwe/j_general_set_permission.php b/hwe/j_general_set_permission.php index 76744f36..4de7a5b1 100644 --- a/hwe/j_general_set_permission.php +++ b/hwe/j_general_set_permission.php @@ -32,7 +32,7 @@ $nationID = $me['nation']; if($isAmbassador){ $targetType = 'ambassador'; $targetLevel = 4; - if(count($genlist) > 2){ + if($genlist && count($genlist) > 2){ Json::die([ 'result'=>false, 'reason'=>'외교권자는 최대 둘까지만 설정 가능합니다.' diff --git a/hwe/sammo/ResetHelper.php b/hwe/sammo/ResetHelper.php index 48db1ab9..07073686 100644 --- a/hwe/sammo/ResetHelper.php +++ b/hwe/sammo/ResetHelper.php @@ -241,6 +241,7 @@ class ResetHelper{ 'tnmt_trig'=>$tournament_trig, 'prev_winner'=>$prevWinner, 'tournament'=>0, + 'server_cnt'=>$db->queryFirstField('SELECT count(*) FROM ng_games') ]; foreach(RootDB::db()->query('SELECT `no`, `name`, `picture`, `imgsvr` FROM member WHERE grade >= 5') as $admin){ diff --git a/src/sammo/WebUtil.php b/src/sammo/WebUtil.php index 29e0da6d..45672612 100644 --- a/src/sammo/WebUtil.php +++ b/src/sammo/WebUtil.php @@ -154,6 +154,9 @@ class WebUtil } $config = \HTMLPurifier_HTML5Config::createDefault(); + $config->set('Filter.Custom', array (new \HTMLPurifier_Filter_YouTube())); + $config->set('HTML.SafeIframe', true); + $config->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%'); //allow YouTube and Vime $def = $config->getHTMLDefinition(); $def->info_global_attr['data-flip'] = new \HTMLPurifier_AttrDef_Text; $purifier = new \HTMLPurifier($config); From f027f7f225949e6ba77696cb9ff3574188fd215f Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 20 Jul 2019 15:32:01 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=ED=9B=88=EB=A0=A8,=20=EC=82=AC=EA=B8=B0?= =?UTF-8?q?=ED=85=9C=20=ED=9A=A8=EA=B3=BC=20=EB=91=90=EB=B0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/ActionItem/che_사기_두강주.php | 4 ++-- hwe/sammo/ActionItem/che_사기_보령압주.php | 4 ++-- hwe/sammo/ActionItem/che_사기_의적주.php | 4 ++-- hwe/sammo/ActionItem/che_사기_초선화.php | 4 ++-- hwe/sammo/ActionItem/che_사기_춘화첩.php | 4 ++-- hwe/sammo/ActionItem/che_사기_탁주.php | 4 ++-- hwe/sammo/ActionItem/che_훈련_과실주.php | 4 ++-- hwe/sammo/ActionItem/che_훈련_단결도.php | 4 ++-- hwe/sammo/ActionItem/che_훈련_이강주.php | 4 ++-- hwe/sammo/ActionItem/che_훈련_철벽서.php | 4 ++-- hwe/sammo/ActionItem/che_훈련_청주.php | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/hwe/sammo/ActionItem/che_사기_두강주.php b/hwe/sammo/ActionItem/che_사기_두강주.php index eacab650..ee36c890 100644 --- a/hwe/sammo/ActionItem/che_사기_두강주.php +++ b/hwe/sammo/ActionItem/che_사기_두강주.php @@ -7,13 +7,13 @@ class che_사기_의적주 extends \sammo\BaseItem{ protected static $id = 15; protected static $name = '두강주(사기)'; - protected static $info = '[전투] 사기 보정 +5'; + protected static $info = '[전투] 사기 보정 +10'; protected static $cost = 200; protected static $consumable = false; public function onCalcStat(General $general, string $statName, $value, $aux=null){ if($statName === 'bonusAtmos'){ - return $value + 5; + return $value + 10; } return $value; } diff --git a/hwe/sammo/ActionItem/che_사기_보령압주.php b/hwe/sammo/ActionItem/che_사기_보령압주.php index 0043e528..51b9fa34 100644 --- a/hwe/sammo/ActionItem/che_사기_보령압주.php +++ b/hwe/sammo/ActionItem/che_사기_보령압주.php @@ -7,13 +7,13 @@ class che_사기_보령압주 extends \sammo\BaseItem{ protected static $id = 16; protected static $name = '보령압주(사기)'; - protected static $info = '[전투] 사기 보정 +5'; + protected static $info = '[전투] 사기 보정 +10'; protected static $cost = 200; protected static $consumable = false; public function onCalcStat(General $general, string $statName, $value, $aux=null){ if($statName === 'bonusAtmos'){ - return $value + 5; + return $value + 10; } return $value; } diff --git a/hwe/sammo/ActionItem/che_사기_의적주.php b/hwe/sammo/ActionItem/che_사기_의적주.php index d91701ff..9b7cb7f9 100644 --- a/hwe/sammo/ActionItem/che_사기_의적주.php +++ b/hwe/sammo/ActionItem/che_사기_의적주.php @@ -7,13 +7,13 @@ class che_사기_의적주 extends \sammo\BaseItem{ protected static $id = 14; protected static $name = '의적주(사기)'; - protected static $info = '[전투] 사기 보정 +5'; + protected static $info = '[전투] 사기 보정 +10'; protected static $cost = 200; protected static $consumable = false; public function onCalcStat(General $general, string $statName, $value, $aux=null){ if($statName === 'bonusAtmos'){ - return $value + 5; + return $value + 10; } return $value; } diff --git a/hwe/sammo/ActionItem/che_사기_초선화.php b/hwe/sammo/ActionItem/che_사기_초선화.php index 2cc17f8b..e528f3b7 100644 --- a/hwe/sammo/ActionItem/che_사기_초선화.php +++ b/hwe/sammo/ActionItem/che_사기_초선화.php @@ -7,13 +7,13 @@ class che_사기_초선화 extends \sammo\BaseItem{ protected static $id = 20; protected static $name = '초선화(사기)'; - protected static $info = '[전투] 사기 보정 +7'; + protected static $info = '[전투] 사기 보정 +14'; protected static $cost = 200; protected static $consumable = false; public function onCalcStat(General $general, string $statName, $value, $aux=null){ if($statName === 'bonusAtmos'){ - return $value + 7; + return $value + 14; } return $value; } diff --git a/hwe/sammo/ActionItem/che_사기_춘화첩.php b/hwe/sammo/ActionItem/che_사기_춘화첩.php index 6477c75c..3c178a6d 100644 --- a/hwe/sammo/ActionItem/che_사기_춘화첩.php +++ b/hwe/sammo/ActionItem/che_사기_춘화첩.php @@ -7,13 +7,13 @@ class che_사기_춘화첩 extends \sammo\BaseItem{ protected static $id = 19; protected static $name = '춘화첩(사기)'; - protected static $info = '[전투] 사기 보정 +7'; + protected static $info = '[전투] 사기 보정 +14'; protected static $cost = 200; protected static $consumable = false; public function onCalcStat(General $general, string $statName, $value, $aux=null){ if($statName === 'bonusAtmos'){ - return $value + 7; + return $value + 14; } return $value; } diff --git a/hwe/sammo/ActionItem/che_사기_탁주.php b/hwe/sammo/ActionItem/che_사기_탁주.php index 50f75844..6bba1049 100644 --- a/hwe/sammo/ActionItem/che_사기_탁주.php +++ b/hwe/sammo/ActionItem/che_사기_탁주.php @@ -8,7 +8,7 @@ class che_사기_탁주 extends \sammo\BaseItem{ protected static $id = 3; protected static $name = '탁주(사기)'; - protected static $info = '[전투] 사기 +3. 1회용'; + protected static $info = '[전투] 사기 +6. 1회용'; protected static $cost = 1000; protected static $consumable = true; protected static $buyable = true; @@ -16,7 +16,7 @@ class che_사기_탁주 extends \sammo\BaseItem{ public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ return new WarUnitTriggerCaller( - new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'atmos', '+', 3) + new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'atmos', '+', 6) ); } } \ No newline at end of file diff --git a/hwe/sammo/ActionItem/che_훈련_과실주.php b/hwe/sammo/ActionItem/che_훈련_과실주.php index d33dbb0a..309f449c 100644 --- a/hwe/sammo/ActionItem/che_훈련_과실주.php +++ b/hwe/sammo/ActionItem/che_훈련_과실주.php @@ -7,13 +7,13 @@ class che_훈련_과실주 extends \sammo\BaseItem{ protected static $id = 12; protected static $name = '과실주(훈련)'; - protected static $info = '[전투] 훈련 보정 +5'; + protected static $info = '[전투] 훈련 보정 +10'; protected static $cost = 200; protected static $consumable = false; public function onCalcStat(General $general, string $statName, $value, $aux=null){ if($statName === 'bonusTrain'){ - return $value + 5; + return $value + 10; } return $value; } diff --git a/hwe/sammo/ActionItem/che_훈련_단결도.php b/hwe/sammo/ActionItem/che_훈련_단결도.php index ef9d4ae5..66cbff3c 100644 --- a/hwe/sammo/ActionItem/che_훈련_단결도.php +++ b/hwe/sammo/ActionItem/che_훈련_단결도.php @@ -7,13 +7,13 @@ class che_훈련_단결도 extends \sammo\BaseItem{ protected static $id = 18; protected static $name = '단결도(훈련)'; - protected static $info = '[전투] 훈련 보정 +7'; + protected static $info = '[전투] 훈련 보정 +14'; protected static $cost = 200; protected static $consumable = false; public function onCalcStat(General $general, string $statName, $value, $aux=null){ if($statName === 'bonusTrain'){ - return $value + 7; + return $value + 14; } return $value; } diff --git a/hwe/sammo/ActionItem/che_훈련_이강주.php b/hwe/sammo/ActionItem/che_훈련_이강주.php index c0e50a0a..5a379364 100644 --- a/hwe/sammo/ActionItem/che_훈련_이강주.php +++ b/hwe/sammo/ActionItem/che_훈련_이강주.php @@ -7,13 +7,13 @@ class che_훈련_이강주 extends \sammo\BaseItem{ protected static $id = 13; protected static $name = '이강주(훈련)'; - protected static $info = '[전투] 훈련 보정 +5'; + protected static $info = '[전투] 훈련 보정 +10'; protected static $cost = 200; protected static $consumable = false; public function onCalcStat(General $general, string $statName, $value, $aux=null){ if($statName === 'bonusTrain'){ - return $value + 5; + return $value + 10; } return $value; } diff --git a/hwe/sammo/ActionItem/che_훈련_철벽서.php b/hwe/sammo/ActionItem/che_훈련_철벽서.php index 7500c91b..d3f411f5 100644 --- a/hwe/sammo/ActionItem/che_훈련_철벽서.php +++ b/hwe/sammo/ActionItem/che_훈련_철벽서.php @@ -7,13 +7,13 @@ class che_훈련_철벽서 extends \sammo\BaseItem{ protected static $id = 17; protected static $name = '철벽서(훈련)'; - protected static $info = '[전투] 훈련 보정 +7'; + protected static $info = '[전투] 훈련 보정 +14'; protected static $cost = 200; protected static $consumable = false; public function onCalcStat(General $general, string $statName, $value, $aux=null){ if($statName === 'bonusTrain'){ - return $value + 7; + return $value + 14; } return $value; } diff --git a/hwe/sammo/ActionItem/che_훈련_청주.php b/hwe/sammo/ActionItem/che_훈련_청주.php index bb9e68e9..2291427b 100644 --- a/hwe/sammo/ActionItem/che_훈련_청주.php +++ b/hwe/sammo/ActionItem/che_훈련_청주.php @@ -8,7 +8,7 @@ class che_훈련_청주 extends \sammo\BaseItem{ protected static $id = 4; protected static $name = '청주(훈련)'; - protected static $info = '[전투] 훈련 +3. 1회용'; + protected static $info = '[전투] 훈련 +6. 1회용'; protected static $cost = 1000; protected static $consumable = true; protected static $buyable = true; @@ -16,7 +16,7 @@ class che_훈련_청주 extends \sammo\BaseItem{ public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ return new WarUnitTriggerCaller( - new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'train', '+', 3) + new 능력치변경($unit, BaseWarUnitTrigger::TYPE_CONSUMABLE_ITEM, 'train', '+', 6) ); } } \ No newline at end of file From 9e45800367e67ca19ae506d46a984fdfa6353c1a Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 20 Jul 2019 15:48:30 +0900 Subject: [PATCH 4/4] =?UTF-8?q?94f3906949...06f86c6c27=20=EB=B0=98?= =?UTF-8?q?=EC=98=81,=20=EC=8B=9C=EC=A6=8C=20=EA=B0=92,=20=EB=B6=80?= =?UTF-8?q?=EB=8C=80=EC=A0=95=EB=B3=B4,=20=EC=99=95=EC=A1=B0=EC=9D=BC?= =?UTF-8?q?=EB=9E=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_emperior.php | 12 ++++++++- hwe/a_hallOfFame.php | 43 +++++++++++++++++++++--------- hwe/d_setting/UniqueConst.orig.php | 1 + hwe/func.php | 22 +++++++++++++-- hwe/func_template.php | 2 +- hwe/js/hallOfFame.js | 9 ++++--- hwe/sammo/ResetHelper.php | 21 +++++++++++++-- hwe/sql/schema.sql | 4 ++- 8 files changed, 91 insertions(+), 23 deletions(-) diff --git a/hwe/a_emperior.php b/hwe/a_emperior.php index 2d7ea874..7d5ec491 100644 --- a/hwe/a_emperior.php +++ b/hwe/a_emperior.php @@ -98,11 +98,21 @@ foreach($emperiors as $emperior){ - + + + + + + + + + + +
삼국지 모의전투 HiDCHe ()삼국지 모의전투 HiDCHe 기 ()
승 상 위 장 군표 기 장 군 사 공
거 기 장 군태 위위 장 군사 도
diff --git a/hwe/a_hallOfFame.php b/hwe/a_hallOfFame.php index b0f8cb23..633f7632 100644 --- a/hwe/a_hallOfFame.php +++ b/hwe/a_hallOfFame.php @@ -5,26 +5,36 @@ include "lib.php"; include "func.php"; $session = Session::getInstance()->setReadOnly(); +$seasonIdx = Util::getReq('seasonIdx', 'int', UniqueConst::$seasonIdx); $scenarioIdx = Util::getReq('scenarioIdx', 'int', null); $db = DB::db(); increaseRefresh("명예의전당", 1); -$scenarioList= []; -foreach($db->query('SELECT scenario_name as name, count(scenario) as cnt, scenario from ng_games group by scenario order by scenario asc') as $scenarioInfo){ - $scenarioList[$scenarioInfo['scenario']] = $scenarioInfo; -} +$scenarioList = (function(){ + $db = DB::db(); + $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)){ + $scenarioList[$seasonIdx] = []; + } + $scenarioList[$seasonIdx][$scenarioIdx] = $scenarioInfo; + } + return $scenarioList; +})(); if($scenarioIdx !== null || key_exists($scenarioIdx, $scenarioList)){ - $searchScenarioName = $scenarioList[$scenarioIdx]['name']; - $searchFilter = $db->sqleval('scenario = %i', $scenarioIdx); + $searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name']; + $searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx); } else{ $searchScenarioName = '* 모두 *'; - $searchFilter = $db->sqleval(true); + $searchFilter = $db->sqleval('season = %i', $seasonIdx); } ?> @@ -53,12 +63,19 @@ else{ 명 예 의 전 당
시나리오 검색 : diff --git a/hwe/d_setting/UniqueConst.orig.php b/hwe/d_setting/UniqueConst.orig.php index 29dd6dbe..6627a649 100644 --- a/hwe/d_setting/UniqueConst.orig.php +++ b/hwe/d_setting/UniqueConst.orig.php @@ -4,6 +4,7 @@ namespace sammo; class UniqueConst{ public static $serverID = '_tK_serverID_'; public static $serverName = '_tK_serverName_'; + public static $seasonIdx = '_tK_seasonIdx_'; private function __construct(){} diff --git a/hwe/func.php b/hwe/func.php index 440a7a10..fc8ec6d2 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -654,7 +654,24 @@ function generalInfo($no) { $lbonus = ""; } - $troopName = getTroopName($general['troop'])??'-'; + if($general['troop'] == 0){ + $troopInfo = '-'; + } + else{ + $troopCity = $db->queryFirstField('SELECT city FROM general WHERE no=%i', $general['troop']); + $troopTurn = $db->queryFirstField('SELECT `action` FROM general_turn WHERE general_id = %i AND turn_idx = 0', $general['troop']); + $troopInfo = $db->queryFirstField('SELECT name FROM troop WHERE troop_leader = %i', $general['troop']); + + $troopInfo = $troop['name']; + + if($troopTurn == 'che_집합'){ + $troopInfo = "{$troopInfo}"; + } + else if($troopCity != $general['city']){ + $troopCityName = CityConst::byID($troopCity)->name; + $troopInfo = "{$troopInfo}({$troopCityName})"; + } + } $level = getLevel($general['level'], $nation['level']); if($general['level'] == 2) { @@ -796,7 +813,7 @@ function generalInfo($no) { 부대 - {$troopName} + {$troopInfo} 벌점 ".getConnect($general['connect'])." {$general['connect']}({$general['con']}) @@ -1473,6 +1490,7 @@ function CheckHall($no) { $db->insertIgnore('ng_hall', [ 'server_id'=>UniqueConst::$serverID, + 'season'=>UniqueConst::$seasonIdx, 'scenario'=>$scenarioIdx, 'general_no'=>$no, 'type'=>$idx, diff --git a/hwe/func_template.php b/hwe/func_template.php index 3306dfaf..a31de307 100644 --- a/hwe/func_template.php +++ b/hwe/func_template.php @@ -43,7 +43,7 @@ foreach(range(1, GameConst::$maxChiefTurn - 1) as $turnIdx){ $turnText = join("\n", $turnList); return " - {$turnText} "; diff --git a/hwe/js/hallOfFame.js b/hwe/js/hallOfFame.js index ad475cfd..9a2c165e 100644 --- a/hwe/js/hallOfFame.js +++ b/hwe/js/hallOfFame.js @@ -1,7 +1,10 @@ jQuery(function($){ $('#by_scenario').change(function(){ - var scenarioIdx = $(this).val(); - $.redirect('a_hallOfFame.php', {scenarioIdx:scenarioIdx}, 'get'); + var $this = $(this); + var scenarioIdx = $this.val(); + var seasonIdx = $(this).find('option:selected').data('season'); + + + $.redirect('a_hallOfFame.php', {scenarioIdx:scenarioIdx, seasonIdx:seasonIdx}, 'get'); }) - //$.redirect("processing.php",{ commandtype: commandtype, turn: turn}, 'post'); }); \ No newline at end of file diff --git a/hwe/sammo/ResetHelper.php b/hwe/sammo/ResetHelper.php index 07073686..ca939722 100644 --- a/hwe/sammo/ResetHelper.php +++ b/hwe/sammo/ResetHelper.php @@ -81,11 +81,23 @@ class ResetHelper{ mkdir($servRoot.'/logs/'.$serverID, 0755); mkdir($servRoot.'/data/'.$serverID, 0755); + $seasonIdx = 1; + if($db->queryFirstField('SHOW TABLES LIKE %s', 'storage') !== null){ + $gameStor = KVStorage::getStorage($db, 'game_env'); + $nextSeasonIdx = $gameStor->next_season_idx; + if($nextSeasonIdx !== null){ + $seasonIdx = $nextSeasonIdx; + } + $gameStor->resetCache(); + } + + $result = Util::generateFileUsingSimpleTemplate( $servRoot.'/d_setting/UniqueConst.orig.php', $servRoot.'/d_setting/UniqueConst.php',[ 'serverID'=>$serverID, 'serverName'=>AppConf::getList()[$prefix]->getKorName(), + 'seasonIdx'=>$seasonIdx, ], true ); @@ -112,12 +124,15 @@ class ResetHelper{ } } - (KVStorage::getStorage($db, 'game_env'))->resetValues(); + $gameStor = KVStorage::getStorage($db, 'game_env'); + $gameStor->resetValues(); + $gameStor->next_season_idx = $seasonIdx; (KVStorage::getStorage($db, 'nation_env'))->resetValues(); return [ 'result'=>true, - 'serverID'=>$serverID + 'serverID'=>$serverID, + 'seasonIdx'=>$seasonIdx ]; } @@ -154,6 +169,7 @@ class ResetHelper{ } $serverID = $clearResult['serverID']; + $seasonIdx = $clearResult['seasonIdx']; $scenarioObj = new Scenario($scenario, false); $scenarioObj->buildConf(); @@ -220,6 +236,7 @@ class ResetHelper{ 'init_year'=> $year, 'init_month'=>$month, 'map_theme' => $scenarioObj->getMapTheme(), + 'season'=>$seasonIdx, 'msg'=>'공지사항',//TODO:공지사항 'maxgeneral'=>GameConst::$defaultMaxGeneral, 'maxnation'=>GameConst::$defaultMaxNation, diff --git a/hwe/sql/schema.sql b/hwe/sql/schema.sql index 0fd91ccb..dd6dcd0a 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -332,6 +332,7 @@ ENGINE=InnoDB; CREATE TABLE IF NOT EXISTS `ng_hall` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `server_id` CHAR(20) NOT NULL, + `season` INT(11) NOT NULL, `scenario` INT(11) NOT NULL, `general_no` INT(11) NOT NULL, `type` INT(11) NOT NULL, @@ -342,7 +343,7 @@ CREATE TABLE IF NOT EXISTS `ng_hall` ( UNIQUE INDEX `server_general` (`server_id`, `type`, `general_no`), UNIQUE INDEX `owner` (`owner`, `server_id`, `type`), INDEX `server_show` (`server_id`, `type`, `value`), - INDEX `scenario` (`scenario`, `type`, `value`) + INDEX `scenario` (`season`, `scenario`, `type`, `value`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPRESSED; @@ -357,6 +358,7 @@ CREATE TABLE IF NOT EXISTS `ng_games` ( `date` DATETIME NOT NULL, `winner_nation` INT(11) NULL DEFAULT NULL, `map` VARCHAR(50) NULL DEFAULT NULL, + `season` INT(11) NOT NULL, `scenario` INT(11) NOT NULL, `scenario_name` TEXT NOT NULL, `env` TEXT NOT NULL COMMENT 'json',