Exemplo n.º 1
0
        public void GenerateSummary_ReplaceRaid(Old_RaidCollection_Raid _Raid)
        {
            Raid raid = null;

            if (m_Raids.TryGetValue(_Raid.UniqueRaidID, out raid) == true)
            {
                raid.Dispose();
                raid = new Raid(_Raid);
                m_Raids[_Raid.UniqueRaidID] = raid;
                raid.InitCache(this);
            }
            else//if (m_Raids.TryGetValue(_Raid.UniqueRaidID, out raid) == false)
            {
                Raid newRaid = new Raid(_Raid);
                newRaid.InitCache(this);
                m_Raids.Add(newRaid.UniqueRaidID, newRaid);
                raid = newRaid;
            }
            try
            {
                var bossFights = _Raid.GetAllBossFights(Hidden._GlobalInitializationData.CachedGetFightDataCollectionFunc);
                raid.Update(_Raid, bossFights);
            }
            catch (Exception ex)
            {
                VF_RaidDamageDatabase.Logger.LogException(ex);
            }
        }
Exemplo n.º 2
0
 public Raid(Old_RaidCollection_Raid _Raid)
 {
     m_UniqueRaidID      = _Raid.UniqueRaidID;
     m_RaidID            = _Raid.RaidID;
     m_RaidResetDateTime = _Raid.RaidResetDateTime;
     m_RaidInstance      = _Raid.RaidInstance;
     m_RaidStartDate     = _Raid.RaidStartDate;
     m_RaidEndDate       = _Raid.RaidEndDate;
 }
Exemplo n.º 3
0
        public void Update(Old_RaidCollection_Raid _Raid, List <Old_RaidBossFight> _RaidBossFights)
        {
            if (m_UniqueRaidID != _Raid.UniqueRaidID ||
                m_RaidID != _Raid.RaidID ||
                m_RaidResetDateTime != _Raid.RaidResetDateTime)
            {
                throw new Exception("Update(RaidCollection_Raid _Raid): _Raid did not match!");
            }

            if (_Raid.RaidStartDate < m_RaidStartDate)
            {
                m_RaidStartDate = _Raid.RaidStartDate;
            }
            if (_Raid.RaidEndDate > m_RaidEndDate)
            {
                m_RaidEndDate = _Raid.RaidEndDate;
            }

            foreach (var bossFight in _RaidBossFights)
            {
                try
                {
                    m_RaidMembers.AddRangeUnique(bossFight.GetFightCacheData().m_FightDataCollection.m_RaidMembers);
                }
                catch (Exception)
                {}
            }

            foreach (var bossFight in _RaidBossFights)
            {
                if (bossFight.GetBossName() == "Trash")
                {
                    continue;//Skip trash for obvious reasons
                }
                try
                {
                    BossFight newBossFight = new BossFight(new Old_RaidBossFight[] { bossFight }, m_RaidMembers);
                    if (newBossFight == null)
                    {
                        throw new Exception("Crazy BossFight Crash Exception");
                    }
                    newBossFight.InitCache(this);

                    int overlappingFightIndex = m_BossFights.FindIndex((_Value) => _Value.IsOverlapping(newBossFight));
                    if (overlappingFightIndex != -1)
                    {
                        //Overlapping fights
                        if (newBossFight.IsBetterVersionOf(m_BossFights[overlappingFightIndex]) == true)
                        {
                            m_BossFights[overlappingFightIndex] = newBossFight;
                        }
                    }
                    else
                    {
                        m_BossFights.Add(newBossFight);
                    }
                }
                catch (Exception ex)
                {
                    if (ex.Message.StartsWith("Player:") && ex.Message.EndsWith("was not found in unitDatas"))
                    {
                        VF_RaidDamageDatabase.Logger.ConsoleWriteLine("Exception in RaidID: " + m_RaidID + ", BossFight: " + bossFight.GetBossName() + ", Message: \"" + ex.Message + "\"", ConsoleColor.Red);
                    }
                    else
                    {
                        VF_RaidDamageDatabase.Logger.LogException(ex);
                    }
                }
            }
        }
Exemplo n.º 4
0
 public static string BreadCrumb_AddRaidOverview(VF_RaidDamageDatabase.RaidCollection_Raid _Raid)
 {
     return("<li><span class='divider'>/</span> <a href='RaidOverview.aspx?Raid=" + _Raid.UniqueRaidID + "'>"
            + _Raid.RaidInstance + "(" + _Raid.RaidID.ToString() + ")</a></li>");
 }