diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index e4652913..222a4c3f 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -252,9 +252,36 @@ class BattleController extends BaseAuthedController { } } $this->switchAccount(getReqVal('account_id', 0)); + $this->updateRecentBattle($input['team_list']); $this->_rspOk(); } + private function updateRecentBattle($teamList) + { + $realPlayerHash = array(); + $realPlayerHashCopy = array(); + foreach ($teamList as $team) { + foreach ($team as $member) { + if (!myself()->_isAndroidAccountId($member['account_id'])) { + $realPlayerHash[$member['account_id']] = 1; + $realPlayerHashCopy[$member['account_id']] = 1; + } + } + } + foreach ($realPlayerHash as $accountId) { + foreach ($realPlayerHashCopy as $accountIdCopy) { + if ($accountId != $accountIdCopy) { + $accountId1 = $accountId; + $accountId2 = $accountIdCopy; + if ($accountId > $accountIdCopy) { + $accountId1 = $accountIdCopy; + $accountId2 = $accountId; + } + } + } + } + } + /* http post php://input