public static void WriteOldCSV(StreamWriter sw, string delimiter, ParsedLog log, Statistics statistics)
        {
            double   fightDuration  = (log.FightData.FightDuration) / 1000.0;
            TimeSpan duration       = TimeSpan.FromSeconds(fightDuration);
            String   durationString = duration.ToString("mm") + ":" + duration.ToString("ss");

            sw.Write("Group" + delimiter +
                     "Class" + delimiter +
                     "Character" + delimiter +
                     "Account Name" + delimiter +
                     "Boss DPS" + delimiter +
                     "Boss Physical" + delimiter +
                     "Boss Condi" + delimiter +
                     "All DPS" + delimiter +
                     "Quick" + delimiter +
                     "Alacrity" + delimiter +
                     "Might" + delimiter +
                     "Boss Team DPS" + delimiter +
                     "All Team DPS" + delimiter +
                     "Time" + delimiter +
                     "Cleave" + delimiter +
                     "Team Cleave");
            sw.Write("\r\n");

            int[] teamStats = { 0, 0, 0 };
            foreach (Player p in log.PlayerList)
            {
                Statistics.FinalDPS dps     = statistics.DpsAll[p][0];
                Statistics.FinalDPS dpsBoss = statistics.DpsBoss[log.Boss][p][0];
                teamStats[0] += dps.Dps;
                teamStats[1] += dpsBoss.Dps;
                teamStats[2] += dps.Dps - dpsBoss.Dps;
            }

            foreach (Player p in log.PlayerList)
            {
                Statistics.FinalDPS dpsBoss = statistics.DpsBoss[log.Boss][p][0];
                Statistics.FinalDPS dpsAll  = statistics.DpsAll[p][0];
                sw.Write(p.Group + delimiter +                // group
                         p.Prof + delimiter +                 // class
                         p.Character + delimiter +            // character
                         p.Account.Substring(1) + delimiter + // account
                         dpsBoss.Dps + delimiter +            // dps
                         dpsBoss.PowerDps + delimiter +       // physical
                         dpsBoss.CondiDps + delimiter +       // condi
                         dpsAll.Dps + delimiter);             // all dps

                Dictionary <long, Statistics.FinalBoonUptime> boons = statistics.SelfBoons[p][0];
                sw.Write(boons[1187].Uptime + delimiter +                  // Quickness
                         boons[30328].Uptime + delimiter +                 // Alacrity
                         boons[740].Uptime + delimiter);                   // Might

                sw.Write(teamStats[0] + delimiter                          // boss dps
                         + teamStats[1] + delimiter                        // all
                         + durationString + delimiter +                    // duration
                         (dpsAll.Dps - dpsBoss.Dps).ToString() + delimiter // cleave
                         + teamStats[2]);                                  // team cleave
                sw.Write("\r\n");
            }
        }
Beispiel #2
0
        //Creating CSV---------------------------------------------------------------------------------
        public void CreateCSV(StreamWriter sw, String delimiter)
        {
            double   fight_duration = (boss_data.getAwareDuration()) / 1000.0;
            TimeSpan duration       = TimeSpan.FromSeconds(fight_duration);
            String   durationString = duration.ToString("mm") + ":" + duration.ToString("ss");

            sw.Write("Group" + delimiter +
                     "Class" + delimiter +
                     "Character" + delimiter +
                     "Account Name" + delimiter +
                     "Boss DPS" + delimiter +
                     "Boss Physical" + delimiter +
                     "Boss Condi" + delimiter +
                     "All DPS" + delimiter +
                     "Quick" + delimiter +
                     "Alacrity" + delimiter +
                     "Might" + delimiter +
                     "Boss Team DPS" + delimiter +
                     "All Team DPS" + delimiter +
                     "Time" + delimiter +
                     "Cleave" + delimiter +
                     "Team Cleave");
            sw.Write("\r\n");

            int[] teamStats = { 0, 0, 0 };
            foreach (Player p in p_list)
            {
                Statistics.FinalDPS dps = statistics.dps[p][0];
                teamStats[0] += dps.bossDps;
                teamStats[1] += dps.allDps;
                teamStats[2] += dps.allDps - dps.bossDps;
            }

            foreach (Player p in p_list)
            {
                Statistics.FinalDPS dps = statistics.dps[p][0];
                sw.Write(p.getGroup() + delimiter +                // group
                         p.getProf() + delimiter +                 // class
                         p.getCharacter() + delimiter +            // character
                         p.getAccount().Substring(1) + delimiter + // account
                         dps.bossDps + delimiter +                 // dps
                         dps.bossPowerDps + delimiter +            // physical
                         dps.bossCondiDps + delimiter +            // condi
                         dps.allDps + delimiter);                  // all dps

                Dictionary <int, Statistics.FinalBoonUptime> boons = statistics.selfBoons[p][0];
                sw.Write(boons[1187].uptime + delimiter +                  // Quickness
                         boons[30328].uptime + delimiter +                 // Alacrity
                         boons[740].uptime + delimiter);                   // Might

                sw.Write(teamStats[0] + delimiter                          // boss dps
                         + teamStats[1] + delimiter                        // all
                         + durationString + delimiter +                    // duration
                         (dps.allDps - dps.bossDps).ToString() + delimiter // cleave
                         + teamStats[2]);                                  // team cleave
                sw.Write("\r\n");
            }
        }
