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){ 승 상 - 위 장 군 + 표 기 장 군 사 공 + + 거 기 장 군 + + 태 위 + + 위 장 군 + + 사 도 + + diff --git a/hwe/a_hallOfFame.php b/hwe/a_hallOfFame.php index 42f7bc13..633f7632 100644 --- a/hwe/a_hallOfFame.php +++ b/hwe/a_hallOfFame.php @@ -26,6 +26,8 @@ $scenarioList = (function(){ return $scenarioList; })(); + + if($scenarioIdx !== null || key_exists($scenarioIdx, $scenarioList)){ $searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name']; $searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx); 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 2d79dda0..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']}) 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/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/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/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 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/ResetHelper.php b/hwe/sammo/ResetHelper.php index c0d78b24..588b22e6 100644 --- a/hwe/sammo/ResetHelper.php +++ b/hwe/sammo/ResetHelper.php @@ -96,7 +96,7 @@ class ResetHelper{ $servRoot.'/d_setting/UniqueConst.php',[ 'serverID'=>$serverID, 'serverName'=>AppConf::getList()[$prefix]->getKorName(), - 'seasonIdx'=>$seasonIdx + 'seasonIdx'=>$seasonIdx, ], true ); @@ -235,6 +235,7 @@ class ResetHelper{ 'init_year'=> $year, 'init_month'=>$month, 'map_theme' => $scenarioObj->getMapTheme(), + 'season'=>$seasonIdx, 'msg'=>'공지사항',//TODO:공지사항 'maxgeneral'=>GameConst::$defaultMaxGeneral, 'maxnation'=>GameConst::$defaultMaxNation, @@ -256,6 +257,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/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; 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);
삼국지 모의전투 HiDCHe ()삼국지 모의전투 HiDCHe 기 ()