Пример #1
0
        public static string GenerateTotalMeters(bool filteredData, List <VF_RaidDamageDatabase.RaidBossFight> orderedFights, VF_RaidDamageDatabase.RealmDB realmDB, List <string> attendingRaidPlayers)
        {
            string graphSection = "";
            List <Tuple <string, VF_RaidDamageDatabase.UnitData> > fullUnitDatas = new List <Tuple <string, VF_RaidDamageDatabase.UnitData> >();

            {
                PageUtility.StatsBarStyle statsBarStyle = new PageUtility.StatsBarStyle
                {
                    m_TitleText          = "",
                    m_BarTextColor       = "#000",
                    m_LeftSideTitleText  = "#",
                    m_RightSideTitleText = "",
                    m_BeforeBarWidth     = 25,
                    m_MaxWidth           = 470,
                    m_AfterBarWidth      = 30
                };

                string dmgThreatSection    = "<div class='span4' style='min-width: 460px;'>";
                string healSection         = "<div class='span4' style='min-width: 460px;'>";
                int    totalBarsCount      = 0;
                int    totalFightDurations = 0;
                foreach (var fight in orderedFights)
                {
                    List <Tuple <string, VF_RaidDamageDatabase.UnitData> > unitsData = null;
                    if (filteredData == true)
                    {
                        unitsData = fight.GetFilteredPlayerUnitsDataCopy(true, realmDB.RD_GetPlayerIdentifierFunc(fight));
                    }
                    else
                    {
                        unitsData = fight.GetUnitsDataCopy(true);
                    }
                    var petData = fight.GetFilteredPetUnitsData();
                    List <Tuple <string, VF_RaidDamageDatabase.UnitData> > abusingPets = new List <Tuple <string, VF_RaidDamageDatabase.UnitData> >();
                    foreach (var unitPet in petData)
                    {
                        if (fight.GetFightCacheData().m_FightDataCollection.m_RaidMembers.Contains(unitPet.Item1.Split('(').First()) == true)
                        {
                            //Player with Pet UnitPet should be banned from damagemeter or has its damage purged
                            string abusingPlayer = unitPet.Item1.Split(new string[] { "(Pet for ", ")" }, StringSplitOptions.RemoveEmptyEntries)[1];
                            abusingPets.Add(Tuple.Create(abusingPlayer, unitPet.Item2));
                        }
                    }
                    unitsData.AddRange(petData);
                    foreach (var unit in unitsData)
                    {
                        int index         = fullUnitDatas.FindIndex((_Value) => { return(_Value.Item1 == unit.Item1); });
                        var unitFightData = unit.Item2.CreateCopy();
                        var petsAbused    = abusingPets.FindAll((_Value) => { return(_Value.Item1 == unit.Item1); });
                        if (petsAbused != null && petsAbused.Count > 0)
                        {
                            foreach (var petAbused in petsAbused)
                            {
                                unitFightData.SubtractUnitData(petAbused.Item2);
                            }
                        }
                        if (index == -1)
                        {
                            fullUnitDatas.Add(new Tuple <string, VF_RaidDamageDatabase.UnitData>(unit.Item1, unitFightData));
                        }
                        else
                        {
                            fullUnitDatas[index].Item2.AddUnitData(unitFightData);
                        }
                    }
                    totalFightDurations += fight.GetFightDuration();
                }

                foreach (var dataPresentTypeInfo in m_DataPresentTypeInfoList)
                {
                    var sortedUnits = fullUnitDatas.OrderByDescending((_Unit) => { return(dataPresentTypeInfo.m_GetValue(_Unit.Item2)); });
                    if (sortedUnits.Count() > 0)
                    {
                        List <PageUtility.StatsBarData> statsBars = new List <PageUtility.StatsBarData>();
                        //string newBossSection = "";
                        double totalValue = 0;
                        double maxValue   = 0;
                        VF_RaidDamageDatabase.UnitData.CalculateTotalAndMax(fullUnitDatas.AsReadOnly(), dataPresentTypeInfo.m_GetValue
                                                                            , (_Value) => { return(realmDB.RD_IsPlayer(_Value.Item1, attendingRaidPlayers) && dataPresentTypeInfo.m_ValidCheck(_Value.Item2)); }
                                                                            , out totalValue, out maxValue);
                        //newBossSection += "VF_CreateDmgBar(1.0, '#000000', '" + dataPresentTypeInfo.m_TypeName + "','#ffffff', '" + (totalValue / 1000).ToString("0.0", System.Globalization.CultureInfo.InvariantCulture) + "k total');";
                        int players = 0;
                        foreach (var unit in sortedUnits)
                        {
                            var    playerData = realmDB.RD_FindPlayer(unit.Item1, attendingRaidPlayers);
                            double currValue  = dataPresentTypeInfo.m_GetValue(unit.Item2);
                            if (playerData != null && currValue > 0 && dataPresentTypeInfo.m_ValidCheck(unit.Item2))
                            {
                                double percentage = (double)currValue / totalValue;

                                double displayPercentage = percentage / (maxValue / totalValue);
                                //percentage *= maxValue;
                                //if (players < dataPresentTypeInfo.m_Count)
                                {
                                    ++players;
                                    string classColor = "#CCCCCC";
                                    classColor = RealmPlayersServer.Code.Resources.VisualResources._ClassColors[playerData.Character.Class];
                                    //newBossSection += "VF_CreateDmgBar(" + displaypercentage.ToString(System.Globalization.CultureInfo.InvariantCulture) + ", '" + classColor + "', '<player," + unit.Item1 + ">" + unit.Item1 + "(" + (currValue / totalFightDurations).ToString("0.0", System.Globalization.CultureInfo.InvariantCulture) + "/s)','#000000', '" + (int)currValue + "(" + string.Format("{0:0.0%}", percentage) + ")');";

                                    if (dataPresentTypeInfo.m_TypeName == "Deaths")
                                    {
                                        string rightSideText = "" + (int)currValue + " death" + (currValue > 1 ? "s" : "");
                                        statsBars.Add(new PageUtility.StatsBarData
                                        {
                                            m_BeforeBarText   = "#" + players,// + " " + PageUtility.CreateLink("http://realmplayers.com/CharacterViewer.aspx?realm=" + RealmPlayersServer.StaticValues.ConvertRealmParam(realmDB.Realm) + "&player=" + unit.Item1, unit.Item1),
                                            m_OnBarLeftText   = PageUtility.CreateLink_RaidStats_Player(playerData),
                                            m_BarColor        = classColor,
                                            m_PercentageWidth = displayPercentage,
                                            m_AfterBarText    = percentage.ToStringDot("0.0%"),
                                            m_OnBarRightText  = rightSideText,
                                            m_OnBarTextWidth  = StaticValues.MeasureStringLength(playerData.Name + " " + rightSideText)
                                        });
                                    }
                                    else
                                    {
                                        string rightSideText = "" + (int)currValue + "(" + (currValue / totalFightDurations).ToStringDot("0") + "/s)";
                                        statsBars.Add(new PageUtility.StatsBarData
                                        {
                                            m_BeforeBarText   = "#" + players,// + "(" + string.Format("{0:0.0%}", percentage) + ")",
                                            m_OnBarLeftText   = PageUtility.CreateLink_RaidStats_Player(playerData),
                                            m_BarColor        = classColor,
                                            m_PercentageWidth = displayPercentage,
                                            m_AfterBarText    = percentage.ToStringDot("0.0%"),
                                            m_OnBarRightText  = rightSideText,
                                            m_OnBarTextWidth  = StaticValues.MeasureStringLength(playerData.Name + " " + rightSideText)
                                        });
                                    }
                                }
                            }
                            else if (unit.Item1.Contains("(Pet for"))
                            {
                                double percentage = (double)currValue / totalValue;

                                double displayPercentage = percentage / (maxValue / totalValue);
                                //percentage *= maxValue;
                                //if (players < dataPresentTypeInfo.m_Count)
                                {
                                    ++players;
                                    string classColor = "#00FF00";
                                    //newBossSection += "VF_CreateDmgBar(" + displaypercentage.ToString(System.Globalization.CultureInfo.InvariantCulture) + ", '" + classColor + "', '<player," + unit.Item1 + ">" + unit.Item1 + "(" + (currValue / totalFightDurations).ToString("0.0", System.Globalization.CultureInfo.InvariantCulture) + "/s)','#000000', '" + (int)currValue + "(" + string.Format("{0:0.0%}", percentage) + ")');";

                                    if (dataPresentTypeInfo.m_TypeName == "Deaths")
                                    {
                                        string rightSideText = "" + (int)currValue + " death" + (currValue > 1 ? "s" : "");
                                        statsBars.Add(new PageUtility.StatsBarData
                                        {
                                            m_BeforeBarText   = "#" + players,// + " " + PageUtility.CreateLink("http://realmplayers.com/CharacterViewer.aspx?realm=" + RealmPlayersServer.StaticValues.ConvertRealmParam(realmDB.Realm) + "&player=" + unit.Item1, unit.Item1),
                                            m_OnBarLeftText   = unit.Item1,
                                            m_BarColor        = classColor,
                                            m_PercentageWidth = displayPercentage,
                                            m_AfterBarText    = percentage.ToStringDot("0.0%"),
                                            m_OnBarRightText  = rightSideText,
                                            m_OnBarTextWidth  = StaticValues.MeasureStringLength(unit.Item1 + " " + rightSideText)
                                        });
                                    }
                                    else
                                    {
                                        string rightSideText = "" + (int)currValue + "(" + (currValue / totalFightDurations).ToStringDot("0") + "/s)";
                                        statsBars.Add(new PageUtility.StatsBarData
                                        {
                                            m_BeforeBarText   = "#" + players,// + "(" + string.Format("{0:0.0%}", percentage) + ")",
                                            m_OnBarLeftText   = unit.Item1,
                                            m_BarColor        = classColor,
                                            m_PercentageWidth = displayPercentage,
                                            m_AfterBarText    = percentage.ToStringDot("0.0%"),
                                            m_OnBarRightText  = rightSideText,
                                            m_OnBarTextWidth  = StaticValues.MeasureStringLength(unit.Item1 + " " + rightSideText)
                                        });
                                    }
                                }
                            }
                        }
                        //graphSection += newBossSection;
                        totalBarsCount           += 1 + players;
                        statsBarStyle.m_TitleText = dataPresentTypeInfo.m_TypeName + "(" + (totalValue / 1000).ToStringDot("0.0") + "k)";
                        if (dataPresentTypeInfo.m_TypeName == "Deaths")
                        {
                            statsBarStyle.m_TitleText = dataPresentTypeInfo.m_TypeName + "(" + totalValue + " total)";
                        }

                        if (dataPresentTypeInfo.m_TypeName == "Damage" || dataPresentTypeInfo.m_TypeName == "Threat" || dataPresentTypeInfo.m_TypeName == "Damage Taken")
                        {
                            dmgThreatSection += PageUtility.CreateStatsBars_HTML(statsBarStyle, statsBars, dataPresentTypeInfo.m_Count);
                        }
                        else
                        {
                            healSection += PageUtility.CreateStatsBars_HTML(statsBarStyle, statsBars, dataPresentTypeInfo.m_Count);
                        }
                    }
                }
                dmgThreatSection += "</div>";
                healSection      += "</div>";
                graphSection     += "<div class='row'>" + dmgThreatSection + healSection + "</div>";
            }
            return(GeneratePlayerDeaths(realmDB, fullUnitDatas) + "<br/><br/>" + graphSection);
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string        bossName        = BossesControl.GetBossFilterType();
            string        instanceName    = BossesControl.GetBossFilterType();
            List <string> bosses          = BossesControl.GetBossFilter();
            string        andPlayer       = PageUtility.GetQueryString(Request, "AndPlayer", null);
            int           showPlayerCount = PageUtility.GetQueryInt(Request, "Count", 100);

            if (showPlayerCount > 200)
            {
                showPlayerCount = 200;
            }

            this.Title = "Rankings | RaidStats";

            List <PlayerClass>   classLimits   = ClassControl.GetClassLimits();// FightOverallOverview.GetClassLimits(PageUtility.GetQueryString(Request, "ClassLimit", "WrIWaIWlIMaIPrIShIRoIPaIDrIHu"));
            List <PlayerFaction> factionLimits = ClassControl.GetFactionLimits();
            bool showMultipleEntries           = PageUtility.GetQueryString(Request, "MultipleEntries", "false").ToLower() != "false";

            var realm = RealmControl.Realm;

            string guildLimit = PageUtility.GetQueryString(Request, "Guild", null);

            List <VF_RDDatabase.BossFight> fightInstances = new List <VF_RDDatabase.BossFight>();

            DateTime earliestCompatibleDate = new DateTime(2013, 10, 23, 0, 0, 0);
            //var raidCollection = ApplicationInstance.Instance.GetRaidCollection();

            List <Tuple <PlayerData, AverageStats> > dataset = GenerateAverageDataSet(bosses, classLimits, factionLimits, realm, guildLimit);

            if (dataset == null)
            {
                return;
            }

            string infoText         = "";
            string breadCrumbCommon = "";

            if (guildLimit != null)
            {
                string colorClasses = ClassControl.GetColorClassesStr();

                infoText         = "<h1>Average Performance for players in " + guildLimit + " vs " + bossName + "</h1>";
                breadCrumbCommon = PageUtility.BreadCrumb_AddHome()
                                   + PageUtility.BreadCrumb_AddRealm(realm)
                                   + PageUtility.BreadCrumb_AddGuildRaidList(guildLimit);
            }
            else
            {
                string vsText = bossName;
                if (vsText == "Specific Bosses")
                {
                    vsText = "<span title='" + bosses.MergeToStringVF(" & ") + "'>" + bossName + "</span>";
                }
                infoText         = "<h1>Average Performance for players vs " + vsText + "</h1>";
                breadCrumbCommon = PageUtility.BreadCrumb_AddHome()
                                   + PageUtility.BreadCrumb_AddRealm(realm);
            }

            if (ClassControl.HasClassLimits() == true)
            {
                string colorClasses = ClassControl.GetColorClassesStr();
                string breadCrumb   = breadCrumbCommon + PageUtility.BreadCrumb_AddThisPageWithout("Average Performance vs " + bossName, Request, "ClassLimit");

                if (ClassControl.HasFactionLimits() == true)
                {
                    breadCrumb += PageUtility.BreadCrumb_AddFinish("for " + colorClasses);
                    breadCrumb += PageUtility.BreadCrumb_AddFinish(ClassControl.GetColorFactionStr());
                }
                else
                {
                    breadCrumb += PageUtility.BreadCrumb_AddFinish("for " + colorClasses);
                }
                m_BreadCrumbHTML = new MvcHtmlString(breadCrumb);
            }
            else
            {
                if (ClassControl.HasFactionLimits() == true)
                {
                    m_BreadCrumbHTML = new MvcHtmlString(breadCrumbCommon
                                                         + PageUtility.BreadCrumb_AddThisPageWithout("Average Performance vs " + bossName, Request, "FactionLimit")
                                                         + PageUtility.BreadCrumb_AddFinish(ClassControl.GetColorFactionStr()));
                }
                else
                {
                    m_BreadCrumbHTML = new MvcHtmlString(breadCrumbCommon
                                                         + PageUtility.BreadCrumb_AddFinish("Average Performance vs " + bossName));
                }
            }

            infoText += "<p>Average Performance is calculated by taking all the boss fight averages from the following bosses: <br/><font color=#fff>" + bosses.MergeToStringVF(", ") + "</font></p>";
            infoText += "<p>Boss fight average is calculated by taking the 5 best performing(for the player) encounters out of the last 6 attended.</p>";
            infoText += "<p>If there are less than 3 encounters for the player in the database or the last attended encounter was more than 1 month ago, the player will not be included in the list.</p>";

            m_InfoTextHTML = new MvcHtmlString(infoText);

            if (dataset.Count == 0)
            {
                return;
            }

            string graphSection = "<style>" + PageUtility.CreateStatsBars_HTML_CSSCode() + "</style>";

            PageUtility.StatsBarStyle statsBarStyle = new PageUtility.StatsBarStyle
            {
                m_TitleText          = "Average DPS",
                m_BarTextColor       = "#000",
                m_LeftSideTitleText  = "#",
                m_RightSideTitleText = "",
                m_BeforeBarWidth     = 30,
                m_MaxWidth           = 400,
                m_AfterBarWidth      = 0
            };
            {
                int maxCount = showPlayerCount;

                var   orderedByDPS = dataset.OrderByDescending((_Value) => _Value.Item2.m_DPS);
                float highestDPS   = orderedByDPS.First().Item2.m_DPS;
                int   players      = 0;
                List <PageUtility.StatsBarData> dpsStatsBars = new List <PageUtility.StatsBarData>();
                foreach (var data in orderedByDPS)
                {
                    if (++players > maxCount || data.Item2.m_DPS < 1)
                    {
                        if (andPlayer == null)
                        {
                            break;
                        }
                        else if (data.Item1.Name != andPlayer)
                        {
                            continue;
                        }
                    }
                    float  averageDPS        = data.Item2.m_DPS;
                    double displayPercentage = averageDPS / highestDPS;
                    string rightSideText     = averageDPS.ToStringDot("0.0") + "/s";
                    dpsStatsBars.Add(new PageUtility.StatsBarData
                    {
                        m_BeforeBarText   = "#" + players,
                        m_OnBarLeftText   = PageUtility.CreateLink_RaidStats_Player(data.Item1),
                        m_BarColor        = PageUtility.GetClassColor(data.Item1),
                        m_PercentageWidth = displayPercentage,
                        m_AfterBarText    = "",
                        //m_BarTextColor = "#000",
                        m_OnBarRightText = rightSideText,
                        m_OnBarTextWidth = StaticValues.MeasureStringLength(data.Item1.Name + " " + rightSideText)
                    });
                }
                var   orderedByHPS = dataset.OrderByDescending((_Value) => _Value.Item2.m_HPS);
                float highestHPS   = orderedByHPS.First().Item2.m_HPS;
                players = 0;
                List <PageUtility.StatsBarData> hpsStatsBars = new List <PageUtility.StatsBarData>();
                foreach (var data in orderedByHPS)
                {
                    if (++players > maxCount || data.Item2.m_HPS < 1)
                    {
                        if (andPlayer == null)
                        {
                            break;
                        }
                        else if (data.Item1.Name != andPlayer)
                        {
                            continue;
                        }
                    }
                    float  averageHPS        = data.Item2.m_HPS;
                    double displayPercentage = averageHPS / highestHPS;

                    string rightSideText = averageHPS.ToStringDot("0.0") + "/s";
                    hpsStatsBars.Add(new PageUtility.StatsBarData
                    {
                        m_BeforeBarText   = "#" + players,
                        m_OnBarLeftText   = PageUtility.CreateLink_RaidStats_Player(data.Item1),
                        m_BarColor        = PageUtility.GetClassColor(data.Item1),
                        m_PercentageWidth = displayPercentage,
                        m_AfterBarText    = "",
                        //m_BarTextColor = "#000",
                        m_OnBarRightText = rightSideText,
                        m_OnBarTextWidth = StaticValues.MeasureStringLength(data.Item1.Name + " " + rightSideText)
                    });
                }

                while (dpsStatsBars.Count > hpsStatsBars.Count)
                {
                    hpsStatsBars.Add(new PageUtility.StatsBarData
                    {
                        m_AfterBarText    = "",
                        m_BarColor        = "#CCCCCC",
                        m_BeforeBarText   = "",
                        m_OnBarLeftText   = "",
                        m_OnBarRightText  = "",
                        m_PercentageWidth = 0.0,
                    });
                }
                while (hpsStatsBars.Count > dpsStatsBars.Count)
                {
                    dpsStatsBars.Add(new PageUtility.StatsBarData
                    {
                        m_AfterBarText    = "",
                        m_BarColor        = "#CCCCCC",
                        m_BeforeBarText   = "",
                        m_OnBarLeftText   = "",
                        m_OnBarRightText  = "",
                        m_PercentageWidth = 0.0,
                    });
                }
                statsBarStyle.m_TitleText = "Average DPS vs " + bossName;
                graphSection += PageUtility.CreateStatsBars_HTML(statsBarStyle, dpsStatsBars, 50, 1);
                graphSection += "&nbsp;&nbsp;&nbsp;&nbsp;";
                statsBarStyle.m_TitleText = "Average Effective HPS vs " + bossName;
                graphSection += PageUtility.CreateStatsBars_HTML(statsBarStyle, hpsStatsBars, 50, 1);
            }

            m_GraphSection = new MvcHtmlString(graphSection);
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string guildLimit  = PageUtility.GetQueryString(Request, "Guild", "null");
            string playerLimit = PageUtility.GetQueryString(Request, "player", "null");

            var realm = RealmControl.Realm;

            string breadCrumbCommon = "";

            if (guildLimit != "null")
            {
                playerLimit = "null";
                this.Title  = "Boss records for " + guildLimit + " | RaidStats";

                breadCrumbCommon = PageUtility.BreadCrumb_AddHome()
                                   + PageUtility.BreadCrumb_AddRealm(realm)
                                   + PageUtility.BreadCrumb_AddLink("RaidList.aspx?Guild=" + guildLimit, guildLimit);

                m_BossListInfoHTML = new MvcHtmlString("<h1>Raid Bosses for " + guildLimit + "</h1>"
                                                       + "<p>Top DPS, HPS and fastest kill times are listed below for the different bosses</p>"
                                                       + "<p>Note that this does only show data from the guild " + guildLimit + ".<br />If you want to see for all guilds click " + PageUtility.CreateLink("BossList.aspx?realm=" + RealmPlayersServer.StaticValues.ConvertRealmParam(realm), "here") + "</p>");
            }
            else if (playerLimit != "null")
            {
                this.Title = "Boss records for " + playerLimit + " | RaidStats";

                breadCrumbCommon = PageUtility.BreadCrumb_AddHome()
                                   + PageUtility.BreadCrumb_AddRealm(realm)
                                   + PageUtility.BreadCrumb_AddLink("PlayerOverview.aspx?realm=" + RealmPlayersServer.StaticValues.ConvertRealmParam(realm) + "&player=" + playerLimit, playerLimit);

                m_BossListInfoHTML = new MvcHtmlString("<h1>Raid Boss records for " + playerLimit + "</h1>"
                                                       + "<p>Top DPS, HPS and fastest kill times are listed below for the different bosses</p>"
                                                       + "<p>Note that this does only show data for player " + playerLimit + ".<br />If you want to see for all players on the realm click " + PageUtility.CreateLink("BossList.aspx?realm=" + RealmPlayersServer.StaticValues.ConvertRealmParam(realm), "here") + "</p>");
            }
            else
            {
                this.Title = "Boss records | RaidStats";

                breadCrumbCommon = PageUtility.BreadCrumb_AddHome()
                                   + PageUtility.BreadCrumb_AddRealm(realm);

                m_BossListInfoHTML = new MvcHtmlString("<h1>Raid Bosses</h1>"
                                                       + "<p>Top DPS, HPS and fastest kill times are listed below for the different bosses</p>");
            }

            if (ClassControl.HasClassLimits() == true)
            {
                string colorClasses = ClassControl.GetColorClassesStr();
                string breadCrumb   = breadCrumbCommon + PageUtility.BreadCrumb_AddThisPageWithout("Bosses", Request, "ClassLimit");

                if (ClassControl.HasFactionLimits() == true)
                {
                    breadCrumb += PageUtility.BreadCrumb_AddFinish("vs " + colorClasses);
                    breadCrumb += PageUtility.BreadCrumb_AddFinish("Only " + ClassControl.GetColorFactionStr());
                }
                else
                {
                    breadCrumb += PageUtility.BreadCrumb_AddFinish("vs " + colorClasses);
                }
                m_BreadCrumbHTML = new MvcHtmlString(breadCrumb);
            }
            else
            {
                if (ClassControl.HasFactionLimits() == true)
                {
                    m_BreadCrumbHTML = new MvcHtmlString(breadCrumbCommon
                                                         + PageUtility.BreadCrumb_AddThisPageWithout("Bosses", Request, "FactionLimit")
                                                         + PageUtility.BreadCrumb_AddFinish("Only " + ClassControl.GetColorFactionStr()));
                }
                else
                {
                    m_BreadCrumbHTML = new MvcHtmlString(breadCrumbCommon
                                                         + PageUtility.BreadCrumb_AddFinish("Bosses"));
                }
            }

            m_TableHeadHTML = new MvcHtmlString(
                PageUtility.CreateTableRow("",
                                           PageUtility.CreateTableColumnHead("Instance") +
                                           PageUtility.CreateTableColumnHead("Boss") +
                                           PageUtility.CreateTableColumnHead("Top DPS") +
                                           PageUtility.CreateTableColumnHead("Top HPS") +
                                           PageUtility.CreateTableColumnHead("Fastest Kill") +
                                           PageUtility.CreateTableColumnHead("Kill Count")));

            DateTime earliestCompatibleDate = new DateTime(2013, 10, 23, 0, 0, 0);
            var      realmDB = ApplicationInstance.Instance.GetRealmDB(VF_RealmPlayersDatabase.WowRealm.Emerald_Dream);
            //var raidCollection = ApplicationInstance.Instance.GetRaidCollection();

            var summaryDatabase = ApplicationInstance.Instance.GetSummaryDatabase();

            if (summaryDatabase == null)
            {
                return;
            }

            IEnumerable <VF_RaidDamageDatabase.Models.PurgedPlayer> purgePlayers = ApplicationInstance.Instance.GetPurgedPlayers(realm);

            var classLimits   = ClassControl.GetClassLimits();
            var factionLimits = ClassControl.GetFactionLimits();

            string tableBody = "";

            foreach (var boss in BossInformation.BossFights)
            {
                var bossFights = summaryDatabase.GetHSElligibleBossFights(boss.Key, realm, guildLimit == "null" ? null : guildLimit, playerLimit == "null" ? null : playerLimit, purgePlayers);
                if (bossFights.Count > 0)
                {
                    //averagePrecision /= bossFights.Count;
                    Tuple <string, int>    fastestKill = new Tuple <string, int>("", int.MaxValue);
                    Tuple <string, double> topDPS      = new Tuple <string, double>("", 0.0);
                    Tuple <string, double> topHPS      = new Tuple <string, double>("", 0.0);
                    foreach (var fight in bossFights)
                    {
                        if (realmDB.Realm != fight.CacheRaid.CacheGroup.Realm)
                        {
                            realmDB = ApplicationInstance.Instance.GetRealmDB(fight.CacheRaid.CacheGroup.Realm);
                        }
                        //if (fight.DataDetails.FightPrecision < averagePrecision - 0.05)
                        //    continue;
                        if (fight.FightDuration < fastestKill.Item2)
                        {
                            fastestKill = new Tuple <string, int>(
                                PageUtility.CreateLink("FightOverview.aspx?Raid=" + fight.CacheRaid.UniqueRaidID
                                                       + "&Fight=" + fight.StartDateTime.ToString("ddHHmmss"), fight.FightDuration.ToString() + " seconds")
                                , fight.FightDuration);
                        }

                        var unitsData = fight.PlayerFightData;//.GetFilteredPlayerUnitsData(true, realmDB.RD_GetPlayerIdentifier);
                        Tuple <string, int> topDmg  = new Tuple <string, int>("", 0);
                        Tuple <string, int> topHeal = new Tuple <string, int>("", 0);
                        foreach (var unit in unitsData)
                        {
                            if (unit.Item2.Damage > topDmg.Item2)
                            {
                                var playerName = unit.Item1;
                                if (playerName == "Unknown")
                                {
                                    continue;
                                }
                                if (playerLimit != "null" && playerLimit != playerName)
                                {
                                    continue;
                                }
                                if (BossInformation.BossFights.ContainsKey(playerName) == true)
                                {
                                    continue;
                                }

                                var playerData = realmDB.RD_FindPlayer(playerName, fight);
                                if (playerData != null && (classLimits == null || classLimits.Contains(playerData.Character.Class)) &&
                                    (factionLimits == null || factionLimits.Contains(StaticValues.GetFaction(playerData.Character.Race))))
                                {
                                    topDmg = new Tuple <string, int>(unit.Item1, unit.Item2.Damage);
                                }
                            }
                            if (unit.Item2.EffectiveHeal > topHeal.Item2)
                            {
                                var playerName = unit.Item1;
                                if (playerName == "Unknown")
                                {
                                    continue;
                                }
                                if (playerLimit != "null" && playerLimit != playerName)
                                {
                                    continue;
                                }
                                if (BossInformation.BossFights.ContainsKey(playerName) == true)
                                {
                                    continue;
                                }

                                var playerData = realmDB.RD_FindPlayer(playerName, fight);
                                if (playerData != null && (classLimits == null || classLimits.Contains(playerData.Character.Class)) &&
                                    (factionLimits == null || factionLimits.Contains(StaticValues.GetFaction(playerData.Character.Race))))
                                {
                                    topHeal = new Tuple <string, int>(unit.Item1, unit.Item2.EffectiveHeal);
                                }
                            }
                        }
                        double topThisDPS = (double)topDmg.Item2 / (double)fight.FightDuration;
                        double topThisHPS = (double)topHeal.Item2 / (double)fight.FightDuration;
                        if (topThisDPS > topDPS.Item2)
                        {
                            topDPS = new Tuple <string, double>(PageUtility.CreateLink_RaidStats_Player(topDmg.Item1, realmDB.Realm
                                                                                                        , PageUtility.CreateColorCodedName(topDmg.Item1, realmDB.GetPlayer(topDmg.Item1).Character.Class))
                                                                + "(" + PageUtility.CreateLink("FightOverview.aspx?Raid=" + fight.CacheRaid.UniqueRaidID
                                                                                               + "&Fight=" + fight.StartDateTime.ToString("ddHHmmss")
                                                                                               , topThisDPS.ToStringDot("0.0")) + ")", topThisDPS);
                        }
                        if (topThisHPS > topHPS.Item2)
                        {
                            topHPS = new Tuple <string, double>(PageUtility.CreateLink_RaidStats_Player(topHeal.Item1, realmDB.Realm
                                                                                                        , PageUtility.CreateColorCodedName(topHeal.Item1, realmDB.GetPlayer(topHeal.Item1).Character.Class))
                                                                + "(" + PageUtility.CreateLink("FightOverview.aspx?Raid=" + fight.CacheRaid.UniqueRaidID
                                                                                               + "&Fight=" + fight.StartDateTime.ToString("ddHHmmss")
                                                                                               , topThisHPS.ToStringDot("0.0")) + ")", topThisHPS);
                        }
                    }
                    int killCount = bossFights.Count((_Value) => { return(_Value.AttemptType == VF_RDDatabase.AttemptType.KillAttempt); });

                    tableBody += PageUtility.CreateTableRow("", PageUtility.CreateTableColumn(PageUtility.CreateImage(StaticValues._RaidInstanceImages[boss.Value]) + boss.Value) +
                                                            PageUtility.CreateTableColumn(PageUtility.CreateLink("FightOverallOverview.aspx?FightName=" + boss.Key + (guildLimit != "null" ? "&Guild=" + guildLimit : "") + (playerLimit != "null" ? "&realm=" + StaticValues.ConvertRealmParam(realm) + "&PlayerLimit=" + playerLimit : ""), boss.Key)) +
                                                            PageUtility.CreateTableColumn(topDPS.Item1) +
                                                            PageUtility.CreateTableColumn(topHPS.Item1) +
                                                            PageUtility.CreateTableColumn(fastestKill.Item1) +
                                                            PageUtility.CreateTableColumn(killCount.ToString()));
                }
            }
            m_TableBodyHTML = new MvcHtmlString(tableBody);
        }