This commit is contained in:
aozhiwei 2023-12-26 18:06:58 +08:00
parent 37c6a942ae
commit 2420298d19

View File

@ -120,7 +120,7 @@ class MatchController extends BaseAuthedController {
if (empty($currMatchDb)) {
$currMatchDb = array(
$teamUuid => array(
'current_team' => $teamUuid,
'team_uuid' => $teamUuid,
'match_time' => $this->_getNowTime()
)
);
@ -128,10 +128,28 @@ class MatchController extends BaseAuthedController {
$this->refreshKeyExpire($r, MATCH_CURRENT_TEAM_KEY, 1000*600);
} else {
$currMatchDb = json_decode($currMatchDb, true);
if ($currMatchDb['current_team'] != $teamUuid) {
$this->matchOk($r, $teamUuid, $currMatchDb);
$this->fillMatchInfo($r, $teamUuid, $matchInfo, $this->readMatchOk($r, $teamUuid));
} else {
$delTeams = array();
foreach ($currMatchDb as $key => $val) {
$tmpTeamDb = $this->readTeamDb($r, $key);
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));
}
}
}
}
}