From 3655dd6ce9a7ee9b63cf2bb22ebd9b6c5ee68de5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 14 Sep 2022 16:03:54 +0800 Subject: [PATCH] 1 --- webapp/controller/TeamController.class.php | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/webapp/controller/TeamController.class.php b/webapp/controller/TeamController.class.php index b5e28aeb..83bc5fa0 100644 --- a/webapp/controller/TeamController.class.php +++ b/webapp/controller/TeamController.class.php @@ -97,6 +97,71 @@ class TeamController extends BaseAuthedController { $this->_rspOk(); } + public function kickout() + { + $teamUuid = getReqVal('team_uuid', ''); + $r = $this->_getRedis($teamUuid); + $teamDb = $this->readTeamDb($r, $teamUuid); + if (empty($teamDb)) { + $this->_rspOk(); + return; + } + $this->saveTeamDb($r, $teamUuid, $teamDb); + $this->_rspOk(); + } + + public function closeSlot() + { + $teamUuid = getReqVal('team_uuid', ''); + $r = $this->_getRedis($teamUuid); + $teamDb = $this->readTeamDb($r, $teamUuid); + if (empty($teamDb)) { + $this->_rspOk(); + return; + } + $this->saveTeamDb($r, $teamUuid, $teamDb); + $this->_rspOk(); + } + + public function openSlot() + { + $teamUuid = getReqVal('team_uuid', ''); + $r = $this->_getRedis($teamUuid); + $teamDb = $this->readTeamDb($r, $teamUuid); + if (empty($teamDb)) { + $this->_rspOk(); + return; + } + $this->saveTeamDb($r, $teamUuid, $teamDb); + $this->_rspOk(); + } + + public function handover() + { + $teamUuid = getReqVal('team_uuid', ''); + $r = $this->_getRedis($teamUuid); + $teamDb = $this->readTeamDb($r, $teamUuid); + if (empty($teamDb)) { + $this->_rspOk(); + return; + } + $this->saveTeamDb($r, $teamUuid, $teamDb); + $this->_rspOk(); + } + + public function cancel() + { + $teamUuid = getReqVal('team_uuid', ''); + $r = $this->_getRedis($teamUuid); + $teamDb = $this->readTeamDb($r, $teamUuid); + if (empty($teamDb)) { + $this->_rspOk(); + return; + } + $this->saveTeamDb($r, $teamUuid, $teamDb); + $this->_rspOk(); + } + public function startGame() { $teamUuid = getReqVal('team_uuid', '');