This commit is contained in:
aozhiwei 2022-09-14 16:03:54 +08:00
parent 109392cb23
commit 3655dd6ce9

View File

@ -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', '');