diff --git a/core/control.lua b/core/control.lua index 57a76edf..e0bd45ec 100644 --- a/core/control.lua +++ b/core/control.lua @@ -106,6 +106,7 @@ ej_instance_id = t[5], id = t[2], bossimage = t[4], + unixtime = time(), } Details.tabela_vigente.is_boss = boss_table @@ -137,6 +138,7 @@ diff_string = select(4, GetInstanceInfo()), ej_instance_id = ejid, id = encounterid, + unixtime = time(), } if (not Details:IsRaidRegistered(mapid) and Details.zone_type == "raid") then @@ -319,6 +321,25 @@ end end + ---return an array of encounter Ids in order of the most recent to the oldest + function Details:GetEncounterIDInOrder() + --get the segments table + local segmentsTable = Details:GetCombatSegments() + + --table which contains the encounter Ids in order of the most recent to the oldest + local resultTable = {} + + --iterate over the segments table from the most recent to the oldest, check if the combatObject of the segment has is_boss and get the encounter Id from the member is_boss.id + for i = 1, #segmentsTable do + local combatObject = segmentsTable[i] + if (combatObject.is_boss) then + table.insert(resultTable, 1, combatObject.is_boss.id) + end + end + + return resultTable + end + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --internal functions -- Details.statistics = {container_calls = 0, container_pet_calls = 0, container_unknow_pet = 0, damage_calls = 0, heal_calls = 0, absorbs_calls = 0, energy_calls = 0, pets_summons = 0} @@ -589,6 +610,7 @@ diff_string = DifficultyName, ej_instance_id = ejid or 0, id = encounterID, + unixtime = time() } end end diff --git a/core/parser.lua b/core/parser.lua index d62e36d0..d62d84b1 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -4262,7 +4262,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 else --no last cooldown found so just add a last cooldown used event with no spellId and time 0 local eventTable = {} - eventTable[1] = 3 --true if this is a damage || false for healing || 1 for cooldown usage || 2 for last cooldown + eventTable[1] = 3 --event type eventTable[2] = 0 --spellId eventTable[3] = 0 --amount of damage or healing but in this case is 0 eventTable[4] = 0 --when the event happened using unix time @@ -5920,6 +5920,21 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end + local parserDebug = {} + function Details.OnParserEventDebug() + local time, token, hidding, who_serial, who_name, who_flags, who_flags2, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 = CombatLogGetCurrentEventInfo() + + if (not parserDebug[token]) then + parserDebug[token] = true + print(token) + end + + --local func = token_list[token] + --if (func) then + -- return func(nil, token, time, who_serial, who_name, who_flags, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) + --end + end + function Details.OnParserEventClassicEra() local time, token, hidding, who_serial, who_name, who_flags, who_flags2, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 = CombatLogGetCurrentEventInfo() @@ -5966,7 +5981,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 } Details.parser_frame:SetScript("OnEvent", Details.OnParserEventClassicEra) else - Details.parser_frame:SetScript("OnEvent", Details.OnParserEvent) + --if ("I'm debugging something") then + -- Details.parser_frame:SetScript("OnEvent", Details.OnParserEventDebug) + --else + Details.parser_frame:SetScript("OnEvent", Details.OnParserEvent) + --end end function Details:UpdateParser()