mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
give back host privileges to game creator when he rejoins
This commit is contained in:
parent
0d53f3f3e1
commit
a34bccb530
1 changed files with 4 additions and 0 deletions
|
|
@ -246,6 +246,10 @@ Server_Player *Server_Game::addPlayer(Server_ProtocolHandler *handler, bool spec
|
|||
newPlayer->moveToThread(thread());
|
||||
sendGameEvent(new Event_Join(newPlayer->getProperties()));
|
||||
players.insert(playerId, newPlayer);
|
||||
if (newPlayer->getUserInfo()->getName() == creatorInfo->getName()) {
|
||||
hostId = playerId;
|
||||
sendGameEvent(new Event_GameHostChanged(playerId));
|
||||
}
|
||||
|
||||
if (broadcastUpdate)
|
||||
room->broadcastGameListUpdate(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue