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