From 75fb28126406ae587410aa9ca14f52a4a1ea0d6c Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 2 Feb 2018 00:30:04 +0900 Subject: [PATCH 1/2] =?UTF-8?q?func=5Fmap.php=EB=A5=BC=20=ED=86=B5?= =?UTF-8?q?=ED=95=B4=20=ED=98=84=EC=9E=AC=20=EC=A7=80=EB=8F=84=20=EA=B0=92?= =?UTF-8?q?=EC=9D=84=20=EB=B0=9B=EC=95=84=EC=98=A4=EB=8A=94=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit j_map.php를 통해 지도를 json 형태로 열람하는 코드 추가 연감의 저장코드를 http를 통해 지도를 받아오는 방식에서 func_map.php를 이용하는 방식으로 변경 map.js에서 반환값이 올바른지 확인하는 코드 추가 b_CurrentCity.php의 도시 정보 값을 get으로도 받을 수 있도록 변경 map.js에서 재야 상태일때 올바르게 처리하도록 변경 --- twe/b_currentCity.php | 16 +++--- twe/func.php | 1 + twe/func_gamerule.php | 4 +- twe/func_history.php | 71 +++++++++++------------ twe/func_map.php | 130 ++++++++++++++++++++++++++++++++++++++++++ twe/install3_ok.php | 2 +- twe/j_map.php | 37 +++++++++++- twe/j_msgsubmit.php | 4 +- twe/js/map.js | 68 +++++++++++++++++----- twe/lib.php | 1 + twe/main.php | 17 +++++- 11 files changed, 279 insertions(+), 72 deletions(-) create mode 100644 twe/func_map.php diff --git a/twe/b_currentCity.php b/twe/b_currentCity.php index df627c7f..88c99b33 100644 --- a/twe/b_currentCity.php +++ b/twe/b_currentCity.php @@ -36,10 +36,10 @@ if($me['skin'] < 1) {
-
도시선택 : + 도시선택 :
- + From 9ef4e2debb1f92e8b9ee5954961d22589d4963f3 Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 2 Feb 2018 01:21:16 +0900 Subject: [PATCH 2/2] =?UTF-8?q?json=20=EB=B0=98=ED=99=98=EC=8B=9C=20?= =?UTF-8?q?=EC=BA=90=EC=8B=B1=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=84=A4=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 연감용 json 반환에는 캐싱할 수 있도록 설정 --- twe/j_map.php | 9 ++++++++- twe/lib.php | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/twe/j_map.php b/twe/j_map.php index ddef45d3..7f9c8496 100644 --- a/twe/j_map.php +++ b/twe/j_map.php @@ -33,4 +33,11 @@ else{ $post['month'] = null; } -returnJson(getWorldMap($post)); \ No newline at end of file +$result = getWorldMap($post); +if($post['year'] && $post['month'] && $result['result']){ + //연감 자료는 캐싱 가능 + returnJson($result, false); +} +else{ + returnJson($result); +} diff --git a/twe/lib.php b/twe/lib.php index b86c92a1..2bcbd928 100644 --- a/twe/lib.php +++ b/twe/lib.php @@ -137,8 +137,16 @@ function Error($message, $url="") { exit; } -function returnJson($value, $pretty = false, $die = true){ +function returnJson($value, $noCache = true, $pretty = false, $die = true){ header('Content-Type: application/json'); + + if($noCache){ + header('Expires: Sun, 01 Jan 2014 00:00:00 GMT'); + header('Cache-Control: no-store, no-cache, must-revalidate'); + header('Cache-Control: post-check=0, pre-check=0', FALSE); + header('Pragma: no-cache'); + } + if($pretty){ $flag = JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT; }
+ +