Ejemplo n.º 1
0
        public void UpdateDatabase(List <Old_RaidCollection_Raid> _Raids, Func <string, Old_FightDataCollection> _CachedGetFightDataCollectionFunc, Func <WowRealm, VF_RaidDamageDatabase.RealmDB> _GetRealmDB)
        {
            Hidden._GlobalInitializationData.Init(_GetRealmDB, _CachedGetFightDataCollectionFunc);
            VF_RealmPlayersDatabase.Logger.ConsoleWriteLine("RaidStats: SummaryDatabase.UpdateDatabase: " + _Raids.Count + " raids");
            DateTime SummaryDBResetDate = new DateTime(2017, 10, 10); //Added 2017-10-15 when highscore lists were split up into multiple files!
            int      i = 0;
            int      u = 0;

            foreach (var raid in _Raids)
            {
                ++u;
                if (raid.RaidEndDate < SummaryDBResetDate) //Added 2017-10-15 when highscore lists were split up into multiple files!
                {
                    continue;
                }
                var groupRC = GetGroupRC(raid.Realm, raid.RaidOwnerName);
                if (groupRC == null)
                {
                    groupRC             = new GroupRaidCollection();
                    groupRC.m_Realm     = raid.Realm;
                    groupRC.m_GroupName = raid.RaidOwnerName;
                    AddGroupRC(groupRC);
                }

                groupRC.GenerateSummary_AddRaid(raid);
                Console.Write(".");
                ++i;
                if (i % 50 == 49)
                {
                    Console.Write("Added " + i + " raids(" + u + ")");
                    GC.Collect();
                }
            }
            Hidden._GlobalInitializationData.Clear();
        }
Ejemplo n.º 2
0
        public void UpdateDatabaseReplace(List <Old_RaidCollection_Raid> _Raids, Func <string, Old_FightDataCollection> _CachedGetFightDataCollectionFunc, Func <WowRealm, VF_RaidDamageDatabase.RealmDB> _GetRealmDB)
        {
            Hidden._GlobalInitializationData.Init(_GetRealmDB, _CachedGetFightDataCollectionFunc);
            Console.Write("SummaryDatabase.UpdateDatabaseReplace: " + _Raids.Count + " raids");
            int i = 0;

            foreach (var raid in _Raids)
            {
                var groupRC = GetGroupRC(raid.Realm, raid.RaidOwnerName);
                if (groupRC == null)
                {
                    groupRC             = new GroupRaidCollection();
                    groupRC.m_Realm     = raid.Realm;
                    groupRC.m_GroupName = raid.RaidOwnerName;
                    AddGroupRC(groupRC);
                }

                groupRC.GenerateSummary_ReplaceRaid(raid);
                Console.Write(".");
                ++i;
                if (i % 50 == 49)
                {
                    Console.Write("Replaced " + i + " raids");
                    GC.Collect();
                }
            }
            Hidden._GlobalInitializationData.Clear();
        }
Ejemplo n.º 3
0
        public void UpdateDatabase(List <Old_RaidCollection_Raid> _Raids, Func <string, Old_FightDataCollection> _CachedGetFightDataCollectionFunc, Func <WowRealm, VF_RaidDamageDatabase.RealmDB> _GetRealmDB)
        {
            Hidden._GlobalInitializationData.Init(_GetRealmDB, _CachedGetFightDataCollectionFunc);
            Console.Write("SummaryDatabase.UpdateDatabase: " + _Raids.Count + " raids");
            DateTime SummaryDBResetDate = new DateTime(2016, 11, 1); //Added 2017-01-10 when highscore lists were reset!
            int      i = 0;

            foreach (var raid in _Raids)
            {
                Console.Write(".");
                ++i;
                if (i % 50 == 49)
                {
                    Console.Write("Added " + i + " raids");
                    GC.Collect();
                }
                if (raid.RaidEndDate < SummaryDBResetDate) //Added 2017-01-10 when highscore lists were reset!
                {
                    continue;
                }
                var groupRC = GetGroupRC(raid.Realm, raid.RaidOwnerName);
                if (groupRC == null)
                {
                    groupRC             = new GroupRaidCollection();
                    groupRC.m_Realm     = raid.Realm;
                    groupRC.m_GroupName = raid.RaidOwnerName;
                    AddGroupRC(groupRC);
                }

                groupRC.GenerateSummary_AddRaid(raid);
            }
            Hidden._GlobalInitializationData.Clear();
        }
