delete non-persistent lobbies when empty

This commit is contained in:
Martin Michelsen
2020-02-20 10:52:56 -08:00
parent 5e091852c4
commit 1b5a4fe4ee
+3
View File
@@ -76,6 +76,9 @@ void ServerState::change_client_lobby(shared_ptr<Client> c, shared_ptr<Lobby> ne
if (current_lobby) {
send_player_leave_notification(current_lobby, old_lobby_client_id);
if (!(current_lobby->flags & LobbyFlag::Persistent) && (current_lobby->count_clients() == 0)) {
this->remove_lobby(current_lobby->lobby_id);
}
}
this->send_lobby_join_notifications(new_lobby, c);
}