From a6be7a54ff352e096d2f2f075d49bc9995faecd4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 27 Dec 2023 10:46:33 +0800 Subject: [PATCH] 1 --- webapp/bootstrap/constant.php | 2 +- webapp/controller/MatchController.class.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/webapp/bootstrap/constant.php b/webapp/bootstrap/constant.php index 2d998aa6..b004c37f 100644 --- a/webapp/bootstrap/constant.php +++ b/webapp/bootstrap/constant.php @@ -7,7 +7,7 @@ define('PLANET_BUY_KEY', 'game2006api:planet_buy:'); define('LAST_SESSION_KEY', 'last_session:'); 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_DIAMOND', 10014); //钻石 diff --git a/webapp/controller/MatchController.class.php b/webapp/controller/MatchController.class.php index 3f7427c4..167a90e1 100644 --- a/webapp/controller/MatchController.class.php +++ b/webapp/controller/MatchController.class.php @@ -59,6 +59,14 @@ class MatchController extends BaseAuthedController { if ($matchOkDb) { $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(); } @@ -160,7 +168,7 @@ class MatchController extends BaseAuthedController { } if (count($delTeams) > 0) { foreach ($delTeams as $id) { - unset($delTeams[$id]); + unset($currMatchDb[$id]); } $r->set(MATCH_CURRENT_TEAM_KEY, json_encode($currMatchDb)); $this->refreshKeyExpire($r, MATCH_CURRENT_TEAM_KEY, 1000*600);