From a2100f503f23a85559c26ce2537ca17f58e8d27e Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 26 Mar 2018 00:27:51 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=88=20=EB=A6=AC=EC=85=8B=20=ED=88=B4=20?= =?UTF-8?q?=EC=A4=80=EB=B9=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/install.php | 234 +++++++++++++++++++++++++++++++++++-- twe/j_get_scenario_map.php | 1 - twe/j_load_scenarios.php | 27 +++++ twe/js/install.js | 17 ++- twe/sammo/Scenario.php | 44 +++++++ 5 files changed, 311 insertions(+), 12 deletions(-) create mode 100644 twe/j_load_scenarios.php create mode 100644 twe/sammo/Scenario.php diff --git a/twe/install.php b/twe/install.php index 5f9a82e4..fc1d4f34 100644 --- a/twe/install.php +++ b/twe/install.php @@ -1,4 +1,6 @@ - - - - - - + + + -
- -
+
+

삼국지 모의전투 HiD 리셋

+
+ +
+ + +
+

+ 설치(환경 설정) + +

+
+
+
+ +
+
+ + + + + + + + +
+
+
+ + +
+ +
+
+ + + +
+ + 시간 단위에 맞게 년/월이 설정됩니다.
예: 120분(오전1시=1월), 60분(오전/오후 1시=1월) +
+
+
+ +
+ +
+ + + + + + + + + + + + +
설정
일자180년 1월
NPC 수
국가 수
+ +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + + + +
+
+
+ +
+
+
+ +
+
+
+
+
+ + + +
+
+
\ No newline at end of file diff --git a/twe/j_get_scenario_map.php b/twe/j_get_scenario_map.php index e3f2b4fb..6d3e8296 100644 --- a/twe/j_get_scenario_map.php +++ b/twe/j_get_scenario_map.php @@ -14,7 +14,6 @@ if($session->userGrade < 5){ ]); } -$scenarioIdx = Util::toInt(Util::array_get($_GET['scenarioIdx'])); if($scenarioIdx === null){ Json::die([ diff --git a/twe/j_load_scenarios.php b/twe/j_load_scenarios.php new file mode 100644 index 00000000..836da0bd --- /dev/null +++ b/twe/j_load_scenarios.php @@ -0,0 +1,27 @@ +false, + 'reason'=>'관리자가 아닙니다.' + ]); +} + + +$scenarioIdx = Util::toInt(Util::array_get($_GET['scenarioIdx'])); + +if ($scenarioIdx !== null) { + //TODO: preview 지도 출력 + Json::die([ + 'result'=>false, + 'reason'=>'NYI' + ]); +} + +Json::die([ + 'result'=>false, + 'reason'=>'NYI' +]); \ No newline at end of file diff --git a/twe/js/install.js b/twe/js/install.js index fdf1bbd7..fa092207 100644 --- a/twe/js/install.js +++ b/twe/js/install.js @@ -1,8 +1,10 @@ +/* function showCityGeneral(cityIdx){ } - +*/ +/* function loadScenarioPreview(scenarioIdx){ $(function(){ reloadWorldMap({ @@ -15,7 +17,18 @@ function loadScenarioPreview(scenarioIdx){ }); }); } +*/ +function loadScenarios(){ + $.ajax({ + method:'post', + url:'j_load_scenarios.php', + dataType:'json' + }).then(function(result){ + + }); +} $(function(){ - loadScenarioPreview(8); + loadScenarios(); + //loadScenarioPreview(8); }) \ No newline at end of file diff --git a/twe/sammo/Scenario.php b/twe/sammo/Scenario.php new file mode 100644 index 00000000..bcd8684f --- /dev/null +++ b/twe/sammo/Scenario.php @@ -0,0 +1,44 @@ +scenarioIdx = $scenarioIdx; + $this->scenarioPath = $scenarioPath; + + $this->data = Json::decode(file_get_contents($scenarioPath)); + } + + public function getScenarioIdx(){ + return $this->scenarioIdx; + } + + /** + * @return \sammo\Scenario[] + */ + public static function getAllScenarios(){ + $result = []; + + foreach(glob(SCENARIO_PATH.'/scenario_*.json') as $scenarioPath){ + $scenarioName = pathinfo(basename($scenarioName), PATHINFO_FILENAME); + $scenarioIdx = Util::array_last(explode('_', $scenarioName)); + $scenarioIdx = Util::toInt($scenarioIdx); + + if($scenarioIdx === null){ + continue; + } + + $result[$scenarioIdx] = new Scenario($scenarioIdx); + } + return $result; + } +} \ No newline at end of file