diff --git a/webapp/controller/MatchController.class.php b/webapp/controller/MatchController.class.php index 80670b03..28644d17 100644 --- a/webapp/controller/MatchController.class.php +++ b/webapp/controller/MatchController.class.php @@ -36,6 +36,7 @@ class MatchController extends BaseAuthedController { if ($matchOkDb) { $this->refreshKeyExpire($r, MATCH_OK_KEY . $teamUuid, 1000*600); $this->refreshKeyExpire($r, MATCH_OK_KEY . $matchOkDb['target_team'], 1000*600); + $this->refreshKeyExpire($r, TEAMID_KEY . $matchOkDb['target_team'], 1000*600); } else { $currMatchDb = $this->readCurrMatchTeam($r); if (empty($currMatchDb)) { @@ -72,7 +73,7 @@ class MatchController extends BaseAuthedController { if (empty($teamDbStr)) { return null; } - $r->refreshKeyExpire($r, TEAMID_KEY . $teamUuid, 1000*600); + $this->refreshKeyExpire($r, TEAMID_KEY . $teamUuid, 1000*600); $teamDb = json_decode($teamDbStr, true); return $teamDb; } @@ -117,7 +118,25 @@ class MatchController extends BaseAuthedController { private function matchOk($r, $teamUuid, $currMatchDb) { - + { + $r->del(MATCH_CURRENT_TEAM_KEY); + } + { + $matchOkDb = array( + 'target_team' => $currMatchDb['current_team'], + 'match_time' => $this->_getNowTime() + ); + $r->set(MATCH_OK_KEY . $teamUuid, json_encode($currMatchDb)); + $this->refreshKeyExpire($r, MATCH_OK_KEY . $teamUuid, 1000*600); + } + { + $matchOkDb = array( + 'target_team' => $teamUuid, + 'match_time' => $this->_getNowTime() + ); + $r->set(MATCH_OK_KEY . $currMatchDb['current_team'], json_encode($currMatchDb)); + $this->refreshKeyExpire($r, MATCH_OK_KEY . $currMatchDb['current_team'], 1000*600); + } } }