mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-24 23:53:54 -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());
|
newPlayer->moveToThread(thread());
|
||||||
sendGameEvent(new Event_Join(newPlayer->getProperties()));
|
sendGameEvent(new Event_Join(newPlayer->getProperties()));
|
||||||
players.insert(playerId, newPlayer);
|
players.insert(playerId, newPlayer);
|
||||||
|
if (newPlayer->getUserInfo()->getName() == creatorInfo->getName()) {
|
||||||
|
hostId = playerId;
|
||||||
|
sendGameEvent(new Event_GameHostChanged(playerId));
|
||||||
|
}
|
||||||
|
|
||||||
if (broadcastUpdate)
|
if (broadcastUpdate)
|
||||||
room->broadcastGameListUpdate(this);
|
room->broadcastGameListUpdate(this);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue