diff --git a/doc/Other.py b/doc/Other.py index ffecab63..44978eab 100644 --- a/doc/Other.py +++ b/doc/Other.py @@ -61,4 +61,19 @@ class Other(object): ['cec',0,'cec'], ] }, - ] \ No newline at end of file + { + 'name': 'getMapModeList', + 'desc': '获取当前开启的地图模式列表', + 'group': 'Other', + 'url': 'webapp/index.php?c=Other&a=getMapModeList', + 'params': [ + _common.ReqHead(), + ], + 'response': [ + _common.RspHead(), + ['!mode_list', [ + ['id',0,'mapMode配置id'], + ], '地图模式列表'], + ] + }, + ] diff --git a/webapp/controller/OtherController.class.php b/webapp/controller/OtherController.class.php index 54b195a1..175eaa49 100644 --- a/webapp/controller/OtherController.class.php +++ b/webapp/controller/OtherController.class.php @@ -4,6 +4,7 @@ require_once('services/MissionService.php'); require_once('mt/RankSeason.php'); require_once('mt/HashRateCommon.php'); require_once('mt/ActivityRewards.php'); +require_once('mt/mapMode.php'); require_once('models/Mission.php'); require_once('models/Fragment.php'); @@ -176,5 +177,22 @@ class OtherController extends BaseAuthedController { } + + public function getMapModeList() + { + $modeList = array(); + foreach (mt\MapMode::getMetaList() as $modeMeta) { + array_push( + $modeList, + array( + 'id' => $modeMeta['id'] + ) + ); + } + $this->_rspData(array( + 'mode_list' => $modeList + )); + } + }