This commit is contained in:
aozhiwei 2023-12-27 10:46:33 +08:00
parent fceb480a43
commit a6be7a54ff
2 changed files with 10 additions and 2 deletions

View File

@ -7,7 +7,7 @@ define('PLANET_BUY_KEY', 'game2006api:planet_buy:');
define('LAST_SESSION_KEY', 'last_session:'); define('LAST_SESSION_KEY', 'last_session:');
define('MATCH_CURRENT_TEAM_KEY', 'match:current_team:'); define('MATCH_CURRENT_TEAM_KEY', 'match:current_team:');
define('MATCH_OK_KEY', 'match:current_team:'); define('MATCH_OK_KEY', 'match:ok:');
define('V_ITEM_GOLD', 10001); //金币 define('V_ITEM_GOLD', 10001); //金币
define('V_ITEM_DIAMOND', 10014); //钻石 define('V_ITEM_DIAMOND', 10014); //钻石

View File

@ -59,6 +59,14 @@ class MatchController extends BaseAuthedController {
if ($matchOkDb) { if ($matchOkDb) {
$r->del(MATCH_OK_KEY . $matchOkDb['target_team']); $r->del(MATCH_OK_KEY . $matchOkDb['target_team']);
} }
{
$currMatchDb = $this->readCurrMatchTeam($r);
if (!empty($currMatchDb)) {
unset($currMatchDb[$teamUuid]);
$r->set(MATCH_CURRENT_TEAM_KEY, json_encode($currMatchDb));
$this->refreshKeyExpire($r, MATCH_CURRENT_TEAM_KEY, 1000*600);
}
}
} }
$this->_rspOk(); $this->_rspOk();
} }
@ -160,7 +168,7 @@ class MatchController extends BaseAuthedController {
} }
if (count($delTeams) > 0) { if (count($delTeams) > 0) {
foreach ($delTeams as $id) { foreach ($delTeams as $id) {
unset($delTeams[$id]); unset($currMatchDb[$id]);
} }
$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);