This commit is contained in:
aozhiwei 2023-12-26 19:17:08 +08:00
parent 93fc71290e
commit 4e45d080dc

View File

@ -129,29 +129,36 @@ class MatchController extends BaseAuthedController {
} else {
$currMatchDb = json_decode($currMatchDb, true);
$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;
$selfTeamDb = $currMatchDb[$teamUuid];
if ($selfTeamDb && myself()->_getNowTime() - $selfTeamDb['match_time'] > 7) {
$this->matchOk($r, $teamUuid, $selfTeamDb);
$this->fillMatchInfo($r, $teamUuid, $matchInfo, $this->readMatchOk($r, $teamUuid));
array_push($delTeams, $teamUuid);
} else {
foreach ($currMatchDb as $key => $val) {
$tmpTeamDb = $this->readTeamDb($r, $key);
if (!empty($tmpTeamDb) || $this->_getNowTime() - $tmpTeamDb['match_time'] > 120) {
array_push($delTeams, $key);
} else {
foreach ($val['member_list'] as $member) {
if ($member['account_id'] == myself()->_getAccountId()) {
$found = true;
break;
$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));
array_push($delTeams, $key);
}
}
if (!$found) {
$this->matchOk($r, $teamUuid, $val);
$this->fillMatchInfo($r, $teamUuid, $matchInfo, $this->readMatchOk($r, $teamUuid));
array_push($delTeams, $key);
}
}
}//end foreach $currMatchDb
}//end foreach $currMatchDb
}
if (count($delTeams) > 0) {
foreach ($delTeams as $id) {
unset($delTeams[$id]);