1
This commit is contained in:
parent
37c6a942ae
commit
2420298d19
@ -120,7 +120,7 @@ class MatchController extends BaseAuthedController {
|
|||||||
if (empty($currMatchDb)) {
|
if (empty($currMatchDb)) {
|
||||||
$currMatchDb = array(
|
$currMatchDb = array(
|
||||||
$teamUuid => array(
|
$teamUuid => array(
|
||||||
'current_team' => $teamUuid,
|
'team_uuid' => $teamUuid,
|
||||||
'match_time' => $this->_getNowTime()
|
'match_time' => $this->_getNowTime()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -128,10 +128,28 @@ class MatchController extends BaseAuthedController {
|
|||||||
$this->refreshKeyExpire($r, MATCH_CURRENT_TEAM_KEY, 1000*600);
|
$this->refreshKeyExpire($r, MATCH_CURRENT_TEAM_KEY, 1000*600);
|
||||||
} else {
|
} else {
|
||||||
$currMatchDb = json_decode($currMatchDb, true);
|
$currMatchDb = json_decode($currMatchDb, true);
|
||||||
if ($currMatchDb['current_team'] != $teamUuid) {
|
$delTeams = array();
|
||||||
$this->matchOk($r, $teamUuid, $currMatchDb);
|
foreach ($currMatchDb as $key => $val) {
|
||||||
$this->fillMatchInfo($r, $teamUuid, $matchInfo, $this->readMatchOk($r, $teamUuid));
|
$tmpTeamDb = $this->readTeamDb($r, $key);
|
||||||
} else {
|
if (!empty($tmpTeamDb) || $this->_getNowTime() - $tmpTeamDb['match_time'] > 120) {
|
||||||
|
array_push($delTeams, $key);
|
||||||
|
} else {
|
||||||
|
$found = false;
|
||||||
|
if ($key == $teamUuid) {
|
||||||
|
$found = true;
|
||||||
|
} else {
|
||||||
|
foreach ($val['member_list'] as $member) {
|
||||||
|
if ($member['account_id'] == myself()->_getAccountId()) {
|
||||||
|
$found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$found) {
|
||||||
|
$this->matchOk($r, $teamUuid, $val);
|
||||||
|
$this->fillMatchInfo($r, $teamUuid, $matchInfo, $this->readMatchOk($r, $teamUuid));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user