mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
kick users out of games
This commit is contained in:
parent
d6083a85c7
commit
731dfcad5c
13 changed files with 263 additions and 86 deletions
|
|
@ -247,6 +247,18 @@ void Server_Game::removePlayer(Server_Player *player)
|
|||
qobject_cast<Server_Room *>(parent())->broadcastGameListUpdate(this);
|
||||
}
|
||||
|
||||
bool Server_Game::kickPlayer(int playerId)
|
||||
{
|
||||
Server_Player *playerToKick = players.value(playerId);
|
||||
if (!playerToKick)
|
||||
return false;
|
||||
|
||||
removePlayer(playerToKick);
|
||||
sendGameEventToPlayer(playerToKick, new Event_Kicked);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Server_Game::setActivePlayer(int _activePlayer)
|
||||
{
|
||||
activePlayer = _activePlayer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue