From 923777899ef0c4029db9ab792e1bcacfdb679c07 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 16 Jun 2019 03:47:58 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8F=84=EC=8B=9C=20=EB=AA=A9=EB=A1=9D=20?= =?UTF-8?q?=EC=9E=84=EC=8B=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/j_get_city_list.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 hwe/j_get_city_list.php diff --git a/hwe/j_get_city_list.php b/hwe/j_get_city_list.php new file mode 100644 index 00000000..fe3d9777 --- /dev/null +++ b/hwe/j_get_city_list.php @@ -0,0 +1,40 @@ +isGameLoggedIn()){ + //increaseRefresh("도시일람", 1); +} +else{ + $availableNextCall = $session->availableNextCallGetCityList??'2000-01-01 00:00:00'; + $now = new \DateTimeImmutable(); + + if($now <= new \DateTimeImmutable($availableNextCall) && $session->userGrade < 5){ + Json::die([ + 'result'=>false, + 'reason'=>"도시 목록은 10초에 한번 갱신 가능합니다.\n다음 시간 : ".$availableNextCall + ]); + } + + $availableNextCall = $now->add(new \DateInterval('PT10S'))->format('Y-m-d H:i:s'); + $session->availableNextCallGetCityList = $availableNextCall; +} + +$nation = getAllNationStaticInfo(); +$cityArgsList = ['city', 'nation', 'name', 'level']; +$cities = $db->queryAllLists('SELECT %l FROM city', join(',', $cityArgsList)); + +Json::die([ + 'nations'=>$nation, + 'cityArgsList'=>$cityArgsList, + 'cities'=>$cities +]); \ No newline at end of file