public void DeleteHistory(int aDays)
        {
            var DelTime = DateTime.Now - new TimeSpan(aDays, 0, 0, 0);

            using (var DB = new HistoryBookContext())
            {
                DB.Players.RemoveRange(DB.Players.Where(P => P.Timestamp < DelTime));
                DB.Structures.RemoveRange(DB.Structures.Where(S => S.Timestamp < DelTime));

                DB.SaveChanges();
                DB.Database.ExecuteSqlCommand("VACUUM;");
            }
        }
        private void HistoryLog()
        {
            // Update GlobalSTructureInfo on Playfields
            PlayerManager.Value.QueryPlayer(PDB =>
                                            PDB.Players
                                            .Where(P => P.Online)
                                            .GroupBy(P => P.Playfield, (k, p) => p.FirstOrDefault()),
                                            P => {
                Request_GlobalStructure_Update(new PString(P.Playfield)).Wait();
                Thread.Sleep(100);
            });

            using (var DB = new HistoryBookContext())
            {
                var Structures = StructureManager.Value.CurrentGlobalStructures;

                HistoryLogStructures(DB, LastStructuresData, Structures);
                PlayerManager.Value.QueryPlayer(PDB => PDB.Players, P => HistoryLog(DB, LastPlayerData, P));

                DB.SaveChanges();
            }
        }