From e493d66b1d4a2cefe52b8224cb5fc01bab7b4253 Mon Sep 17 00:00:00 2001 From: shalzuth Date: Mon, 25 Jul 2022 21:49:38 -0700 Subject: [PATCH] fix #55 --- LostArkLogger/Parser.cs | 50 ++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/LostArkLogger/Parser.cs b/LostArkLogger/Parser.cs index 8b1f6f01..42369fc6 100644 --- a/LostArkLogger/Parser.cs +++ b/LostArkLogger/Parser.cs @@ -343,34 +343,38 @@ void ProcessPacket(List data) } } } - currentEncounter.End = DateTime.Now; - currentEncounter = new Encounter(); - currentEncounter.Entities = Encounters.Last().Entities; // preserve entities - if (WasWipe || Encounters.Last().AfterWipe) + Task.Run(() => { + Task.Delay(500); // wait 500ms to capture any final damage packets + currentEncounter.End = DateTime.Now; + currentEncounter = new Encounter(); + currentEncounter.Entities = Encounters.Last().Entities; // preserve entities + if (WasWipe || Encounters.Last().AfterWipe) + { - currentEncounter.RaidInfos = Encounters.Last().RaidInfos; - currentEncounter.AfterWipe = true; // flag signifying zone after wipe - if (Encounters.Last().AfterWipe) + currentEncounter.RaidInfos = Encounters.Last().RaidInfos; + currentEncounter.AfterWipe = true; // flag signifying zone after wipe + if (Encounters.Last().AfterWipe) + { + Duration = 0; // dont add time for zone inbetween pulls for raid time + currentEncounter.AfterWipe = false; + } + currentEncounter.RaidTime = Encounters.Last().RaidTime + Duration;// update raid duration + WasWipe = false; + + } + else if (WasKill) { - Duration = 0; // dont add time for zone inbetween pulls for raid time - currentEncounter.AfterWipe = false; + WasKill = false; } - currentEncounter.RaidTime = Encounters.Last().RaidTime + Duration;// update raid duration - WasWipe = false; - - } - else if (WasKill) - { - WasKill = false; - } - if (Encounters.Last().Infos.Count <= 15) - { - Encounters.Remove(Encounters.Last()); - } - Encounters.Add(currentEncounter); - Logger.AppendLog(2); + if (Encounters.Last().Infos.Count <= 15) + { + Encounters.Remove(Encounters.Last()); + } + Encounters.Add(currentEncounter); + Logger.AppendLog(2); + }); } else if (opcode == OpCodes.PKTInitPC) {