1
This commit is contained in:
parent
12b0abc9c0
commit
f40ebe1918
@ -43,21 +43,7 @@ class MatchController extends BaseAuthedController {
|
|||||||
$this->refreshKeyExpire($r, TEAMID_KEY . $matchOkDb['target_team'], 1000*600);
|
$this->refreshKeyExpire($r, TEAMID_KEY . $matchOkDb['target_team'], 1000*600);
|
||||||
$this->fillMatchInfo($r, $teamUuid, $matchInfo, $matchOkDb);
|
$this->fillMatchInfo($r, $teamUuid, $matchInfo, $matchOkDb);
|
||||||
} else {
|
} else {
|
||||||
$currMatchDb = $this->readCurrMatchTeam($r);
|
$this->execMatch($r, $teamUuid, $teamDb, $matchInfo);
|
||||||
if (empty($currMatchDb)) {
|
|
||||||
$currMatchDb = array(
|
|
||||||
'current_team' => $teamUuid,
|
|
||||||
'match_time' => $this->_getNowTime()
|
|
||||||
);
|
|
||||||
$r->set(MATCH_CURRENT_TEAM_KEY, json_encode($currMatchDb));
|
|
||||||
$this->refreshKeyExpire($r, MATCH_CURRENT_TEAM_KEY, 1000*600);
|
|
||||||
} else {
|
|
||||||
if ($currMatchDb['current_team'] != $teamUuid) {
|
|
||||||
$this->matchOk($r, $teamUuid, $currMatchDb);
|
|
||||||
$this->fillMatchInfo($r, $teamUuid, $matchInfo, $this->readMatchOk($r, $teamUuid));
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$this->_rspData($matchInfo);
|
$this->_rspData($matchInfo);
|
||||||
}
|
}
|
||||||
@ -90,8 +76,10 @@ class MatchController extends BaseAuthedController {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
"current_team": "dafsdf"
|
"": {
|
||||||
"match_time": 231434
|
"current_team": "dafsdf"
|
||||||
|
"match_time": 231434
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
private function readCurrMatchTeam($r)
|
private function readCurrMatchTeam($r)
|
||||||
@ -126,6 +114,25 @@ class MatchController extends BaseAuthedController {
|
|||||||
$r->pexpire($key, $time);
|
$r->pexpire($key, $time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function execMatch($r, $teamUuid, $teamDb, &$matchInfo)
|
||||||
|
{
|
||||||
|
$currMatchDb = $this->readCurrMatchTeam($r);
|
||||||
|
if (empty($currMatchDb)) {
|
||||||
|
$currMatchDb = array(
|
||||||
|
'current_team' => $teamUuid,
|
||||||
|
'match_time' => $this->_getNowTime()
|
||||||
|
);
|
||||||
|
$r->set(MATCH_CURRENT_TEAM_KEY, json_encode($currMatchDb));
|
||||||
|
$this->refreshKeyExpire($r, MATCH_CURRENT_TEAM_KEY, 1000*600);
|
||||||
|
} else {
|
||||||
|
if ($currMatchDb['current_team'] != $teamUuid) {
|
||||||
|
$this->matchOk($r, $teamUuid, $currMatchDb);
|
||||||
|
$this->fillMatchInfo($r, $teamUuid, $matchInfo, $this->readMatchOk($r, $teamUuid));
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private function matchOk($r, $teamUuid, $currMatchDb)
|
private function matchOk($r, $teamUuid, $currMatchDb)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user