public static string CreateProgressStr(System.Web.UI.Page _Page, VF_RPDatabase.GuildSummary _Guild, WowRealm _Realm, out int _RetProgressComparisonValue) { string mcString = ""; string onyString = ""; string bwlString = ""; string zgString = ""; string aq20String = ""; string aq40String = ""; string naxxString = ""; string wbString = ""; #if USE_RAIDSTATS_FOR_PROGRESS_STR _RetProgressComparisonValue = 0; VF_RDDatabase.GroupInfo guildRaidProgressInfo = null; var groupSummaryDB = Hidden.ApplicationInstance.Instance.GetGroupSummaryDatabase(); if (groupSummaryDB != null) { guildRaidProgressInfo = groupSummaryDB.GetGroupInfo(_Realm, _Guild.GuildName); } if (guildRaidProgressInfo != null) { try { Dictionary <WowBoss, int> m_BestBossKillTimes = new Dictionary <WowBoss, int>(); for (int i = (int)WowBoss.MCFirst; i <= (int)WowBoss.MCLast; ++i) { m_BestBossKillTimes.Add((WowBoss)i, int.MaxValue); } for (int i = (int)WowBoss.OnyFirst; i <= (int)WowBoss.OnyLast; ++i) { m_BestBossKillTimes.Add((WowBoss)i, int.MaxValue); } for (int i = (int)WowBoss.BWLFirst; i <= (int)WowBoss.BWLLast; ++i) { m_BestBossKillTimes.Add((WowBoss)i, int.MaxValue); } for (int i = (int)WowBoss.ZGFirst; i <= (int)WowBoss.ZGLast; ++i) { m_BestBossKillTimes.Add((WowBoss)i, int.MaxValue); } for (int i = (int)WowBoss.AQ20First; i <= (int)WowBoss.AQ20Last; ++i) { m_BestBossKillTimes.Add((WowBoss)i, int.MaxValue); } for (int i = (int)WowBoss.AQ40First; i <= (int)WowBoss.AQ40Last; ++i) { m_BestBossKillTimes.Add((WowBoss)i, int.MaxValue); } for (int i = (int)WowBoss.NaxxFirst; i <= (int)WowBoss.NaxxLast; ++i) { m_BestBossKillTimes.Add((WowBoss)i, int.MaxValue); } for (int i = (int)WowBoss.WBFirst; i <= (int)WowBoss.WBLast; ++i) { m_BestBossKillTimes.Add((WowBoss)i, int.MaxValue); } foreach (var bossKill in guildRaidProgressInfo.FastestBossKills) { if (bossKill.Value.Count > 0) { var wowBoss = StaticValues.ConvertWowBoss(bossKill.Key); int fastestKillTime = int.MaxValue; foreach (var killInfo in bossKill.Value) { int currKillTime = killInfo.GetKillTimeSeconds(); if (currKillTime < fastestKillTime) { fastestKillTime = currKillTime; } } if (wowBoss == WowBoss.Renataki_Of_The_Thousand_Blades || wowBoss == WowBoss.Wushoolay_the_Storm_Witch || wowBoss == WowBoss.Gri_Lek_Of_The_Iron_Blood || wowBoss == WowBoss.Hazzarah_The_Dreamweaver) { wowBoss = WowBoss.Edge_Of_Madness; } if (m_BestBossKillTimes.ContainsKey(wowBoss) == true) { if (fastestKillTime < m_BestBossKillTimes[wowBoss]) { m_BestBossKillTimes[wowBoss] = fastestKillTime; } } else { m_BestBossKillTimes.Add(wowBoss, fastestKillTime); } } } for (int i = (int)WowBoss.MCFirst; i <= (int)WowBoss.MCLast; ++i) { mcString += ((m_BestBossKillTimes[(WowBoss)i] < int.MaxValue) ? "1" : "0"); } for (int i = (int)WowBoss.OnyFirst; i <= (int)WowBoss.OnyLast; ++i) { onyString += ((m_BestBossKillTimes[(WowBoss)i] < int.MaxValue) ? "1" : "0"); } for (int i = (int)WowBoss.BWLFirst; i <= (int)WowBoss.BWLLast; ++i) { bwlString += ((m_BestBossKillTimes[(WowBoss)i] < int.MaxValue) ? "1" : "0"); } for (int i = (int)WowBoss.ZGFirst; i <= (int)WowBoss.ZGLast; ++i) { zgString += ((m_BestBossKillTimes[(WowBoss)i] < int.MaxValue) ? "1" : "0"); } for (int i = (int)WowBoss.AQ20First; i <= (int)WowBoss.AQ20Last; ++i) { aq20String += ((m_BestBossKillTimes[(WowBoss)i] < int.MaxValue) ? "1" : "0"); } for (int i = (int)WowBoss.AQ40First; i <= (int)WowBoss.AQ40Last; ++i) { aq40String += ((m_BestBossKillTimes[(WowBoss)i] < int.MaxValue) ? "1" : "0"); } for (int i = (int)WowBoss.NaxxFirst; i <= (int)WowBoss.NaxxLast; ++i) { naxxString += ((m_BestBossKillTimes[(WowBoss)i] < int.MaxValue) ? "1" : "0"); } for (int i = (int)WowBoss.WBFirst; i <= (int)WowBoss.WBLast; ++i) { wbString += ((m_BestBossKillTimes[(WowBoss)i] < int.MaxValue) ? "1" : "0"); } } catch (Exception ex) { Logger.LogException(ex); } } else #endif { var wowVersion = StaticValues.GetWowVersion(_Realm); Dictionary <WowBoss, int> m_MembersWithBossItems = new Dictionary <WowBoss, int>(); for (int i = (int)WowBoss.MCFirst; i <= (int)WowBoss.MCLast; ++i) { m_MembersWithBossItems.Add((WowBoss)i, 0); } for (int i = (int)WowBoss.OnyFirst; i <= (int)WowBoss.OnyLast; ++i) { m_MembersWithBossItems.Add((WowBoss)i, 0); } for (int i = (int)WowBoss.BWLFirst; i <= (int)WowBoss.BWLLast; ++i) { m_MembersWithBossItems.Add((WowBoss)i, 0); } for (int i = (int)WowBoss.ZGFirst; i <= (int)WowBoss.ZGLast; ++i) { m_MembersWithBossItems.Add((WowBoss)i, 0); } for (int i = (int)WowBoss.AQ20First; i <= (int)WowBoss.AQ20Last; ++i) { m_MembersWithBossItems.Add((WowBoss)i, 0); } for (int i = (int)WowBoss.AQ40First; i <= (int)WowBoss.AQ40Last; ++i) { m_MembersWithBossItems.Add((WowBoss)i, 0); } for (int i = (int)WowBoss.NaxxFirst; i <= (int)WowBoss.NaxxLast; ++i) { m_MembersWithBossItems.Add((WowBoss)i, 0); } for (int i = (int)WowBoss.WBFirst; i <= (int)WowBoss.WBLast; ++i) { m_MembersWithBossItems.Add((WowBoss)i, 0); } var itemDropdatabase = DatabaseAccess.GetItemDropDatabase(_Page, wowVersion, NotLoadedDecision.RedirectAndWait).GetDatabase(); var playersHistory = DatabaseAccess._GetRealmPlayersHistory(_Page, _Realm, NotLoadedDecision.RedirectAndWait); foreach (var guildPlayer in _Guild.Players) { if (guildPlayer.Value.IsInGuild == false) { continue; } List <int> ignoredItems = new List <int>(); VF_RealmPlayersDatabase.PlayerData.PlayerHistory playerHistory = null; if (playersHistory.TryGetValue(guildPlayer.Value.PlayerName, out playerHistory) == true) { try { if (playerHistory.HaveValidHistory() == false) { continue; } foreach (var gear in playerHistory.GearHistory) { bool isInGuild = (playerHistory.GetGuildItemAtTime(gear.Uploader.GetTime()).Data.GuildName == _Guild.GuildName); foreach (var item in gear.Data.Items) { if (ignoredItems.Contains(item.Value.ItemID)) { continue; } if (isInGuild == false) { ignoredItems.Add(item.Value.ItemID); continue; } List <VF_RealmPlayersDatabase.ItemDropDataItem> itemDropDataList = null; if (itemDropdatabase.TryGetValue(item.Value.ItemID, out itemDropDataList) == true) { foreach (var itemDropData in itemDropDataList) { WowBoss itemBoss = itemDropData.m_Boss; if (itemBoss == WowBoss.Renataki_Of_The_Thousand_Blades || itemBoss == WowBoss.Wushoolay_the_Storm_Witch || itemBoss == WowBoss.Gri_Lek_Of_The_Iron_Blood || itemBoss == WowBoss.Hazzarah_The_Dreamweaver) { itemBoss = WowBoss.Edge_Of_Madness; } if (m_MembersWithBossItems.ContainsKey(itemBoss)) { m_MembersWithBossItems[itemBoss] = m_MembersWithBossItems[itemBoss] + 1; ignoredItems.Add(item.Value.ItemID); } /*if (itemBoss >= WowBoss.MCFirst && itemBoss <= WowBoss.MCLast) * {} * else if (itemBoss >= WowBoss.OnyFirst && itemBoss <= WowBoss.OnyLast) * {} * else if (itemBoss >= WowBoss.BWLFirst && itemBoss <= WowBoss.BWLLast) * {} * else if (itemBoss >= WowBoss.ZGFirst && itemBoss <= WowBoss.ZGLast) * {} * else if (itemBoss >= WowBoss.AQ20First && itemBoss <= WowBoss.AQ20Last) * {} * else if (itemBoss >= WowBoss.AQ40First && itemBoss <= WowBoss.AQ40Last) * {} * else if (itemBoss >= WowBoss.NaxxFirst && itemBoss <= WowBoss.NaxxLast) * {}*/ } } } } } catch (Exception ex) { Logger.ConsoleWriteLine("GuildList.aspx could not look through gear for player \"" + guildPlayer.Value.PlayerName + "\" Exception:" + ex.ToString(), ConsoleColor.Red); } } } for (int i = (int)WowBoss.MCFirst; i <= (int)WowBoss.MCLast; ++i) { mcString += ((m_MembersWithBossItems[(WowBoss)i] >= 2) ? "1" : "0"); } for (int i = (int)WowBoss.OnyFirst; i <= (int)WowBoss.OnyLast; ++i) { onyString += ((m_MembersWithBossItems[(WowBoss)i] >= 2) ? "1" : "0"); } for (int i = (int)WowBoss.BWLFirst; i <= (int)WowBoss.BWLLast; ++i) { bwlString += ((m_MembersWithBossItems[(WowBoss)i] >= 2) ? "1" : "0"); } for (int i = (int)WowBoss.ZGFirst; i <= (int)WowBoss.ZGLast; ++i) { zgString += ((m_MembersWithBossItems[(WowBoss)i] >= 2) ? "1" : "0"); } for (int i = (int)WowBoss.AQ20First; i <= (int)WowBoss.AQ20Last; ++i) { aq20String += ((m_MembersWithBossItems[(WowBoss)i] >= 2) ? "1" : "0"); } for (int i = (int)WowBoss.AQ40First; i <= (int)WowBoss.AQ40Last; ++i) { aq40String += ((m_MembersWithBossItems[(WowBoss)i] >= 2) ? "1" : "0"); } for (int i = (int)WowBoss.NaxxFirst; i <= (int)WowBoss.NaxxLast; ++i) { naxxString += ((m_MembersWithBossItems[(WowBoss)i] >= 2) ? "1" : "0"); } for (int i = (int)WowBoss.WBFirst; i <= (int)WowBoss.WBLast; ++i) { wbString += ((m_MembersWithBossItems[(WowBoss)i] >= 2) ? "1" : "0"); } } string oldMCstring = mcString; string oldBWLstring = bwlString; string oldZGstring = zgString; string oldAQ20string = aq20String; string oldAQ40string = aq40String; string oldNaxxstring = naxxString; if (mcString[9] == '1') //If Ragnaros is killed, everything is killed { mcString = "1111111111"; } else if (mcString[8] == '1') //If Majordomo is killed, everything up to Majordomo is killed { mcString = "1111111110"; } if (bwlString[7] == '1') //If Nefarian is killed, everything is killed { bwlString = "11111111"; } else if (bwlString.LastIndexOf('1') != -1)//If boss X is killed, everything up to boss X is killed { bwlString = new string('1', bwlString.LastIndexOf('1') + 1) + bwlString.Substring(bwlString.LastIndexOf('1') + 1); } if (zgString[5] == '1') //If Hakkar is killed, everything except optionals is killed { zgString = "111111" + zgString.Substring(6); } if (aq20String[2] == '1') //If Ossirian is killed, everything except optionals is killed { aq20String = "111" + aq20String.Substring(3); } if (aq40String[5] == '1') //If C'thun is killed, everything except optionals is killed { aq40String = "111111" + aq40String.Substring(6); } else if (aq40String.LastIndexOf('1', 5, 6) != -1) //If boss X is killed, everything up to boss X is killed { aq40String = new string('1', aq40String.LastIndexOf('1', 5, 6) + 1) + aq40String.Substring(aq40String.LastIndexOf('1', 5, 6) + 1); } if (naxxString[14] == '1') { naxxString = "111111111111111"; } else if (naxxString[13] == '1') { naxxString = "111111111111110"; } //if (oldMCstring != mcString) //{ // //take notes // System.Diagnostics.Debugger.Break(); //} //if (oldBWLstring != bwlString) //{ // //take notes // System.Diagnostics.Debugger.Break(); //} //if (oldZGstring != zgString) //{ // //take notes // System.Diagnostics.Debugger.Break(); //} //if (oldAQ20string != aq20String) //{ // //take notes // System.Diagnostics.Debugger.Break(); //} //if (oldAQ40string != aq40String) //{ // //take notes // System.Diagnostics.Debugger.Break(); //} //if (oldNaxxstring != naxxString) //{ // //take notes // System.Diagnostics.Debugger.Break(); //} _RetProgressComparisonValue = GuildProgress.CreateProgressInt( zgString.Count(_Char => _Char == '1'), aq20String.Count(_Char => _Char == '1'), mcString.Count(_Char => _Char == '1'), onyString.Count(_Char => _Char == '1'), wbString.Count(_Char => _Char == '1'), bwlString.Count(_Char => _Char == '1'), aq40String.Count(_Char => _Char == '1'), naxxString.Count(_Char => _Char == '1') ); return("guildProgress['" + _Guild.GuildName.Replace(' ', '_') + "'] = { MC: '" + mcString + "', Ony: '" + onyString + "', BWL: '" + bwlString + "', ZG: '" + zgString + "', AQ20: '" + aq20String + "', AQ40: '" + aq40String + "', Naxx: '" + naxxString + "', WB: '" + wbString + "' };"); }