コード例 #1
0
        public static GroupSummaryDatabase GenerateSummaryDatabase(SummaryDatabase _SummaryDatabase)
        {
            GroupSummaryDatabase newDatabase = new GroupSummaryDatabase();

            newDatabase.UpdateDatabase(_SummaryDatabase);
            return(newDatabase);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public static void UpdateSummaryDatabase(string _RootDirectory, SummaryDatabase _SummaryDatabase)
        {
            GroupSummaryDatabase database = null;
            string databaseFile           = _RootDirectory + "\\SummaryDatabase\\GroupSummaryDatabase.dat";

            //if (System.IO.File.Exists(databaseFile) == true)
            //{
            //    if (VF.Utility.LoadSerialize(databaseFile, out database) == false)
            //        database = null;
            //}
            //if (database != null)
            //{
            //    database.UpdateDatabase(_SummaryDatabase);
            //}
            //else
            {
                database = GenerateSummaryDatabase(_SummaryDatabase);
            }
            VF.Utility.SaveSerialize(databaseFile, database);
        }
コード例 #4
0
        public static SummaryDatabase LoadSummaryDatabase_New(string _SummaryDatabaseFile)
        {
            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)
            {
                foreach (var groupRC in database.m_GroupRCs)
                {
                    groupRC.Value.InitCache();
                }
            }
            return(database);
        }
コード例 #5
0
        public static SummaryDatabase LoadSummaryDatabase(string _RootDirectory)
        {
            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)
            {
                foreach (var groupRC in database.m_GroupRCs)
                {
                    groupRC.Value.InitCache();
                }
            }
            return(database);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        public bool AddSummaryDatabase(string _SummaryDatabaseFile)
        {
            bool            changesDone = false;
            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)
            {
                foreach (var groupRC in database.m_GroupRCs)
                {
                    GroupRaidCollection groupRCvalue;
                    if (m_GroupRCs.TryGetValue(groupRC.Key, out groupRCvalue) == true)
                    {
                        foreach (var raid in groupRC.Value.Raids)
                        {
                            if (groupRCvalue.Raids.AddIfKeyNotExist(raid.Key, raid.Value) == true)
                            {
                                raid.Value.InitCache(groupRCvalue);
                                changesDone = true;
                            }
                        }
                        groupRC.Value.Raids.Clear(); //Needed to avoid internal automatic Dispose() on raids we took;
                    }
                    else
                    {
                        changesDone = true;
                        m_GroupRCs.Add(groupRC.Key, groupRC.Value);
                        groupRC.Value.InitCache();
                    }
                }
            }
            return(changesDone);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        public void UpdateDatabase(SummaryDatabase _SummaryDatabase)
        {
            foreach (var groupRC in _SummaryDatabase.GroupRCs)
            {
                try
                {
                    GroupInfo groupInfo = GetGroupInfo(groupRC.Value.Realm, groupRC.Value.GroupName);
                    if (groupInfo == null)
                    {
                        groupInfo           = new GroupInfo();
                        groupInfo.Realm     = groupRC.Value.Realm;
                        groupInfo.GroupName = groupRC.Value.GroupName;
                        AddGroupInfo(groupInfo);
                    }

                    groupInfo.Update(groupRC.Value);
                }
                catch (Exception ex)
                {
                    VF_RaidDamageDatabase.Logger.LogException(ex);
                }
            }
        }