Move spectators to lobby before closing a game.
This commit is contained in:
@@ -198,6 +198,21 @@ ServerGame::RemoveAllSessions()
|
||||
SetState(ServerGameStateFinal::Instance());
|
||||
}
|
||||
|
||||
void
|
||||
ServerGame::MoveSpectatorsToLobby()
|
||||
{
|
||||
PlayerIdList spectatorList = GetSpectatorIdList();
|
||||
PlayerIdList::const_iterator i = spectatorList.begin();
|
||||
PlayerIdList::const_iterator end = spectatorList.end();
|
||||
while (i != end) {
|
||||
boost::shared_ptr<SessionData> tmpSession = GetSessionManager().GetSessionByUniquePlayerId(*i);
|
||||
// Only remove if the spectator was found.
|
||||
if (tmpSession)
|
||||
MoveSessionToLobby(tmpSession, NTF_NET_REMOVED_GAME_CLOSED);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ServerGame::TimerVoteKick(const boost::system::error_code &ec)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user