Ejemplo n.º 4
0
 public void Dispose()
 {
     m_CacheGroup = null;
     foreach (var bossFights in m_BossFights)
     {
         bossFights.Dispose();
     }
 }
Ejemplo n.º 5
0
        public GroupRaidCollection GetGroupRC(WowRealm _Realm, string _GroupName)
        {
            GroupRaidCollection retValue = null;

            if (m_GroupRCs.TryGetValue(Utility.GetRealmPreString(_Realm) + _GroupName, out retValue) == false)
            {
                return(null);
            }

            return(retValue);
        }
Ejemplo n.º 6
0
 public void Update(GroupRaidCollection _GroupRC)
 {
     foreach (var raid in _GroupRC.Raids)
     {
         Dictionary <string, string[]> instanceRuns;
         if (BossInformation.InstanceRuns.TryGetValue(raid.Value.RaidInstance, out instanceRuns) == false)
         {
             continue;
         }
         foreach (var instanceRun in instanceRuns)
         {
             var instanceClearData = VF_RaidDamageDatabase.RaidInstanceClearData.Generate(raid, instanceRun.Value);
             if (instanceClearData != null)
             {
                 InstanceClearInfo instanceClearInfo = new InstanceClearInfo
                 {
                     ClearStartDateTime = instanceClearData.m_RaidStartClearTime,
                     ClearEndDateTime   = instanceClearData.m_RaidEndClearTime
                 };
                 bool foundDuplicate = false;
                 if (FastestInstanceClears.ContainsKey(instanceRun.Key) == true)
                 {
                     var fastestClears = FastestInstanceClears[instanceRun.Key];
                     for (int i = 0; i < fastestClears.Count; ++i)
                     {
                         if (fastestClears[i].IsOverlapping(instanceClearInfo) == true)
                         {
                             fastestClears[i] = instanceClearInfo;
                             foundDuplicate   = true;
                         }
                     }
                 }
                 if (foundDuplicate == false)
                 {
                     FastestInstanceClears.AddToList(instanceRun.Key, instanceClearInfo);
                 }
             }
         }
         foreach (var bossFight in raid.Value.BossFights)
         {
             if (bossFight.IsQualityHigh(true) == true && bossFight.AttemptType == AttemptType.KillAttempt)
             {
                 var bossKillInfo = new BossKillInfo
                 {
                     KillStartDateTime = bossFight.StartDateTime,
                     KillEndDateTime   = bossFight.EndDateTime,
                 };
                 bool foundDuplicate = false;
                 if (FastestBossKills.ContainsKey(bossFight.BossName) == true)
                 {
                     var fastestKills = FastestBossKills[bossFight.BossName];
                     for (int i = 0; i < fastestKills.Count; ++i)
                     {
                         if (fastestKills[i].IsOverlapping(bossKillInfo) == true)
                         {
                             fastestKills[i] = bossKillInfo;
                             foundDuplicate  = true;
                         }
                     }
                 }
                 if (foundDuplicate == false)
                 {
                     FastestBossKills.AddToList(bossFight.BossName, bossKillInfo);
                 }
             }
         }
     }
     foreach (var fastestClears in FastestInstanceClears)
     {
         fastestClears.Value.Sort((x, y) => x.GetClearTimeSeconds() - y.GetClearTimeSeconds());
     }
     foreach (var fastestKills in FastestBossKills)
     {
         fastestKills.Value.Sort((x, y) => x.GetKillTimeSeconds() - y.GetKillTimeSeconds());
     }
 }
Ejemplo n.º 7
0
 private void AddGroupRC(GroupRaidCollection _GroupRaidCollection)
 {
     m_GroupRCs.Add(Utility.GetRealmPreString(_GroupRaidCollection.Realm) + _GroupRaidCollection.GroupName, _GroupRaidCollection);
 }
Ejemplo n.º 8
0
 public void InitCache(GroupRaidCollection _GroupRaidCollection)
 {
     m_CacheGroup = _GroupRaidCollection;
     InitChildCache();
 }