Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb
This commit is contained in:
commit
db4d43ab0d
@ -24,6 +24,7 @@ require_once('mt/Item.php');
|
||||
require_once('mt/PveGeminiMode.php');
|
||||
require_once('mt/PveGemini.php');
|
||||
require_once('mt/Map.php');
|
||||
require_once('mt/MapMode.php');
|
||||
|
||||
require_once('services/AwardService.php');
|
||||
require_once('services/PropertyChgService.php');
|
||||
@ -465,11 +466,12 @@ class UserController extends BaseAuthedController {
|
||||
'is_moba' => 0,
|
||||
'is_open' => 0
|
||||
);
|
||||
if (!empty($mapId)) {
|
||||
if (!empty($mapId) && !empty($modeId)) {
|
||||
$mapMeta = mt\Map::get($mapId);
|
||||
if ($mapMeta) {
|
||||
$modeMeta = mt\MapMode::find($modeId);
|
||||
if ($mapMeta && $modeMeta) {
|
||||
$mapInfo = $mapMeta;
|
||||
$mapInfo['mode_id'] = intval($modeId);
|
||||
$mapInfo['mode_id'] = $modeMeta['id'];
|
||||
}
|
||||
}
|
||||
myself()->_rspData($mapInfo);
|
||||
@ -485,11 +487,12 @@ class UserController extends BaseAuthedController {
|
||||
'is_moba' => 0,
|
||||
'is_open' => 0
|
||||
);
|
||||
if (!empty($mapId)) {
|
||||
if (!empty($mapId) && !empty($modeId)) {
|
||||
$mapMeta = mt\Map::get($mapId);
|
||||
$modeMeta = mt\MapMode::find($modeId);
|
||||
if ($mapMeta) {
|
||||
$mapInfo = $mapMeta;
|
||||
$mapInfo['mode_id'] = intval($modeId);
|
||||
$mapInfo['mode_id'] = $modeMeta['id'];
|
||||
}
|
||||
}
|
||||
$userDb = SqlHelper::ormSelectOne
|
||||
@ -504,6 +507,10 @@ class UserController extends BaseAuthedController {
|
||||
return;
|
||||
}
|
||||
$userInfo = User::Info($userDb);
|
||||
{
|
||||
$userInfo['total_lucky'] = Hero::getAccountLucky($userInfo['address']);
|
||||
$userInfo['admission_item_num'] = myself()->_getItemCount(900006, $userInfo);
|
||||
}
|
||||
$heroDb = Hero::findByAccountId(myself()->_getAccountId(), $userInfo['hero_uniid']);
|
||||
if (!$heroDb) {
|
||||
$this->_rspErr(1, 'Hero does not exist');
|
||||
@ -524,6 +531,43 @@ class UserController extends BaseAuthedController {
|
||||
));
|
||||
}
|
||||
|
||||
public function getBattleUser()
|
||||
{
|
||||
$userDb = SqlHelper::ormSelectOne
|
||||
(myself()->_getSelfMysql(),
|
||||
't_user',
|
||||
array(
|
||||
'account_id' => myself()->_getAccountId()
|
||||
)
|
||||
);
|
||||
if (!$userDb) {
|
||||
$this->_rspErr(1, 'Account does not exist');
|
||||
return;
|
||||
}
|
||||
$userInfo = User::Info($userDb);
|
||||
{
|
||||
$userInfo['total_lucky'] = Hero::getAccountLucky($userInfo['address']);
|
||||
$userInfo['admission_item_num'] = myself()->_getItemCount(900006, $userInfo);
|
||||
}
|
||||
$heroDb = Hero::findByAccountId(myself()->_getAccountId(), $userInfo['hero_uniid']);
|
||||
if (!$heroDb) {
|
||||
$this->_rspErr(1, 'Hero does not exist');
|
||||
return;
|
||||
}
|
||||
$heroInfo = Hero::toDto($heroDb);
|
||||
$heroInfo['avatar_info'] = Hero::avatarInfo($heroDb);
|
||||
{
|
||||
$preset = HeroPreset::getHeroPreset($userDb['hero_id']);
|
||||
$heroInfo['spec_skill'] = '' . $preset['skill_id'];
|
||||
}
|
||||
myself()->_rspData(array(
|
||||
'info' => array(
|
||||
'user_info' => $userInfo,
|
||||
'hero_info' => $heroInfo,
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
public function updateBattleInfo()
|
||||
{
|
||||
$specSkill = getReqVal("skill_id", "");
|
||||
@ -540,11 +584,18 @@ class UserController extends BaseAuthedController {
|
||||
return;
|
||||
}
|
||||
$userInfo = User::Info($userDb);
|
||||
{
|
||||
$userInfo['total_lucky'] = Hero::getAccountLucky($userInfo['address']);
|
||||
$userInfo['admission_item_num'] = myself()->_getItemCount(900006, $userInfo);
|
||||
}
|
||||
$heroDb = Hero::findByAccountId(myself()->_getAccountId(), $heroUniId);
|
||||
if (!$heroDb) {
|
||||
$this->_rspErr(1, 'Hero does not exist');
|
||||
return;
|
||||
}
|
||||
$this->_updateUserInfo(array(
|
||||
'hero_id' => $heroUniId
|
||||
));
|
||||
$heroInfo = Hero::toDto($heroDb);
|
||||
$heroInfo['avatar_info'] = Hero::avatarInfo($heroDb);
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user