public JsonLog(ParsedLog log, string[] uploadLinks) { // log.UpdateProgressWithCancellationCheck("Raw Format: Building Meta Data"); TriggerID = log.FightData.TriggerID; FightName = log.FightData.Name; FightIcon = log.FightData.Logic.Icon; EliteInsightsVersion = Application.ProductVersion; ArcVersion = log.LogData.BuildVersion; RecordedBy = log.LogData.PoVName; TimeStart = log.LogData.LogStart; TimeEnd = log.LogData.LogEnd; TimeStartStd = log.LogData.LogStartStd; TimeEndStd = log.LogData.LogEndStd; Duration = log.FightData.DurationString; Success = log.FightData.Success; GW2Build = log.LogData.GW2Version; UploadLinks = uploadLinks; Language = log.LogData.Language; LanguageID = (byte)log.LogData.LanguageID; IsCM = log.FightData.IsCM; // log.UpdateProgressWithCancellationCheck("Raw Format: Building Mechanics"); MechanicData mechanicData = log.MechanicData; var mechanicLogs = new List <MechanicEvent>(); foreach (List <MechanicEvent> mLog in mechanicData.GetAllMechanics(log)) { mechanicLogs.AddRange(mLog); } if (mechanicLogs.Any()) { Mechanics = GetJsonMechanicsList(mechanicLogs); } // log.UpdateProgressWithCancellationCheck("Raw Format: Building Phases"); Phases = log.FightData.GetPhases(log).Select(x => new JsonPhase(x, log)).ToList(); // log.UpdateProgressWithCancellationCheck("Raw Format: Building Targets"); Targets = log.FightData.Logic.Targets.Select(x => new JsonNPC(x, log, SkillMap, BuffMap)).ToList(); // log.UpdateProgressWithCancellationCheck("Raw Format: Building Players"); Players = log.PlayerList.Select(x => new JsonPlayer(x, log, SkillMap, BuffMap, DamageModMap, PersonalBuffs)).ToList(); }
private void SetMechanics(JsonLog log) { MechanicData mechanicData = _log.MechanicData; var mechanicLogs = new List <MechanicEvent>(); foreach (var mLog in mechanicData.GetAllMechanics(_log)) { mechanicLogs.AddRange(mLog); } if (mechanicLogs.Any()) { log.Mechanics = new List <JsonMechanics>(); Dictionary <string, List <JsonMechanic> > dict = new Dictionary <string, List <JsonMechanic> >(); foreach (MechanicEvent ml in mechanicLogs) { JsonMechanic mech = new JsonMechanic { Time = ml.Time, Actor = ml.Actor.Character }; if (dict.TryGetValue(ml.InGameName, out var list)) { list.Add(mech); } else { dict[ml.InGameName] = new List <JsonMechanic>() { mech }; } } foreach (var pair in dict) { log.Mechanics.Add(new JsonMechanics() { Name = pair.Key, MechanicsData = pair.Value }); } } }
private void CreateMechList() { MechanicData mData = _log.MechanicData; var mLogs = new List <MechanicEvent>(); foreach (List <MechanicEvent> mLs in mData.GetAllMechanics(_log)) { mLogs.AddRange(mLs); } mLogs = mLogs.OrderBy(x => x.Time).ToList(); int count = 0; WriteCell("Time"); foreach (MechanicEvent m in mLogs) { WriteCell((m.Time / 1000.0).ToString()); } NewLine(); count++; WriteCell("Player"); foreach (MechanicEvent m in mLogs) { WriteCell(m.Actor.Character); } NewLine(); count++; WriteCell("Mechanic"); foreach (MechanicEvent m in mLogs) { WriteCell("\"" + m.Description + "\""); } NewLine(); count++; while (count < 15)//so each graph has equal spacing { NewLine(); count++; } }
public static JsonLog BuildJsonLog(ParsedEvtcLog log, RawFormatSettings settings, Version parserVersion, string[] uploadLinks) { var jsonLog = new JsonLog(); // log.UpdateProgressWithCancellationCheck("Raw Format: Building Meta Data"); jsonLog.TriggerID = log.FightData.TriggerID; jsonLog.FightName = log.FightData.FightName; jsonLog.FightIcon = log.FightData.Logic.Icon; jsonLog.EliteInsightsVersion = parserVersion.ToString(); jsonLog.ArcVersion = log.LogData.ArcVersion; jsonLog.RecordedBy = log.LogData.PoVName; jsonLog.TimeStart = log.LogData.LogStart; jsonLog.TimeEnd = log.LogData.LogEnd; jsonLog.TimeStartStd = log.LogData.LogStartStd; jsonLog.TimeEndStd = log.LogData.LogEndStd; jsonLog.Duration = log.FightData.DurationString; jsonLog.Success = log.FightData.Success; jsonLog.GW2Build = log.LogData.GW2Build; jsonLog.UploadLinks = uploadLinks; jsonLog.Language = log.LogData.Language; jsonLog.LanguageID = (byte)log.LogData.LanguageID; jsonLog.IsCM = log.FightData.IsCM; var personalBuffs = new Dictionary <string, HashSet <long> >(); var skillMap = new Dictionary <string, SkillDesc>(); var buffMap = new Dictionary <string, BuffDesc>(); var damageModMap = new Dictionary <string, DamageModDesc>(); if (log.StatisticsHelper.PresentFractalInstabilities.Any()) { var presentFractalInstabilities = new List <long>(); foreach (Buff fractalInstab in log.StatisticsHelper.PresentFractalInstabilities) { presentFractalInstabilities.Add(fractalInstab.ID); if (!buffMap.ContainsKey("b" + fractalInstab.ID)) { buffMap["b" + fractalInstab.ID] = BuildBuffDesc(fractalInstab, log); } } jsonLog.PresentFractalInstabilities = presentFractalInstabilities; } // log.UpdateProgressWithCancellationCheck("Raw Format: Building Mechanics"); MechanicData mechanicData = log.MechanicData; var mechanicLogs = new List <MechanicEvent>(); foreach (List <MechanicEvent> mLog in mechanicData.GetAllMechanics(log)) { mechanicLogs.AddRange(mLog); } if (mechanicLogs.Any()) { jsonLog.Mechanics = JsonMechanicsBuilder.GetJsonMechanicsList(mechanicLogs); } // log.UpdateProgressWithCancellationCheck("Raw Format: Building Phases"); jsonLog.Phases = log.FightData.GetNonDummyPhases(log).Select(x => JsonPhaseBuilder.BuildJsonPhase(x, log)).ToList(); // log.UpdateProgressWithCancellationCheck("Raw Format: Building Targets"); jsonLog.Targets = log.FightData.Logic.Targets.Select(x => JsonNPCBuilder.BuildJsonNPC(x, log, settings, skillMap, buffMap)).ToList(); // log.UpdateProgressWithCancellationCheck("Raw Format: Building Players"); jsonLog.Players = log.Friendlies.Select(x => JsonPlayerBuilder.BuildJsonPlayer(x, log, settings, skillMap, buffMap, damageModMap, personalBuffs)).ToList(); // if (log.LogData.LogErrors.Any()) { jsonLog.LogErrors = new List <string>(log.LogData.LogErrors); } if (log.LogData.UsedExtensions.Any()) { var usedExtensions = new List <ExtensionDesc>(); foreach (AbstractExtensionHandler extension in log.LogData.UsedExtensions) { var set = new HashSet <string>(); if (log.LogData.PoV != null) { set.Add(log.FindActor(log.LogData.PoV).Character); foreach (AgentItem agent in extension.RunningExtension) { set.Add(log.FindActor(agent).Character); } } usedExtensions.Add(new ExtensionDesc() { Name = extension.Name, Version = extension.Version, Signature = extension.Signature, Revision = extension.Revision, RunningExtension = set.ToList() }); } jsonLog.UsedExtensions = usedExtensions; } // jsonLog.PersonalBuffs = personalBuffs.ToDictionary(x => x.Key, x => (IReadOnlyCollection <long>)x.Value); jsonLog.SkillMap = skillMap; jsonLog.BuffMap = buffMap; jsonLog.DamageModMap = damageModMap; // if (log.CanCombatReplay) { jsonLog.CombatReplayMetaData = JsonCombatReplayMetaDataBuilder.BuildJsonCombatReplayMetaData(log, settings); } return(jsonLog); }
internal JsonLog(ParsedEvtcLog log, RawFormatSettings settings, string[] uploadLinks) { // log.UpdateProgressWithCancellationCheck("Raw Format: Building Meta Data"); TriggerID = log.FightData.TriggerID; FightName = log.FightData.GetFightName(log); FightIcon = log.FightData.Logic.Icon; EliteInsightsVersion = log.ParserVersion.ToString(); ArcVersion = log.LogData.ArcVersion; RecordedBy = log.LogData.PoVName; TimeStart = log.LogData.LogStart; TimeEnd = log.LogData.LogEnd; TimeStartStd = log.LogData.LogStartStd; TimeEndStd = log.LogData.LogEndStd; Duration = log.FightData.DurationString; Success = log.FightData.Success; GW2Build = log.LogData.GW2Build; UploadLinks = uploadLinks; Language = log.LogData.Language; LanguageID = (byte)log.LogData.LanguageID; IsCM = log.FightData.IsCM; if (log.Statistics.PresentFractalInstabilities.Any()) { PresentFractalInstabilities = new List <long>(); foreach (Buff fractalInstab in log.Statistics.PresentFractalInstabilities) { PresentFractalInstabilities.Add(fractalInstab.ID); if (!BuffMap.ContainsKey("b" + fractalInstab.ID)) { BuffMap["b" + fractalInstab.ID] = new BuffDesc(fractalInstab, log); } } } // log.UpdateProgressWithCancellationCheck("Raw Format: Building Mechanics"); MechanicData mechanicData = log.MechanicData; var mechanicLogs = new List <MechanicEvent>(); foreach (List <MechanicEvent> mLog in mechanicData.GetAllMechanics(log)) { mechanicLogs.AddRange(mLog); } if (mechanicLogs.Any()) { Mechanics = GetJsonMechanicsList(mechanicLogs); } // log.UpdateProgressWithCancellationCheck("Raw Format: Building Phases"); Phases = log.FightData.GetPhases(log).Select(x => new JsonPhase(x, log)).ToList(); // log.UpdateProgressWithCancellationCheck("Raw Format: Building Targets"); Targets = log.FightData.Logic.Targets.Select(x => new JsonNPC(x, log, settings, SkillMap, BuffMap)).ToList(); // log.UpdateProgressWithCancellationCheck("Raw Format: Building Players"); Players = log.PlayerList.Select(x => new JsonPlayer(x, log, settings, SkillMap, BuffMap, DamageModMap, PersonalBuffs)).ToList(); // if (log.LogData.LogErrors.Count > 0) { LogErrors = new List <string>(log.LogData.LogErrors); } }