public static SummaryDatabase GenerateSummaryDatabase(Old_RaidCollection _RaidCollection, Func <string, Old_FightDataCollection> _CachedGetFightDataCollectionFunc, Func <WowRealm, VF_RaidDamageDatabase.RealmDB> _GetRealmDB) { SummaryDatabase newDatabase = new SummaryDatabase(); newDatabase.UpdateDatabase(_RaidCollection, _CachedGetFightDataCollectionFunc, _GetRealmDB); return(newDatabase); }
public VF_RaidDamageDatabase.RaidCollection GetRaidCollection() { return(DynamicReloader.GetData <VF_RaidDamageDatabase.RaidCollection>(() => { VF_RaidDamageDatabase.RaidCollection raidCollection = null; VF.Utility.LoadSerialize <VF_RaidDamageDatabase.RaidCollection>(g_RDDBDir + "RaidCollection.dat", out raidCollection); return raidCollection; }, (_RaidCollection, _LastLoadTime) => { return (DateTime.UtcNow - _LastLoadTime).TotalMinutes > 5; })); }
public static void FixBuggedSummaryDatabase_New(string _SummaryDatabaseFile, Old_RaidCollection _FullRaidCollection, List <Old_RaidCollection_Raid> _BuggedRaids, Func <string, Old_FightDataCollection> _CachedGetFightDataCollectionFunc, Func <WowRealm, VF_RaidDamageDatabase.RealmDB> _GetRealmDB) { SummaryDatabase database = null; if (System.IO.File.Exists(_SummaryDatabaseFile) == true) { if (VF.Utility.LoadSerialize(_SummaryDatabaseFile, out database, 10000, true) == false) { database = null; } } if (database == null) { database = GenerateSummaryDatabase(_FullRaidCollection, _CachedGetFightDataCollectionFunc, _GetRealmDB); } else { database.UpdateDatabaseReplace(_BuggedRaids, _CachedGetFightDataCollectionFunc, _GetRealmDB); } VF.Utility.SaveSerialize(_SummaryDatabaseFile, database); }
public static SummaryDatabase UpdateSummaryDatabase(string _RootDirectory, Old_RaidCollection _FullRaidCollection, List <Old_RaidCollection_Raid> _RecentChangedRaids, Func <string, Old_FightDataCollection> _CachedGetFightDataCollectionFunc, Func <WowRealm, VF_RaidDamageDatabase.RealmDB> _GetRealmDB) { SummaryDatabase database = null; string databaseFile = _RootDirectory + "\\SummaryDatabase\\FullSummaryDatabase.dat"; if (System.IO.File.Exists(databaseFile) == true) { if (VF.Utility.LoadSerialize(databaseFile, out database) == false) { database = null; } } if (database == null) { database = GenerateSummaryDatabase(_FullRaidCollection, _CachedGetFightDataCollectionFunc, _GetRealmDB); } else { database.UpdateDatabase(_RecentChangedRaids, _CachedGetFightDataCollectionFunc, _GetRealmDB); } VF.Utility.SaveSerialize(databaseFile, database); return(database); }
public void UpdateDatabase(Old_RaidCollection _RaidCollection, Func <string, Old_FightDataCollection> _CachedGetFightDataCollectionFunc, Func <WowRealm, VF_RaidDamageDatabase.RealmDB> _GetRealmDB) { UpdateDatabase(_RaidCollection.m_Raids.Values.ToList(), _CachedGetFightDataCollectionFunc, _GetRealmDB); }