public void CloseAll() { foreach (GameClient client in GetClients.ToList()) { if (client == null) { continue; } if (client.GetHabbo() != null) { try { using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor()) { dbClient.runFastQuery(client.GetHabbo().GetQueryString); } Console.Clear(); log.Info("<<- DESLIGANDO SERVIDOR ->> GUARDANDO INVENTARIOS"); } catch { } } } log.Info("Pronto, economizou o inventário dos usuários!"); log.Info("Fechando as conexões do servidor ..."); try { foreach (GameClient client in GetClients.ToList()) { if (client == null || client.GetConnection() == null) { continue; } try { BiosEmuThiago.GetConnectionManager().Destroy(); client.GetConnection().Dispose(); } catch (Exception e) { ExceptionLogger.LogException(e); } Console.Clear(); log.Info("<<- APAGANDO SERVIDOR ->> Conexões de fechamento"); } } catch (Exception e) { ExceptionLogger.LogException(e); } if (_clients.Count > 0) { _clients.Clear(); } log.Info("Conexões fechadas!"); }