1
This commit is contained in:
parent
81792ef087
commit
f436306efe
@ -19,6 +19,7 @@ require_once('services/FormulaService.php');
|
||||
require_once('mt/RankSeason.php');
|
||||
require_once('mt/ServerTask.php');
|
||||
require_once('mt/ServerTaskTime.php');
|
||||
require_once('mt/Robot.php');
|
||||
|
||||
use phpcommon\SqlHelper;
|
||||
use models\Hero;
|
||||
@ -482,7 +483,7 @@ class BattleController extends BaseAuthedController {
|
||||
if ($ignoreAndroid) {
|
||||
$isAllAndroid = true;
|
||||
foreach ($team['members'] as $member) {
|
||||
if ($member['is_android']) {
|
||||
if (!$member['is_android']) {
|
||||
$isAllAndroid = false;
|
||||
break;
|
||||
}
|
||||
@ -499,6 +500,10 @@ class BattleController extends BaseAuthedController {
|
||||
if ($ignoreAndroid && $member['is_android']) {
|
||||
continue;
|
||||
}
|
||||
if ($member['is_android']) {
|
||||
$info = $this->getAndroidInfo($member);
|
||||
array_push($teamInfo['members'], $info);
|
||||
} else {
|
||||
$accountId = $member['account_id'];
|
||||
$switchOk = $this->switchOnlineAccount($accountId);
|
||||
if (!$switchOk) {
|
||||
@ -554,6 +559,7 @@ class BattleController extends BaseAuthedController {
|
||||
}
|
||||
array_push($teamInfo['members'], $info);
|
||||
}
|
||||
}
|
||||
array_push($data['team_list'], $teamInfo);
|
||||
}
|
||||
error_log(json_encode($data));
|
||||
@ -847,4 +853,24 @@ class BattleController extends BaseAuthedController {
|
||||
));
|
||||
}
|
||||
|
||||
private function getAndroidInfo($member)
|
||||
{
|
||||
$robotMeta = mt\Robot::get($member['robot_id']);
|
||||
$info = array(
|
||||
'account_id' => $member['account_id'],
|
||||
'name' => $member['name'],
|
||||
'is_valid_battle' => 1,
|
||||
'errcode' => 0,
|
||||
'errmsg' => '',
|
||||
'level' => 1,
|
||||
'is_android' => 1,
|
||||
'robot_id' => $member['robot_id'],
|
||||
'hero_dto' => array(
|
||||
'hero_uniid' => '',
|
||||
'hero_id' => $robotMeta['hero_id']
|
||||
)
|
||||
);
|
||||
return $info;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class Robot {
|
||||
protected static function getMetaList()
|
||||
{
|
||||
if (!self::$metaList) {
|
||||
self::$metaList = getMetaTable('robot@robot1.php');
|
||||
self::$metaList = getMetaTable('robot@robot.php');
|
||||
}
|
||||
return self::$metaList;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user