public static ItemSummaryDatabase LoadSummaryDatabase(string _RootDirectory) { ItemSummaryDatabase database = null; string databaseFile = _RootDirectory + "\\SummaryDatabase\\ItemSummaryDatabase.dat"; if (System.IO.File.Exists(databaseFile) == true) { if (VF.Utility.LoadSerialize(databaseFile, out database) == false) { database = null; } } //if (database != null) //{ // foreach (var guild in database.m_Guilds) // { // guild.Value.InitCache(); // } //} return(database); }
public static void UpdateSummaryDatabase(string _RootDirectory, RPPDatabase _Database, bool _UpdateAllHistory = false) { ItemSummaryDatabase database = null; string databaseFile = _RootDirectory + "\\SummaryDatabase\\ItemSummaryDatabase.dat"; if (System.IO.File.Exists(databaseFile) == true) { if (VF.Utility.LoadSerialize(databaseFile, out database) == false) { database = null; } } //if (database != null) //{ // foreach (var guild in database.m_Guilds) // { // guild.Value.InitCache(); // } //} if (database == null) { database = new ItemSummaryDatabase(); database.UpdateDatabase(_Database); } else { if (_UpdateAllHistory == true) { database.UpdateDatabase(_Database); } else { database.UpdateDatabase(_Database, DateTime.UtcNow.AddDays(-8)); } } VF.Utility.SaveSerialize(databaseFile, database); }
public static void UpdateSummaryDatabase(string _RootDirectory, RPPDatabase _Database, bool _UpdateAllHistory = false) { ItemSummaryDatabase database = null; string databaseFile = _RootDirectory + "\\SummaryDatabase\\ItemSummaryDatabase.dat"; if (System.IO.File.Exists(databaseFile) == true) { if (VF.Utility.LoadSerialize(databaseFile, out database, 10000, true) == false) { database = null; } //Update the new dictionary realm with all the old entitycounters! database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Emerald_Dream, database.m_EntityCounter_Emerald_Dream); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Warsong, database.m_EntityCounter_Warsong); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Al_Akir, database.m_EntityCounter_Al_Akir); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Valkyrie, database.m_EntityCounter_Valkyrie); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.VanillaGaming, database.m_EntityCounter_VanillaGaming); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Rebirth, database.m_EntityCounter_Rebirth); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Archangel, database.m_EntityCounter_Archangel); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Nostalrius, database.m_EntityCounter_Nostalrius); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Kronos, database.m_EntityCounter_Kronos); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.NostalGeek, database.m_EntityCounter_NostalGeek); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Nefarian, database.m_EntityCounter_Nefarian); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.NostalriusPVE, database.m_EntityCounter_NostalriusPVE); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.WarsongTBC, database.m_EntityCounter_WarsongTBC); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.KronosII, database.m_EntityCounter_KronosII); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Vengeance_Wildhammer, database.m_EntityCounter_Vengeance_Wildhammer); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.ExcaliburTBC, database.m_EntityCounter_ExcaliburTBC); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.L4G_Hellfire, database.m_EntityCounter_L4G_Hellfire); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Warsong2, database.m_EntityCounter_Warsong2); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Vengeance_Stonetalon, database.m_EntityCounter_Vengeance_Stonetalon); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Elysium, database.m_EntityCounter_Elysium); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Elysium2, database.m_EntityCounter_Elysium2); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Zeth_Kur, database.m_EntityCounter_Zeth_Kur); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Nemesis, database.m_EntityCounter_Nemesis); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.HellGround, database.m_EntityCounter_HellGround); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Nostralia, database.m_EntityCounter_Nostralia); database.m_EntityCounters_Realm.AddIfKeyNotExist(WowRealm.Hellfire2, database.m_EntityCounter_Hellfire2); } //if (database != null) //{ // foreach (var guild in database.m_Guilds) // { // guild.Value.InitCache(); // } //} if (database == null) { database = new ItemSummaryDatabase(); database.UpdateDatabase(_Database); } else { if (_UpdateAllHistory == true) { database.UpdateDatabase(_Database); } else { database.UpdateDatabase(_Database, DateTime.UtcNow.AddDays(-8)); } } VF.Utility.SaveSerialize(databaseFile, database); }