1
This commit is contained in:
parent
30e3e0240a
commit
6e4673fa12
@ -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
|
||||
)
|
||||
));
|
||||
}
|
||||
|
24
webapp/mt/Map.php
Normal file
24
webapp/mt/Map.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace mt;
|
||||
|
||||
use phpcommon;
|
||||
|
||||
class Map {
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return array_key_exists($id, self::getMetaList()) ? self::getMetaList()[$id] : null;
|
||||
}
|
||||
|
||||
protected static function getMetaList()
|
||||
{
|
||||
if (!self::$metaList) {
|
||||
self::$metaList = getMetaTable('map@map.php');
|
||||
}
|
||||
return self::$metaList;
|
||||
}
|
||||
|
||||
protected static $metaList;
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user