diff --git a/f_install/templates/common.orig.css b/f_install/templates/common.orig.css index e41d298d..c2425d47 100644 --- a/f_install/templates/common.orig.css +++ b/f_install/templates/common.orig.css @@ -41,18 +41,44 @@ url('_tK_gameImagePath_/winter.gif') no-repeat right; } -.map_spring .map_body{ - background: url('_tK_gameImagePath_/map1.jpg') no-repeat; +/*체 지도*/ +.map_theme_che.map_spring .map_bglayer1{ + background: url('_tK_gameImagePath_/map/che/map_spring.jpg') no-repeat; } -.map_summer .map_body{ - background: url('_tK_gameImagePath_/map2.jpg') no-repeat; +.map_theme_che.map_summer .map_bglayer1{ + background: url('_tK_gameImagePath_/map/che/map_summer.jpg') no-repeat; } -.map_fall .map_body{ - background: url('_tK_gameImagePath_/map3.jpg') no-repeat; +.map_theme_che.map_fall .map_bglayer1{ + background: url('_tK_gameImagePath_/map/che/map_fall.jpg') no-repeat; } -.map_winter .map_body{ - background: url('_tK_gameImagePath_/map4.jpg') no-repeat; +.map_theme_che.map_winter .map_bglayer1{ + background: url('_tK_gameImagePath_/map/che/map_winter.jpg') no-repeat; +} + +.map_theme_che .map_bgroad{ + background: url('_tK_gameImagePath_/map/che/che_road.png') no-repeat; +} + +/*미니체 지도*/ +.map_theme_miniche.map_spring .map_bglayer1{ + background: url('_tK_gameImagePath_/map/che/map_spring.jpg') no-repeat; +} + +.map_theme_miniche.map_summer .map_bglayer1{ + background: url('_tK_gameImagePath_/map/che/map_summer.jpg') no-repeat; +} + +.map_theme_miniche.map_fall .map_bglayer1{ + background: url('_tK_gameImagePath_/map/che/map_fall.jpg') no-repeat; +} + +.map_theme_miniche.map_winter .map_bglayer1{ + background: url('_tK_gameImagePath_/map/che/map_winter.jpg') no-repeat; +} + +.map_theme_miniche .map_bgroad{ + background: url('_tK_gameImagePath_/map/che/miniche_road.png') no-repeat; } \ No newline at end of file diff --git a/hwe/a_history.php b/hwe/a_history.php index a276741a..c94e3b33 100644 --- a/hwe/a_history.php +++ b/hwe/a_history.php @@ -25,7 +25,7 @@ if($serverID === UniqueConst::$serverID){ increaseRefresh("연감", 1); } -$admin = $gameStor->getValues(['startyear','year','month']); +$admin = $gameStor->getValues(['startyear','year','month','map_theme']); $query = "select con,turntime from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), ""); @@ -45,6 +45,13 @@ $s = $s_year * 12 + $s_month; [$e_year, $e_month] = $db->queryFirstList('SELECT year, month FROM 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->queryFirstColumn('SELECT map_theme FROM ng_games WHERE server_id=%s', $serverID)??'che'; +} +else{ + $mapTheme = $admin['map_theme']??'che'; +} + //FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요. if($serverID !== UniqueConst::$serverID && !$yearmonth){ $year = $s_year; @@ -91,7 +98,7 @@ if ($month <= 0) { - + @@ -133,7 +140,7 @@ $history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM hist 중 원 지 도 - +
국명
국력
diff --git a/hwe/a_status.php b/hwe/a_status.php index b1887308..2d16613d 100644 --- a/hwe/a_status.php +++ b/hwe/a_status.php @@ -14,6 +14,8 @@ $connect=$db->get(); increaseRefresh("세력도", 2); checkTurn(); +$mapTheme = $gameStor->map_theme??'che'; + $query = "select con,turntime from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $me = MYDB_fetch_array($result); @@ -60,7 +62,7 @@ $(function(){ - + diff --git a/hwe/b_diplomacy.php b/hwe/b_diplomacy.php index d029d891..9bd70489 100644 --- a/hwe/b_diplomacy.php +++ b/hwe/b_diplomacy.php @@ -13,6 +13,8 @@ $connect=$db->get(); increaseRefresh("중원정보", 1); +$mapTheme = $gameStor->map_theme??'che'; + $query = "select no,nation from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $me = MYDB_fetch_array($result); @@ -214,7 +216,7 @@ for($i=0; $i < $nationcount; $i++) { - +
국명
국력
diff --git a/hwe/css/map.css b/hwe/css/map.css index fb40ae50..466bf988 100644 --- a/hwe/css/map.css +++ b/hwe/css/map.css @@ -27,6 +27,30 @@ position:relative; } +.map_body .map_bglayer1{ + width:100%; + height:100%; + position:absolute; + left:0; + top:0; +} + +.map_body .map_bglayer2{ + width:100%; + height:100%; + position:absolute; + left:0; + top:0; +} + +.map_body .map_bgroad{ + width:100%; + height:100%; + position:absolute; + left:0; + top:0; +} + .world_map .city_tooltip{ position: absolute; z-index:6; diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index 47de8864..1341c03e 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -1402,6 +1402,10 @@ function checkEmperior() { $serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games'); $serverName = UniqueConst::$serverName; + $db->update('ng_games', [ + 'winner_nation'=>$nation['nation'] + ], 'server_id=%s', UniqueConst::$serverID); + $db->insert('emperior', [ 'phase'=>$serverName.$serverCnt.'기', 'server_id'=>UniqueConst::$serverID, diff --git a/hwe/func_template.php b/hwe/func_template.php index 70eb11c7..aa19fda6 100644 --- a/hwe/func_template.php +++ b/hwe/func_template.php @@ -203,11 +203,18 @@ function formatName(string $name, int $npc): string{ return $name; } -function getMapHtml(){ - //NOTE: 필요한가? +function getMapHtml(?string $mapTheme=null){ $templates = new \League\Plates\Engine(__dir__.'/templates'); - return $templates->render('map'); + if($mapTheme === null){ + $db = DB::db(); + $gameStor = KVStorage::getStorage($db, 'game_env'); + $mapTheme = $gameStor->map_theme??'che'; + } + + return $templates->render('map', [ + 'mapTheme'=>$mapTheme + ]); } function getInvitationList(array $nationList){ diff --git a/hwe/index.php b/hwe/index.php index 12908f5f..ec9984fe 100644 --- a/hwe/index.php +++ b/hwe/index.php @@ -44,7 +44,7 @@ if ($me['newmsg'] == 1 || $me['newvote'] == 1) { ], 'owner=%i', $userID); } -$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title']); +$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title','map_theme']); $plock = $db->queryFirstField('SELECT plock FROM plock LIMIT 1'); @@ -76,7 +76,7 @@ if ($admin['npcmode'] == 0) { $valid = 1; } $color = "cyan"; - +$mapTheme = $admin['map_theme']; ?> @@ -230,7 +230,7 @@ else if($session->userGrade == 4){ diff --git a/hwe/js/map/theme_che.js b/hwe/js/map/theme_che.js new file mode 100644 index 00000000..c02cb1a3 --- /dev/null +++ b/hwe/js/map/theme_che.js @@ -0,0 +1,5 @@ + + +function getCityPosition(){ + return {"1":["업",345,130],"2":["허창",330,215],"3":["낙양",275,180],"4":["장안",145,165],"5":["성도",25,290],"6":["양양",255,290],"7":["건업",505,305],"8":["북평",465,65],"9":["남피",395,95],"10":["완",270,235],"11":["수춘",395,270],"12":["서주",440,250],"13":["강릉",245,335],"14":["장사",255,375],"15":["시상",360,360],"16":["위례",620,145],"17":["계",365,35],"18":["복양",410,170],"19":["진류",365,185],"20":["여남",330,260],"21":["하비",480,235],"22":["서량",25,50],"23":["하내",230,150],"24":["한중",135,205],"25":["상용",185,225],"26":["덕양",85,275],"27":["강주",70,310],"28":["건녕",80,400],"29":["남해",245,480],"30":["계양",230,400],"31":["오",510,345],"32":["평양",590,100],"33":["사비",605,205],"34":["계림",655,200],"35":["진양",295,60],"36":["평원",440,115],"37":["북해",470,155],"38":["초",365,230],"39":["패",430,220],"40":["천수",70,105],"41":["안정",95,145],"42":["홍농",210,175],"43":["하변",45,190],"44":["자동",75,245],"45":["영안",115,295],"46":["귀양",90,360],"47":["주시",30,345],"48":["운남",30,415],"49":["남영",135,405],"50":["교지",130,480],"51":["신야",250,260],"52":["강하",315,295],"53":["무릉",195,355],"54":["영릉",190,395],"55":["상동",210,435],"56":["여강",380,315],"57":["회계",480,395],"58":["고창",350,405],"59":["대",450,480],"60":["안평",530,80],"61":["졸본",570,65],"62":["이도",680,260],"63":["강",95,35],"64":["저",25,120],"65":["흉노",180,95],"66":["남만",80,455],"67":["산월",425,430],"68":["오환",610,20],"69":["왜",680,320],"70":["호관",285,140],"71":["호로",285,205],"72":["사곡",240,175],"73":["함곡",180,175],"74":["사수",310,185],"75":["양평",90,220],"76":["가맹",45,225],"77":["역경",410,65],"78":["계교",405,135],"79":["동황",515,145],"80":["관도",340,165],"81":["정도",400,210],"82":["합비",435,285],"83":["광릉",490,275],"84":["적도",130,75],"85":["가정",40,160],"86":["기산",110,180],"87":["면죽",35,255],"88":["이릉",215,295],"89":["장판",280,315],"90":["백랑",530,30],"91":["적벽",330,325],"92":["파양",430,350],"93":["탐라",605,260],"94":["유구",625,435]}; +} \ No newline at end of file diff --git a/hwe/sammo/ResetHelper.php b/hwe/sammo/ResetHelper.php index f888b0c6..10ef1014 100644 --- a/hwe/sammo/ResetHelper.php +++ b/hwe/sammo/ResetHelper.php @@ -188,6 +188,7 @@ class ResetHelper{ 'startyear'=>$startyear, 'year'=> $year, 'month'=> $month, + 'map_theme' => $scenarioObj->getMapTheme(), 'msg'=>'공지사항',//TODO:공지사항 'maxgeneral'=>GameConst::$defaultMaxGeneral, 'maxnation'=>GameConst::$defaultMaxNation, @@ -225,6 +226,7 @@ class ResetHelper{ 'server_id'=>$serverID, 'date'=>$turntime, 'winner_nation'=>null, + 'map_theme'=>$scenarioObj->getMapTheme(), 'scenario'=>$scenario, 'scenario_name'=>$scenarioObj->getTitle(), 'env'=>Json::encode($env) diff --git a/hwe/sammo/Scenario.php b/hwe/sammo/Scenario.php index 7add711a..bd2f7826 100644 --- a/hwe/sammo/Scenario.php +++ b/hwe/sammo/Scenario.php @@ -192,6 +192,10 @@ class Scenario{ $this->gameConf = array_merge($stat, $this->data['map']??[], $this->data['const']??[]); $this->iconPath = $this->data['iconPath']??$default['iconPath']; + + $this->gameConf['mapName'] = $this->gameConf['mapName']??'che'; + $this->gameConf['unitSet'] = $this->gameConf['unitSet']??'che'; + return $this->gameConf; } @@ -247,6 +251,14 @@ class Scenario{ $this->initFull(); return $this->nations; } + + public function getMapTheme(){ + return $this->gameConf['mapName']; + } + + public function getUnitSet(){ + return $this->gameConf['unitSet']; + } public function getScenarioBrief(){ $this->initFull(); @@ -361,10 +373,10 @@ class Scenario{ $mapPath = __dir__.'/../scenario/map'; $unitPath = __dir__.'/../scenario/unit'; - $mapName = $this->gameConf['mapName']??'che'; - $unitSet = $this->gameConf['unitSet']??'che'; - $this->gameConf['mapName'] = $mapName; - $this->gameConf['unitSet'] = $unitSet; + + $mapName = $this->gameConf['mapName']; + $unitSet = $this->gameConf['unitSet']; + if(!file_exists("$mapPath/$mapName.php")){ throw new \RuntimeException('맵 파일이 올바르게 지정되지 않음! : '.$mapName); diff --git a/hwe/sql/schema.sql b/hwe/sql/schema.sql index 83a044fd..3aea0a28 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -551,6 +551,7 @@ CREATE TABLE IF NOT EXISTS `ng_games` ( `server_id` CHAR(20) NOT NULL, `date` DATETIME NOT NULL, `winner_nation` INT(11) NULL DEFAULT NULL, + `map` VARCHAR(50) NULL DEFAULT NULL, `scenario` INT(11) NOT NULL, `scenario_name` TEXT NOT NULL, `env` TEXT NOT NULL COMMENT 'json', diff --git a/hwe/templates/map.php b/hwe/templates/map.php index 41eb1142..2494a40b 100644 --- a/hwe/templates/map.php +++ b/hwe/templates/map.php @@ -1,9 +1,12 @@ -
+
+
+
+
- +