public void RemoveClient(Client c)
{
// Remove this client's votes if they have any.
if (ActiveRound != null)
{
ActiveRound.Votes.RemoveAll(v => v.ClientID == c.Info.ID && v.ClientName == c.Info.Name);
}
if (Admins.Contains(c))
{
Admins.Remove(c);
}
// Some race case is going on here... we need to check if there's even anything to remove.
if (Clients.Count > 0)
{
Clients.Remove(c);
}
c = null;
if (Clients.All(cl => cl.Info.IsSpectator) && ActiveRound != null)
{
DiscardActiveRound();
BroadcastError(c, "RoundStopped", "There are no more non-spectator players, so the current round has been automatically discarded.");
}
// Check that every person hasn't already voted.
CheckVoteCount();
}