Beispiel #3
0
 public JsonDPS(Statistics.FinalDPS stats)
 {
     Dps         = stats.Dps;
     Damage      = stats.Damage;
     CondiDps    = stats.CondiDps;
     CondiDamage = stats.CondiDamage;
     PowerDps    = stats.PowerDps;
     PowerDamage = stats.PowerDamage;
 }
Beispiel #4
0
        public static List <object> GetDPSStatData(Statistics.FinalDPS dpsAll)
        {
            List <object> data = new List <object>
            {
                dpsAll.Damage,
                dpsAll.PowerDamage,
                dpsAll.CondiDamage,
            };

            return(data);
        }
Beispiel #5
0
        private void CreateDPSTable(int phaseIndex)
        {
            PhaseData phase = _statistics.Phases[phaseIndex];

            WriteLine(new[] { "Sub Group", "Profession", "Role", "Name", "Account", "WepSet1_1", "WepSet1_2", "WepSet2_1", "WepSet2_2",
                              "Boss DPS", "Boss DMG", "Boss Power DPS", "Boss Power DMG", "Boss Condi DPS", "Boss Condi DMG",
                              "All DPS", "All DMG", "All Power DPS", "All Power DMG", "All Condi DPS", "All Condi DMG",
                              "Times Downed", "Time Died", "Percent Alive" });

            int count = 0;

            foreach (Player player in _log.PlayerList)
            {
                Statistics.FinalDPS      dps     = _statistics.DpsAll[player][phaseIndex];
                Statistics.FinalDefenses defense = _statistics.Defenses[player][phaseIndex];
                Statistics.FinalDPS      dpsBoss = _statistics.DpsTarget[_log.LegacyTarget][player][phaseIndex];
                string deathString   = defense.DeadCount.ToString();
                string deadthTooltip = "";
                if (defense.DeadCount > 0)
                {
                    TimeSpan deathDuration = TimeSpan.FromMilliseconds(defense.DeadDuration);
                    deadthTooltip = deathDuration.TotalSeconds + " seconds dead, " + (100.0 - Math.Round((deathDuration.TotalMilliseconds / phase.GetDuration()) * 100, 1)) + "% Alive";
                }
                string[] wep   = player.GetWeaponsArray(_log);
                string   build = "";
                if (player.Condition > 0)
                {
                    build += " Condi:" + player.Condition;
                }
                if (player.Concentration > 0)
                {
                    build += " Concentration:" + player.Concentration;
                }
                if (player.Healing > 0)
                {
                    build += " Healing:" + player.Healing;
                }
                if (player.Toughness > 0)
                {
                    build += " Toughness:" + player.Toughness;
                }
                WriteLine(new [] { player.Group.ToString(), player.Prof, build, player.Character, player.Account.TrimStart(':'), wep[0], wep[1], wep[2], wep[3],
                                   dpsBoss.Dps.ToString(), dpsBoss.Damage.ToString(), dpsBoss.PowerDps.ToString(), dpsBoss.PowerDamage.ToString(), dpsBoss.CondiDps.ToString(), dpsBoss.CondiDamage.ToString(),
                                   dps.Dps.ToString(), dps.Damage.ToString(), dps.PowerDps.ToString(), dps.PowerDamage.ToString(), dps.CondiDps.ToString(), dps.CondiDamage.ToString(),
                                   defense.DownCount.ToString(), deathString, deadthTooltip });
                count++;
            }
            while (count < 15)//so each graph has equal spacing
            {
                NewLine();
                count++;
            }
        }
        private void calculateDPS()
        {
            foreach (Player player in log.getPlayerList())
            {
                Statistics.FinalDPS[] phaseDps = new Statistics.FinalDPS[phases.Count];
                for (int phaseIndex = 0; phaseIndex < phases.Count; phaseIndex++)
                {
                    phaseDps[phaseIndex] = getFinalDPS(player, phaseIndex);
                }

                statistics.dps[player] = phaseDps;
            }

            Statistics.FinalDPS[] phaseBossDps = new Statistics.FinalDPS[phases.Count];
            for (int phaseIndex = 0; phaseIndex < phases.Count; phaseIndex++)
            {
                phaseBossDps[phaseIndex] = getFinalDPS(log.getBoss(), phaseIndex);
            }

            statistics.bossDps = phaseBossDps;
        }
        private void CreateBossDMGStatsTable(int phaseIndex)
        {
            //generate dmgstats table=
            WriteLine(new [] { "Sub Group", "Profession", "Name",
                               "Critical%", "Critical hits", "Critical DMG",
                               "Scholar%", "Scholar hits", "Scholar DMG", "Scholar % increase",
                               "Moving%", "Moving Hits", "Moving DMG", "Moving % increase",
                               "Flanking%", "Flanking hits",
                               "Glancing%", "Glancing Hits",
                               "Blind%", "Blind Hits",
                               "Total Hits",
                               "Hits to Interupt", "Hits Invulned", "Time wasted", "Time saved", "Weapon Swaps" });
            int count = 0;

            foreach (Player player in _log.PlayerList)
            {
                Statistics.FinalDPS      dpsBoss   = _statistics.DpsBoss[_log.Boss][player][phaseIndex];
                Statistics.FinalStatsAll stats     = _statistics.StatsAll[player][phaseIndex];
                Statistics.FinalStats    statsBoss = _statistics.StatsBoss[_log.Boss][player][phaseIndex];

                WriteLine(new [] { player.Group.ToString(), player.Prof, player.Character,
                                   Math.Round((Double)(statsBoss.CriticalRate) / statsBoss.CritablePowerLoopCount * 100, 1).ToString(), statsBoss.CriticalRate.ToString(), statsBoss.CriticalDmg.ToString(),
                                   Math.Round((Double)(statsBoss.ScholarRate) / statsBoss.PowerLoopCount * 100, 1).ToString(), statsBoss.ScholarRate.ToString(), statsBoss.ScholarDmg.ToString(), Math.Round(100.0 * (dpsBoss.PlayerPowerDamage / (Double)(dpsBoss.PlayerPowerDamage - statsBoss.ScholarDmg) - 1.0), 3).ToString(),
                                   Math.Round((Double)(statsBoss.MovingRate) / statsBoss.PowerLoopCount * 100, 1).ToString(), statsBoss.MovingRate.ToString(), statsBoss.MovingDamage.ToString(), Math.Round(100.0 * (dpsBoss.PlayerPowerDamage / (Double)(dpsBoss.PlayerPowerDamage - statsBoss.MovingDamage) - 1.0), 3).ToString(),
                                   Math.Round(statsBoss.FlankingRate / (Double)statsBoss.PowerLoopCount * 100, 1).ToString(), statsBoss.FlankingRate.ToString(),
                                   Math.Round(statsBoss.GlanceRate / (Double)statsBoss.PowerLoopCount * 100, 1).ToString(), statsBoss.GlanceRate.ToString(),
                                   Math.Round(statsBoss.Missed / (Double)statsBoss.PowerLoopCount * 100, 1).ToString(), statsBoss.Missed.ToString(),
                                   statsBoss.PowerLoopCount.ToString(),
                                   statsBoss.Interrupts.ToString(), statsBoss.Invulned.ToString(), stats.TimeWasted.ToString(), stats.TimeSaved.ToString(), stats.SwapCount.ToString() });
                count++;
            }
            while (count < 15)//so each graph has equal spacing
            {
                NewLine();
                count++;
            }
        }
        private void CreateDPSTable(int phaseIndex)
        {
            PhaseData phase = _statistics.Phases[phaseIndex];

            WriteLine(new[] { "Sub Group", "Profession", "Role", "Name", "Account", "WepSet1_1", "WepSet1_2", "WepSet2_1", "WepSet2_2",
                              "Boss DPS", "Boss DMG", "Boss Power DPS", "Boss Power DMG", "Boss Condi DPS", "Boss Condi DMG",
                              "All DPS", "All DMG", "All Power DPS", "All Power DMG", "All Condi DPS", "All Condi DMG",
                              "Times Downed", "Time Died", "Percent Alive" });

            int count = 0;

            foreach (Player player in _log.PlayerList)
            {
                Statistics.FinalDPS      dps       = _statistics.DpsAll[player][phaseIndex];
                Statistics.FinalDPS      dpsBoss   = _statistics.DpsBoss[_log.Boss][player][phaseIndex];
                Statistics.FinalStatsAll stats     = _statistics.StatsAll[player][phaseIndex];
                Statistics.FinalStats    statsBoss = _statistics.StatsBoss[_log.Boss][player][phaseIndex];
                string deathString   = "";
                string deadthTooltip = "";
                if (stats.Died != 0.0)
                {
                    if (stats.Died < 0)
                    {
                        deathString = -stats.Died + " time(s)";
                    }
                    else
                    {
                        TimeSpan timedead = TimeSpan.FromMilliseconds(stats.Died);
                        deathString   = timedead.Minutes + " m " + timedead.Seconds + " s";
                        deadthTooltip = Math.Round((timedead.TotalMilliseconds / phase.GetDuration()) * 100, 1) + "%";
                    }
                }
                else
                {
                    deadthTooltip = "Never died";
                }
                string[] wep   = player.GetWeaponsArray(_log);
                string   build = "";
                if (player.Condition > 0)
                {
                    build += " Condi:" + player.Condition;
                }
                if (player.Concentration > 0)
                {
                    build += " Concentration:" + player.Concentration;
                }
                if (player.Healing > 0)
                {
                    build += " Healing:" + player.Healing;
                }
                if (player.Toughness > 0)
                {
                    build += " Toughness:" + player.Toughness;
                }
                WriteLine(new [] { player.Group.ToString(), player.Prof, build, player.Character, player.Account.TrimStart(':'), wep[0], wep[1], wep[2], wep[3],
                                   dpsBoss.Dps.ToString(), dpsBoss.Damage.ToString(), dpsBoss.PowerDps.ToString(), dpsBoss.PowerDamage.ToString(), dpsBoss.CondiDps.ToString(), dpsBoss.CondiDamage.ToString(),
                                   dps.Dps.ToString(), dps.Damage.ToString(), dps.PowerDps.ToString(), dps.PowerDamage.ToString(), dps.CondiDps.ToString(), dps.CondiDamage.ToString(),
                                   stats.DownCount.ToString(), deathString, deadthTooltip });
                count++;
            }
            while (count < 15)//so each graph has equal spacing
            {
                NewLine();
                count++;
            }
        }
        private Statistics.FinalDPS getFinalDPS(AbstractPlayer player, int phaseIndex)
        {
            Statistics.FinalDPS final = new Statistics.FinalDPS();

            PhaseData phase = phases[phaseIndex];

            double phaseDuration = (phase.getDuration()) / 1000.0;

            double damage = 0.0;
            double dps    = 0.0;

            // All DPS
            damage = player.getDamageLogs(0, log, phase.getStart(),
                                          phase.getEnd())
                     .Sum(x => x.getDamage());
            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }

            final.allDps    = (int)dps;
            final.allDamage = (int)damage;

            // All Condi DPS
            damage = player.getDamageLogs(0, log, phase.getStart(),
                                          phase.getEnd())
                     .Where(x => x.isCondi() > 0).Sum(x => x.getDamage());
            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }

            final.allCondiDps    = (int)dps;
            final.allCondiDamage = (int)damage;

            // All Power DPS
            damage = final.allDamage - damage;
            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }

            final.allPowerDps    = (int)dps;
            final.allPowerDamage = (int)damage;

            // Boss DPS
            damage = player.getDamageLogs(log.getBossData().getInstid(), log,
                                          phase.getStart(), phase.getEnd()).Sum(x => x.getDamage());
            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }

            final.bossDps    = (int)dps;
            final.bossDamage = (int)damage;


            // Boss Condi DPS
            damage = player.getDamageLogs(log.getBossData().getInstid(), log,
                                          phase.getStart(), phase.getEnd()).Where(x => x.isCondi() > 0).Sum(x => x.getDamage());
            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }

            final.bossCondiDps    = (int)dps;
            final.bossCondiDamage = (int)dps;

            // Boss Power DPS
            damage = final.bossDamage - damage;
            if (phaseDuration > 0)
            {
                dps = damage / phaseDuration;
            }

            final.bossPowerDps    = (int)dps;
            final.bossPowerDamage = (int)damage;

            return(final);
        }