diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 88ae4382..7c2d9928 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -23,6 +23,7 @@ require_once('mt/Rank.php'); require_once('mt/Item.php'); require_once('mt/PveGeminiMode.php'); require_once('mt/PveGemini.php'); +require_once('mt/Map.php'); require_once('services/AwardService.php'); require_once('services/PropertyChgService.php'); @@ -454,8 +455,37 @@ class UserController extends BaseAuthedController { )); } + public function getMapConf() + { + $mapId = getReqVal('map_id', 0); + $mapInfo = array( + 'map_id' => 0, + 'is_moba' => 0, + 'is_open' => 0 + ); + if (empty($mapId)) { + $mapMeta = mt\Map::get($mapId); + if ($mapMeta) { + $mapInfo = $mapMeta; + } + } + myself()->_rspData($mapInfo); + } + public function getBattleInfo() { + $mapId = getReqVal('map_id', 0); + $mapInfo = array( + 'map_id' => 0, + 'is_moba' => 0, + 'is_open' => 0 + ); + if (empty($mapId)) { + $mapMeta = mt\Map::get($mapId); + if ($mapMeta) { + $mapInfo = $mapMeta; + } + } $userDb = SqlHelper::ormSelectOne (myself()->_getSelfMysql(), 't_user', @@ -482,7 +512,8 @@ class UserController extends BaseAuthedController { myself()->_rspData(array( 'info' => array( 'user_info' => $userInfo, - 'hero_info' => $heroInfo + 'hero_info' => $heroInfo, + 'map_info' => $mapMeta ) )); } diff --git a/webapp/mt/Map.php b/webapp/mt/Map.php new file mode 100644 index 00000000..8636327a --- /dev/null +++ b/webapp/mt/Map.php @@ -0,0 +1,24 @@ +