This commit is contained in:
aozhiwei 2023-12-26 19:26:40 +08:00
parent 4e45d080dc
commit fceb480a43

View File

@ -127,7 +127,6 @@ class MatchController extends BaseAuthedController {
$r->set(MATCH_CURRENT_TEAM_KEY, json_encode($currMatchDb)); $r->set(MATCH_CURRENT_TEAM_KEY, json_encode($currMatchDb));
$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);
$delTeams = array(); $delTeams = array();
$selfTeamDb = $currMatchDb[$teamUuid]; $selfTeamDb = $currMatchDb[$teamUuid];
if ($selfTeamDb && myself()->_getNowTime() - $selfTeamDb['match_time'] > 7) { if ($selfTeamDb && myself()->_getNowTime() - $selfTeamDb['match_time'] > 7) {
@ -173,10 +172,10 @@ class MatchController extends BaseAuthedController {
{ {
{ {
$matchOkDb = array( $matchOkDb = array(
'target_team' => $currMatchDb['current_team'], 'target_team' => $currMatchDb['team_uuid'],
'match_time' => $this->_getNowTime() 'match_time' => $this->_getNowTime()
); );
$r->set(MATCH_OK_KEY . $teamUuid, json_encode($currMatchDb)); $r->set(MATCH_OK_KEY . $teamUuid, json_encode($matchOkDb));
$this->refreshKeyExpire($r, MATCH_OK_KEY . $teamUuid, 1000*600); $this->refreshKeyExpire($r, MATCH_OK_KEY . $teamUuid, 1000*600);
} }
{ {
@ -184,8 +183,8 @@ class MatchController extends BaseAuthedController {
'target_team' => $teamUuid, 'target_team' => $teamUuid,
'match_time' => $this->_getNowTime() 'match_time' => $this->_getNowTime()
); );
$r->set(MATCH_OK_KEY . $currMatchDb['current_team'], json_encode($currMatchDb)); $r->set(MATCH_OK_KEY . $currMatchDb['team_uuid'], json_encode($matchOkDb));
$this->refreshKeyExpire($r, MATCH_OK_KEY . $currMatchDb['current_team'], 1000*600); $this->refreshKeyExpire($r, MATCH_OK_KEY . $currMatchDb['team_uuid'], 1000*600);
} }
} }
@ -194,6 +193,7 @@ class MatchController extends BaseAuthedController {
if (empty($matchOkDb)) { if (empty($matchOkDb)) {
return; return;
} }
error_log(json_encode($matchOkDb));
$matchInfo['state'] = 1; $matchInfo['state'] = 1;
{ {
$teamDb = $this->readTeamDb($r, $teamUuid); $teamDb = $this->readTeamDb($r, $teamUuid);