diff --git a/crates/openlogs-analysis/src/actors.rs b/crates/openlogs-analysis/src/actors.rs index 18c3571..c8bf7fa 100644 --- a/crates/openlogs-analysis/src/actors.rs +++ b/crates/openlogs-analysis/src/actors.rs @@ -1,18 +1,14 @@ use std::collections::HashMap; +use openlogs_parser::unit_flags::{ + AFFILIATION_GROUP, CONTROL_NPC, REACTION_FRIENDLY, REACTION_HOSTILE, TYPE_GUARDIAN, TYPE_PET, +}; use openlogs_parser::{NULL_GUID, Unit}; /// Index into [`Actors`]. [`NOBODY`] stands for an empty unit slot. pub type ActorId = u32; pub const NOBODY: ActorId = 0; -const TYPE_PET: u32 = 0x1000; -const TYPE_GUARDIAN: u32 = 0x2000; -/// Affiliation mine | party | raid. -const AFFILIATION_GROUP: u32 = 0x7; -const REACTION_FRIENDLY: u32 = 0x10; -const REACTION_HOSTILE: u32 = 0x40; -const CONTROL_NPC: u32 = 0x200; /// Owner chains longer than this are treated as broken (cycles, bad data). const MAX_OWNER_DEPTH: usize = 8; @@ -36,10 +32,15 @@ pub struct Actor { /// Lines that logged this actor hostile, and lines that did not. hostile_lines: u32, other_lines: u32, + /// Logged as an NPC-controlled friendly unit on a line outside the logging player's turns. + logged_friendly: bool, + fought_group: bool, /// Direct owner (summoner) of a pet or guardian. pub owner: Option, /// From `COMBATANT_INFO`, players only. pub spec_id: Option, + /// From the player's own casts, for players without a known spec; see [`Actor::class`]. + pub class_id: Option, /// Largest item level the advanced block reported; players only. pub item_level: Option, /// Largest max HP the advanced block reported; players only. @@ -57,12 +58,29 @@ impl Actor { self.hostile_lines > self.other_lines } + /// The spec's class, else the class the player's casts belong to. + pub fn class(&self) -> Option { + self.spec_class().or(self.class_id) + } + + pub fn spec_class(&self) -> Option { + spec_class(self.spec_id) + } + /// Belongs to the logging player's group (mine, party or raid) and is not hostile. pub fn is_friendly(&self) -> bool { self.flags & AFFILIATION_GROUP != 0 && !self.is_hostile() } } +/// The class of a spec the game data knows; a spec of 0 (none chosen) or an unknown one has +/// none, so the class then comes from casts. +pub fn spec_class(spec_id: Option) -> Option { + spec_id + .and_then(openlogs_gamedata::spec) + .map(|spec| spec.class_id) +} + /// An NPC-controlled unit logged friendly: how enemies look while the logging player is turned /// against the raid. pub(crate) fn npc_logged_friendly(unit: &Unit<'_>) -> bool { @@ -93,8 +111,11 @@ impl Actors { flags: 0, hostile_lines: 0, other_lines: 0, + logged_friendly: false, + fought_group: false, owner: None, spec_id: None, + class_id: None, item_level: None, max_hp: None, }], @@ -109,8 +130,11 @@ impl Actors { actor.flags = 0; actor.hostile_lines = 0; actor.other_lines = 0; + actor.logged_friendly = false; + actor.fought_group = false; actor.owner = None; actor.spec_id = None; + actor.class_id = None; actor.item_level = None; actor.max_hp = None; } @@ -157,8 +181,11 @@ impl Actors { flags: 0, hostile_lines: 0, other_lines: 0, + logged_friendly: false, + fought_group: false, owner: None, spec_id: None, + class_id: None, item_level: None, max_hp: None, }); @@ -213,6 +240,10 @@ impl Actors { } } + pub(crate) fn set_class(&mut self, unit: ActorId, class_id: Option) { + self.list[unit as usize].class_id = class_id; + } + /// Records a player's item level and max HP from an advanced block, keeping the largest. pub fn note_advanced(&mut self, unit: ActorId, level: u32, max_hp: u64) { let actor = &mut self.list[unit as usize]; @@ -256,6 +287,27 @@ impl Actors { pub fn is_enemy(&self, id: ActorId) -> bool { self.is_unowned_npc(id) && self.get(id).mostly_hostile() } + + /// An unowned NPC that fought the group and was never logged friendly outside the logging + /// player's turns: it stands against the raid even on lines that log it neutral. + pub(crate) fn fights_group_unfriendly(&self, id: ActorId) -> bool { + let actor = self.get(id); + actor.fought_group && !actor.logged_friendly + } + + pub(crate) fn note_logged_friendly(&mut self, id: ActorId) { + self.list[id as usize].logged_friendly = true; + } + + /// Marks the unowned NPCs on one side of a damage or miss with a player or a player's pet + /// on the other. Needs the pull's final owners. + pub(crate) fn note_fought_group(&mut self, source: ActorId, target: ActorId) { + for (npc, other) in [(source, target), (target, source)] { + if self.is_unowned_npc(npc) && self.credited_player(other).is_some() { + self.list[npc as usize].fought_group = true; + } + } + } } fn kind_from_guid(guid: &str) -> ActorKind { diff --git a/crates/openlogs-analysis/src/classes.rs b/crates/openlogs-analysis/src/classes.rs new file mode 100644 index 0000000..8840789 --- /dev/null +++ b/crates/openlogs-analysis/src/classes.rs @@ -0,0 +1,44 @@ +use std::collections::HashMap; + +use openlogs_gamedata::SpellClasses; + +use crate::actors::ActorId; +use crate::fight::{EventKind, Fight}; + +/// Gives each player without a known spec the class most of their own casts belong to. A tie, +/// or no cast of a class spell, leaves the class unset; casts by their pets do not count. +pub fn infer_classes(fight: &mut Fight, spell_classes: &SpellClasses) { + let mut casts: HashMap> = fight + .actors + .players() + .filter(|player| player.spec_class().is_none()) + .map(|player| (player.id, HashMap::new())) + .collect(); + for event in &fight.events { + if event.kind != EventKind::CastSuccess { + continue; + } + if let (Some(per_class), Some(class)) = ( + casts.get_mut(&event.source), + spell_classes.class_of(event.spell), + ) { + *per_class.entry(class).or_default() += 1; + } + } + for (player, per_class) in casts { + fight.actors.set_class(player, most_cast(&per_class)); + } +} + +fn most_cast(casts_per_class: &HashMap) -> Option { + let mut ranked: Vec<(u32, u32)> = casts_per_class + .iter() + .map(|(&class, &casts)| (casts, class)) + .collect(); + ranked.sort_unstable_by(|a, b| b.cmp(a)); + match ranked.as_slice() { + [(first, _), (second, _), ..] if first == second => None, + [(_, class), ..] => Some(*class), + [] => None, + } +} diff --git a/crates/openlogs-analysis/src/compare.rs b/crates/openlogs-analysis/src/compare.rs index 77ea05c..8b47352 100644 --- a/crates/openlogs-analysis/src/compare.rs +++ b/crates/openlogs-analysis/src/compare.rs @@ -7,7 +7,7 @@ use openlogs_gamedata::Curated; use crate::ability::unit_name; use crate::actors::ActorId; use crate::deaths::nth_death_ms; -use crate::fight::Fight; +use crate::fight::{Fight, listed_player}; use crate::filter::{Attribution, Overkill, ReportFilter}; use crate::overview::{QuickOverview, quick_overview_in}; use crate::reports::damage::damage_done; @@ -117,7 +117,7 @@ fn sort_key(row: &ComparedPlayer) -> (u8, f64) { } } -/// The players of one pull by GUID: everyone with a spec, plus anyone who did damage or +/// The players of one pull by GUID: every listed player, plus anyone who did damage or /// healing or died there (an Evoker outside the raid, a player without `COMBATANT_INFO`). fn player_sides( fight: &Fight, @@ -125,7 +125,11 @@ fn player_sides( filter: &ReportFilter, ) -> HashMap { let mut sides: HashMap = HashMap::new(); - for player in fight.actors.players().filter(|p| p.spec_id.is_some()) { + for player in fight + .actors + .players() + .filter(|p| listed_player(fight, p.id)) + { side(&mut sides, player.id); } for player in damage_done(fight, filter).players { diff --git a/crates/openlogs-analysis/src/fight.rs b/crates/openlogs-analysis/src/fight.rs index 7921cda..d581bb3 100644 --- a/crates/openlogs-analysis/src/fight.rs +++ b/crates/openlogs-analysis/src/fight.rs @@ -1,9 +1,9 @@ -use std::collections::BTreeMap; +use std::collections::{BTreeMap, BTreeSet}; use openlogs_index::{MapBounds, Outcome}; pub use openlogs_parser::{AuraAction, AuraType, DamageVia}; -use crate::actors::{ActorId, Actors, NOBODY}; +use crate::actors::{ActorId, ActorKind, Actors, NOBODY}; pub type SpellId = u32; /// Spell of melee swings, environmental damage and deaths. @@ -53,6 +53,9 @@ pub struct Fight { /// What Refractive Images took of hits, as `(event index, amount)` sorted by index, on the /// line the hit counts on; see [`Fight::delayed_part`]. pub delayed_hits: Vec<(u32, u64)>, + /// The index's roster: players with `COMBATANT_INFO` in a boss pull or run, the players + /// who fought in a combat pull. + pub roster: BTreeSet, } impl Fight { @@ -94,15 +97,19 @@ impl Fight { self.against_raid_at(event.target, event.target_logged_hostile, event.t) } - /// Whether `actor`, logged `hostile` on a line at `t`, stands against the raid. While the - /// logging player is turned the log swaps the sides: an unowned NPC then counts by how it - /// was logged over the pull, and players and their pets by the swapped flag. + /// Whether `actor`, logged `hostile` on a line at `t`, stands against the raid. A neutral + /// NPC that fought the group does too. While the logging player is turned the log swaps the + /// sides: an unowned NPC then counts by how it was logged over the pull, and players and + /// their pets by the swapped flag. pub fn against_raid_at(&self, actor: ActorId, hostile: bool, t: i32) -> bool { - if actor == NOBODY || !self.logger_turned_at(t) { + if actor == NOBODY { return hostile; } + if !self.logger_turned_at(t) { + return hostile || self.actors.fights_group_unfriendly(actor); + } if self.actors.is_unowned_npc(actor) { - self.actors.is_enemy(actor) + self.actors.is_enemy(actor) || self.actors.fights_group_unfriendly(actor) } else { !hostile } @@ -127,6 +134,17 @@ pub enum FightKind { Pull, /// A Mythic+ run, `CHALLENGE_MODE_START` to `CHALLENGE_MODE_END`. Run, + /// A fight against NPCs outside a boss encounter; it has no bosses. + Combat, +} + +/// Whether the player belongs on the fight's player lists: a player with a spec, or one who +/// fought in a combat pull, where most players have no `COMBATANT_INFO`. +pub fn listed_player(fight: &Fight, id: ActorId) -> bool { + let actor = fight.actors.get(id); + actor.kind == ActorKind::Player + && (actor.spec_id.is_some() + || (fight.kind == FightKind::Combat && fight.roster.contains(&id))) } /// A boss encounter inside a Mythic+ run, in ms since the run started. diff --git a/crates/openlogs-analysis/src/lib.rs b/crates/openlogs-analysis/src/lib.rs index 47d5cbb..6170da6 100644 --- a/crates/openlogs-analysis/src/lib.rs +++ b/crates/openlogs-analysis/src/lib.rs @@ -7,6 +7,7 @@ mod auras; mod breakdown; mod casts; mod cells; +mod classes; mod compare; mod deaths; mod deaths_report; @@ -35,7 +36,7 @@ mod usage; mod views; pub use ability::{AbilityDetail, AbilityHit, TargetHits, ability_detail}; -pub use actors::{Actor, ActorId, ActorKind, Actors, NOBODY}; +pub use actors::{Actor, ActorId, ActorKind, Actors, NOBODY, spec_class}; pub use aura_report::{AuraHolder, AuraLane, AuraRow, AurasReport, SourceSpec, auras_report}; pub use auras::{AuraInterval, aura_intervals, coverage, union_ms}; pub use breakdown::{ @@ -44,6 +45,7 @@ pub use breakdown::{ }; pub use casts::{CastExtra, CastsReport, casts_report}; pub use cells::{Cell, CellKind, Misses, ScopeMetric, cells}; +pub use classes::infer_classes; pub use compare::{ComparedPlayer, PlayerSide, PullComparison, compare_pulls}; pub use deaths::{ AbilityAmount, BURST_GAP_MS, DEATH_WINDOW_MS, Death, Hit, LethalBurst, Resurrection, deaths, @@ -55,7 +57,7 @@ pub use fight::{ Absorbed, AuraAction, AuraType, Damage, DamageVia, Energize, Event, EventKind, FailReason, Fight, FightKind, Heal, HealAbsorbed, LANDED_MATCH_MS, MarkerInterval, MissType, Missed, NO_SPELL, POWER_SAMPLE_MS, PositionSample, PowerSample, RunEncounter, SpellId, SpellInfo, - UnitHp, WorldMarkerInterval, + UnitHp, WorldMarkerInterval, listed_player, }; pub use filter::{Attribution, Overkill, ReportFilter}; pub use granted::note_heal_grants; diff --git a/crates/openlogs-analysis/src/load.rs b/crates/openlogs-analysis/src/load.rs index 704d870..315ce04 100644 --- a/crates/openlogs-analysis/src/load.rs +++ b/crates/openlogs-analysis/src/load.rs @@ -1,9 +1,9 @@ -use std::collections::{BTreeMap, HashMap, VecDeque}; +use std::collections::{BTreeMap, BTreeSet, HashMap, VecDeque}; use std::fs::File; use std::io; use std::path::Path; -use openlogs_index::{FightSummary, MapBounds, Outcome}; +use openlogs_index::{FightSummary, MapBounds, Outcome, RosterEntry}; use openlogs_parser::{ CombatEvent, CombatKind, EncounterEnd, EncounterStart, Event as LogEvent, HealVia, Lines, LogLine, Spell, Timestamp, parse_line, @@ -71,12 +71,27 @@ fn load_slice( } let late = builder.landed_after_end(&data[end..], &mut fields); let mut fight = builder.finish(); + // A combat pull's specs come from `COMBATANT_INFO` before its range, which only the index + // read; a spec logged inside the range wins. + apply_roster(&mut fight, &summary.roster); let unpaired = pair_landed_copies(&mut fight); mark_swings_landing_after_end(&mut fight, unpaired, &late); note_delayed_hits(&mut fight); fight } +fn apply_roster(fight: &mut Fight, roster: &[RosterEntry]) { + for entry in roster { + let Some(id) = fight.actors.id(&entry.guid) else { + continue; + }; + fight.roster.insert(id); + if entry.spec_id != 0 && fight.actors.get(id).spec_id.is_none() { + fight.actors.set_spec(id, entry.spec_id); + } + } +} + /// A `SWING_DAMAGE_LANDED` logged after the fight's end, of units the fight knows. struct LateLanded { t: i32, @@ -227,6 +242,8 @@ impl FightBuilder { fight: Fight { kind: if summary.is_run() { FightKind::Run + } else if summary.is_combat() { + FightKind::Combat } else { FightKind::Pull }, @@ -261,6 +278,7 @@ impl FightBuilder { logger_turned: Vec::new(), heal_grants: Vec::new(), delayed_hits: Vec::new(), + roster: BTreeSet::new(), }, last_power: HashMap::new(), last_t: i32::MIN, @@ -362,11 +380,23 @@ impl FightBuilder { .max_by_key(|&(&map, &count)| (count, std::cmp::Reverse(map))) .map(|(&map, _)| map); self.fight.events.sort_by_key(|event| event.t); + for event in &self.fight.events { + if matches!(event.kind, EventKind::Damage(_) | EventKind::Missed(_)) { + self.fight + .actors + .note_fought_group(event.source, event.target); + } + } self.fight.power.sort_by_key(|p| p.t); self.fight.npc_power.sort_by_key(|p| p.t); self.fight.positions.sort_by_key(|p| p.t); self.friendly_npc_lines.sort_by_key(|&(t, _)| t); self.fight.logger_turned = logger_turned_spans(&self.fight, &self.friendly_npc_lines); + for &(t, id) in &self.friendly_npc_lines { + if !self.fight.logger_turned_at(t) { + self.fight.actors.note_logged_friendly(id); + } + } note_heal_grants(&mut self.fight); self.fight } diff --git a/crates/openlogs-analysis/src/overview.rs b/crates/openlogs-analysis/src/overview.rs index 8596755..cb36967 100644 --- a/crates/openlogs-analysis/src/overview.rs +++ b/crates/openlogs-analysis/src/overview.rs @@ -4,7 +4,7 @@ use openlogs_gamedata::{ConsumableKind, CooldownCategory, Curated}; use crate::actors::ActorId; use crate::deaths::{Death, deaths}; -use crate::fight::{EventKind, Fight, SpellId}; +use crate::fight::{EventKind, Fight, SpellId, listed_player}; use crate::filter::{Attribution, Overkill, ReportFilter}; use crate::phases::fight_phases; use crate::timeline::{ @@ -21,7 +21,8 @@ pub const DPS_STEP_MS: u32 = 5_000; #[derive(Debug, Clone, PartialEq)] pub struct Kpis { - /// Players with a spec from `COMBATANT_INFO`. + /// Listed players (see [`listed_player`]), plus anyone who used a consumable or cooldown + /// or died. pub players: u32, pub duration_ms: u64, pub raid_damage: u64, @@ -87,7 +88,7 @@ pub fn quick_overview_in(fight: &Fight, curated: &Curated, filter: &ReportFilter let roster: HashSet = fight .actors .players() - .filter(|p| p.spec_id.is_some()) + .filter(|p| listed_player(fight, p.id)) .map(|p| p.id) .chain(all_consumables.iter().map(|u| u.player)) .chain(all_cooldowns.iter().map(|u| u.player)) diff --git a/crates/openlogs-analysis/src/replay/units.rs b/crates/openlogs-analysis/src/replay/units.rs index 32e541f..64eae23 100644 --- a/crates/openlogs-analysis/src/replay/units.rs +++ b/crates/openlogs-analysis/src/replay/units.rs @@ -1,7 +1,5 @@ use std::collections::{HashMap, HashSet}; -use openlogs_gamedata::spec; - use crate::actors::{ActorId, ActorKind}; use crate::fight::{EventKind, Fight}; @@ -63,7 +61,7 @@ impl Roster { name: actor.name.clone().unwrap_or_default(), kind, spec_id: actor.spec_id, - class_id: actor.spec_id.and_then(spec).map(|spec| spec.class_id), + class_id: actor.class(), owner: actor.owner, add_number: None, } diff --git a/crates/openlogs-analysis/src/timeline.rs b/crates/openlogs-analysis/src/timeline.rs index e2f8e23..be6535e 100644 --- a/crates/openlogs-analysis/src/timeline.rs +++ b/crates/openlogs-analysis/src/timeline.rs @@ -71,7 +71,7 @@ fn is_npc(fight: &Fight, actor: ActorId) -> bool { } /// Whether the event's target is an enemy NPC: a unit no player owns that stands against the -/// raid at the event. Hits on units logged neutral do not count. +/// raid at the event. A unit logged neutral counts if it fought the group. fn hits_enemy_npc(fight: &Fight, event: &Event) -> bool { fight.actors.is_unowned_npc(event.target) && fight.target_against_raid(event) } @@ -101,9 +101,9 @@ pub fn is_aborted(fight: &Fight) -> bool { /// Boss candidates: hostile units that took at least a fifth of the damage of the /// most-damaged unit and have at least a quarter of the largest max HP. Councils yield /// several bosses; untouched encounter NPCs and small adds are excluded. A Mythic+ run has -/// none: its boss pulls do. +/// none (its boss pulls do), nor has a combat pull. pub fn boss_units(fight: &Fight) -> Vec { - if is_aborted(fight) || fight.kind == FightKind::Run { + if is_aborted(fight) || matches!(fight.kind, FightKind::Run | FightKind::Combat) { return Vec::new(); } let mut taken: HashMap = HashMap::new(); diff --git a/crates/openlogs-analysis/src/usage.rs b/crates/openlogs-analysis/src/usage.rs index 66c1a70..4157720 100644 --- a/crates/openlogs-analysis/src/usage.rs +++ b/crates/openlogs-analysis/src/usage.rs @@ -164,12 +164,10 @@ pub fn death_context( }; let mut context = Vec::new(); - let has_warlock = fight.actors.players().any(|actor| { - actor - .spec_id - .and_then(openlogs_gamedata::spec) - .is_some_and(|s| s.class_id == WARLOCK_CLASS_ID) - }); + let has_warlock = fight + .actors + .players() + .any(|actor| actor.spec_class() == Some(WARLOCK_CLASS_ID)); // Stones outlast the warlock who made them: anyone using one shows the raid had them. let stones_in_raid = consumables .iter() diff --git a/crates/openlogs-analysis/tests/classes.rs b/crates/openlogs-analysis/tests/classes.rs new file mode 100644 index 0000000..2f49775 --- /dev/null +++ b/crates/openlogs-analysis/tests/classes.rs @@ -0,0 +1,69 @@ +mod support; + +use openlogs_analysis::{ActorId, EventKind, NOBODY, infer_classes}; +use openlogs_gamedata::SpellClasses; +use support::{FightBuilder, PET_FLAGS, PLAYER_FLAGS}; + +const ROGUE: u32 = 4; + +const SINISTER_STRIKE: u32 = 1752; +const EVISCERATE: u32 = 196819; +const FIREBALL: u32 = 133; +const ARCANE_SHOT: u32 = 185358; + +fn spell_classes() -> SpellClasses { + let options = format!( + "ID,SpellID,SpellClassSet\n1,{SINISTER_STRIKE},8\n2,{EVISCERATE},8\n3,{FIREBALL},3\n4,{ARCANE_SHOT},9\n" + ); + SpellClasses::from_csv(options.as_bytes(), b"ID,EffectAura,SpellID\n").unwrap() +} + +fn cast(b: &mut FightBuilder, t: i32, source: ActorId, spell: u32) { + b.push(t, source, NOBODY, spell, EventKind::CastSuccess); +} + +#[test] +fn class_follows_most_casts() { + let mut b = FightBuilder::new(30_000); + let player = b.unit("Player-1", "Ravel-Ashwood-EU", PLAYER_FLAGS); + cast(&mut b, 1_000, player, SINISTER_STRIKE); + cast(&mut b, 2_000, player, FIREBALL); + cast(&mut b, 3_000, player, EVISCERATE); + cast(&mut b, 4_000, player, SINISTER_STRIKE); + let mut fight = b.build(); + + infer_classes(&mut fight, &spell_classes()); + + assert_eq!(fight.actors.get(player).class_id, Some(ROGUE)); +} + +#[test] +fn class_tie_or_pet_casts_leave_it_unset() { + let mut b = FightBuilder::new(30_000); + let undecided = b.unit("Player-1", "Ravel-Ashwood-EU", PLAYER_FLAGS); + cast(&mut b, 1_000, undecided, SINISTER_STRIKE); + cast(&mut b, 2_000, undecided, FIREBALL); + let owner = b.unit("Player-2", "Tamsin-Ashwood-EU", PLAYER_FLAGS); + let pet = b.unit("Pet-0-1-1-1-1-0001", "Wolf", PET_FLAGS); + b.fight.actors.set_owner(pet, owner); + cast(&mut b, 1_000, pet, ARCANE_SHOT); + let mut fight = b.build(); + + infer_classes(&mut fight, &spell_classes()); + + assert_eq!(fight.actors.get(undecided).class_id, None); + assert_eq!(fight.actors.get(owner).class_id, None); +} + +#[test] +fn a_spec_of_zero_still_takes_the_class_from_casts() { + let mut b = FightBuilder::new(30_000); + let player = b.unit("Player-1", "Ravel-Ashwood-EU", PLAYER_FLAGS); + b.fight.actors.set_spec(player, 0); + cast(&mut b, 1_000, player, SINISTER_STRIKE); + let mut fight = b.build(); + + infer_classes(&mut fight, &spell_classes()); + + assert_eq!(fight.actors.get(player).class(), Some(ROGUE)); +} diff --git a/crates/openlogs-analysis/tests/combat_pull.rs b/crates/openlogs-analysis/tests/combat_pull.rs new file mode 100644 index 0000000..79ae5e2 --- /dev/null +++ b/crates/openlogs-analysis/tests/combat_pull.rs @@ -0,0 +1,118 @@ +mod support; + +use openlogs_analysis::{ + Attribution, EventKind, FightKind, NOBODY, ReportFilter, Scope, Side, boss_units, damage_done, + deaths_report, listed_player, load_fight, quick_overview, +}; +use openlogs_gamedata::Curated; +use openlogs_index::{FightSummary, Outcome, index_bytes}; +use support::{FightBuilder, HOSTILE_FLAGS}; + +const OPEN_WORLD: &str = include_str!("../../openlogs-index/tests/fixtures/forever_open_world.txt"); +const LOGGER: &str = "Player-6949-0066C9DA"; + +fn open_world_pull() -> FightSummary { + index_bytes(OPEN_WORLD.as_bytes()) + .fights + .into_iter() + .find(FightSummary::is_combat) + .expect("the fixture has a combat pull") +} + +fn combat_pull(duration_ms: u64) -> FightBuilder { + let mut b = FightBuilder::new(duration_ms); + b.fight.kind = FightKind::Combat; + b.fight.encounter_id = 0; + b.fight.name = "Murloc Brute".into(); + b +} + +#[test] +fn combat_pull_has_no_boss_units_or_made_up_deaths() { + let mut b = combat_pull(30_000); + let rogue = b.player("Player-1", "Ravel-Ashwood-EU", 259); + let brute = b.unit("Creature-0-1-1-1-1-0001", "Murloc Brute", HOSTILE_FLAGS); + let minion = b.unit("Creature-0-1-1-1-2-0002", "Murloc Minion", HOSTILE_FLAGS); + let strike = b.spell(1752, "Sinister Strike"); + b.hit(1_000, rogue, brute, strike, 50_000, (950_000, 1_000_000)); + b.hit(2_000, rogue, minion, strike, 5_000, (0, 5_000)); + b.push( + 2_000, + NOBODY, + minion, + 0, + EventKind::Died { unconscious: false }, + ); + b.fight.outcome = Outcome::Kill; + let fight = b.build(); + + assert!(boss_units(&fight).is_empty()); + let enemies = Scope { + perspective: Side::Enemy, + ..Scope::default() + }; + let report = deaths_report( + &fight, + &Curated::bundled(), + &ReportFilter::whole(Attribution::Augmented), + &enemies, + ); + let killed: Vec<_> = report.kills.iter().map(|kill| kill.unit).collect(); + assert_eq!(killed, [minion]); +} + +#[test] +fn combat_pull_lists_the_players_who_fought() { + let summary = open_world_pull(); + let fight = load_fight(OPEN_WORLD.as_bytes(), &summary); + let listed = |guid: &str| listed_player(&fight, fight.actors.id(guid).expect("in the log")); + + assert!(listed(LOGGER), "the logger fought without COMBATANT_INFO"); + assert!(listed("Player-6941-006597A9"), "an outsider who fought"); + assert!( + !listed("Player-6947-0066B6FD"), + "only refreshed his own seal" + ); + assert!( + !listed("Player-6939-002654D1"), + "fought neutral mobs before the pull" + ); + let overview = quick_overview(&fight, &Curated::bundled()); + assert_eq!(overview.kpis.players as usize, summary.roster.len()); +} + +#[test] +fn combat_pull_uses_the_roster_spec() { + let mut summary = open_world_pull(); + summary + .roster + .iter_mut() + .find(|entry| entry.guid == LOGGER) + .expect("the logger fought") + .spec_id = 259; + + let fight = load_fight(OPEN_WORLD.as_bytes(), &summary); + assert_eq!(fight.kind, FightKind::Combat); + let id = fight.actors.id(LOGGER).expect("the logger is an actor"); + assert_eq!(fight.actors.get(id).spec_id, Some(259)); +} + +#[test] +fn neutral_mob_that_fights_us_counts_as_damage_done() { + let log = [ + r#"11/5/2026 02:45:20.8301 COMBAT_LOG_VERSION,22,ADVANCED_LOG_ENABLED,1,BUILD_VERSION,1.60.1,PROJECT_ID,18"#, + r#"11/5/2026 02:45:21.5991 SWING_DAMAGE,Creature-0-6846-0-240-1675-00016BDE2C,"Rot Hide Mongrel",0xa28,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1675-00016BDE2C,0000000000000000,139,167,84,0,202,0,0,0,3,54,100,0,2859.70,409.70,1420,1.5951,1,9,11,-1,1,0,0,0,nil,nil,nil"#, + r#"11/5/2026 02:45:22.7541 SPELL_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1675-00016BDE2C,"Rot Hide Mongrel",0xa28,0x80000000,1757,"Sinister Strike",0x1,Creature-0-6846-0-240-1675-00016BDE2C,0000000000000000,109,167,84,0,202,0,0,0,0,120,165,0,2859.98,411.15,1420,1.1924,8,30,18,-1,1,0,0,0,1,nil,nil,ST"#, + r#"11/5/2026 02:45:24.6161 SPELL_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1675-00016BDE2C,"Rot Hide Mongrel",0xa28,0x80000000,6760,"Eviscerate",0x1,Creature-0-6846-0-240-1675-00016BDE2C,0000000000000000,74,167,84,0,202,0,0,0,0,79,165,0,2859.98,411.15,1420,1.1007,8,35,43,-1,1,0,0,0,nil,nil,nil,ST"#, + ] + .join("\n"); + let summary = index_bytes(log.as_bytes()) + .fights + .into_iter() + .find(FightSummary::is_combat) + .expect("fighting a neutral mob is a combat pull"); + let fight = load_fight(log.as_bytes(), &summary); + + let report = damage_done(&fight, &ReportFilter::whole(Attribution::Augmented)); + assert_eq!(report.total, 30 + 35); +} diff --git a/crates/openlogs-analysis/tests/damage_report.rs b/crates/openlogs-analysis/tests/damage_report.rs index 5fc7f38..2ba42e2 100644 --- a/crates/openlogs-analysis/tests/damage_report.rs +++ b/crates/openlogs-analysis/tests/damage_report.rs @@ -413,7 +413,7 @@ fn boss_hits_around_a_turn(amount: u64) -> Vec { } #[test] -fn a_boss_counts_while_logged_friendly_to_a_turned_logger_but_not_while_logged_neutral() { +fn a_boss_counts_while_logged_friendly_to_a_turned_logger_and_while_logged_neutral() { let warrior = (WARRIOR, "Wendel-Emberfall-EU", "0x514"); let mut lines = boss_hits_around_a_turn(10); lines.push(hit_line( @@ -425,7 +425,7 @@ fn a_boss_counts_while_logged_friendly_to_a_turned_logger_but_not_while_logged_n lines.sort(); assert_eq!( logged_damage(&lines), - [("Wendel-Emberfall-EU".to_string(), 800)] + [("Wendel-Emberfall-EU".to_string(), 1_800)] ); } @@ -463,3 +463,16 @@ fn while_the_logging_player_is_turned_the_raids_hits_on_them_count_but_not_their [("Wendel-Emberfall-EU".to_string(), 700)] ); } + +#[test] +fn a_neutral_add_that_fights_the_raid_counts_while_the_logging_player_is_turned() { + let warrior = (WARRIOR, "Wendel-Emberfall-EU", "0x548"); + let add = ("Creature-0-1-1-1-261874-01", "Blightscale Rawling", "0xa28"); + let mut lines = boss_hits_around_a_turn(0); + lines.push(hit_line(&at(40), warrior, add, 500)); + lines.sort(); + assert_eq!( + logged_damage(&lines), + [("Wendel-Emberfall-EU".to_string(), 500)] + ); +} diff --git a/crates/openlogs-analysis/tests/mythic_plus.rs b/crates/openlogs-analysis/tests/mythic_plus.rs index 1c8e18e..fb2f32b 100644 --- a/crates/openlogs-analysis/tests/mythic_plus.rs +++ b/crates/openlogs-analysis/tests/mythic_plus.rs @@ -110,7 +110,7 @@ fn a_boss_phase_of_the_run_matches_the_boss_pull() { let pulls: Vec<_> = index .fights .iter() - .filter(|f| f.run_index == Some(1)) + .filter(|f| f.run_index == Some(1) && !f.is_combat()) .collect(); assert_eq!(bosses.len(), pulls.len()); for (phase, summary) in bosses.into_iter().zip(pulls) { diff --git a/crates/openlogs-analysis/tests/support/mod.rs b/crates/openlogs-analysis/tests/support/mod.rs index a622992..ab2ac6f 100644 --- a/crates/openlogs-analysis/tests/support/mod.rs +++ b/crates/openlogs-analysis/tests/support/mod.rs @@ -1,7 +1,7 @@ // Each test binary uses a different subset of these helpers. #![allow(dead_code)] -use std::collections::BTreeMap; +use std::collections::{BTreeMap, BTreeSet}; use openlogs_analysis::{ ActorId, Actors, Damage, DamageVia, Event, EventKind, Fight, FightKind, Heal, NO_SPELL, NOBODY, @@ -47,6 +47,7 @@ impl FightBuilder { logger_turned: Vec::new(), heal_grants: Vec::new(), delayed_hits: Vec::new(), + roster: BTreeSet::new(), }, } } diff --git a/crates/openlogs-cli/src/format.rs b/crates/openlogs-cli/src/format.rs index 3eab551..9492c23 100644 --- a/crates/openlogs-cli/src/format.rs +++ b/crates/openlogs-cli/src/format.rs @@ -85,20 +85,21 @@ fn fight_row(fight: &FightSummary) -> String { format!("+{}", challenge.keystone_level), run_result(fight.outcome), ), + None if fight.is_combat() => ("Combat".to_string(), pull_result(fight.outcome)), None => ( difficulty_label(fight.difficulty) .map_or_else(|| fight.difficulty.to_string(), str::to_string), - match fight.outcome { - Outcome::Kill => "Kill", - Outcome::Wipe => "Wipe", - Outcome::Incomplete => "Incomplete", - }, + pull_result(fight.outcome), ), }; - // Boss pulls of a Mythic+ run sit indented under their run. + let enemies = match &fight.combat { + Some(combat) if combat.enemy_count > 1 => format!(" +{}", combat.enemy_count - 1), + _ => String::new(), + }; + // Pulls of a Mythic+ run sit indented under their run. let name = match fight.run_index { - Some(_) => format!(" {}", fight.name), - None => fight.name.clone(), + Some(_) => format!(" {}{enemies}", fight.name), + None => format!("{}{enemies}", fight.name), }; let boss_hp = fight .boss_hp_percent @@ -116,11 +117,20 @@ fn fight_row(fight: &FightSummary) -> String { ) } +fn pull_result(outcome: Outcome) -> &'static str { + match outcome { + Outcome::Kill => "Kill", + Outcome::Wipe => "Wipe", + Outcome::Ended => "Ended", + Outcome::Incomplete => "Incomplete", + } +} + /// A run's result as the index reads it from the log (see `FightSummary::outcome`). fn run_result(outcome: Outcome) -> &'static str { match outcome { Outcome::Kill => "Completed", - Outcome::Wipe => "Not completed", + Outcome::Wipe | Outcome::Ended => "Not completed", Outcome::Incomplete => "Incomplete", } } @@ -142,7 +152,7 @@ fn run_line(run: &FightSummary, challenge: &ChallengeMode, fights: &[FightSummar let pulls = list( fights .iter() - .filter(|fight| fight.run_index == Some(run.index)) + .filter(|fight| fight.run_index == Some(run.index) && !fight.is_combat()) .map(|fight| fight.index.to_string()) .collect(), ); @@ -195,9 +205,23 @@ mod tests { #[test] fn report_lists_runs_with_their_boss_pulls() { - let index = index_bytes( - include_str!("../../openlogs-index/tests/fixtures/mythic_plus.txt").as_bytes(), + let log = include_str!("../../openlogs-index/tests/fixtures/mythic_plus.txt"); + let last_trash = log + .lines() + .find(|line| line.starts_with("10/8/2026 20:08:00.0000")) + .unwrap(); + let second_knight = last_trash + .replace("20:08:00.0000", "20:08:01.0000") + .replace("0000468006", "0000468007"); + let log = log.replacen( + last_trash, + &format!( + "{last_trash} +{second_knight}" + ), + 1, ); + let index = index_bytes(log.as_bytes()); let text = report( Path::new("Logs/mplus.txt"), 8192, @@ -214,21 +238,47 @@ mod tests { rows.iter().map(|row| words(row)).collect::>(), [ "1 Priory of the Sacred Flame +12 Completed 10:00.0 - 2 20:00:00", - "2 Captain Dailcry Mythic+ Kill 1:00.0 0.0% 2 20:01:00", - "3 Baron Braunpyke Mythic+ Wipe 0:30.0 87.5% 2 20:04:00", - "4 Baron Braunpyke Mythic+ Kill 1:00.0 0.0% 2 20:06:00", + "2 Arathi Knight Combat Ended 0:00.0 - 1 20:00:10", + "3 Captain Dailcry Mythic+ Kill 1:00.0 0.0% 2 20:01:00", + "4 Arathi Knight Combat Ended 0:00.0 - 1 20:03:00", + "5 Baron Braunpyke Mythic+ Wipe 0:30.0 87.5% 2 20:04:00", + "6 Baron Braunpyke Mythic+ Kill 1:00.0 0.0% 2 20:06:00", + "7 Arathi Knight +1 Combat Ended 0:01.0 - 1 20:08:00", ] ); assert!( - rows[2].starts_with(" 3 Baron Braunpyke"), + rows[4].starts_with(" 5 Baron Braunpyke"), "boss pulls are indented under their run: {}", - rows[2] + rows[4] ); assert!( text.contains( - "Completed in 10:00.0 (logged 10:00.0), affixes 10, 147, 9, boss pulls 2, 3, 4" + "Completed in 10:00.0 (logged 10:00.0), affixes 10, 147, 9, boss pulls 3, 5, 6" ), "{text}" ); } + + #[test] + fn report_marks_combat_pulls() { + let index = index_bytes( + include_str!("../../openlogs-index/tests/fixtures/forever_open_world.txt").as_bytes(), + ); + let text = report( + Path::new("Logs/open_world.txt"), + 8192, + &index, + Duration::from_millis(3), + None, + ); + let row = text + .lines() + .find(|line| line.contains("Vile Fin Minor Oracle")) + .expect("combat row"); + let words: Vec<&str> = row.split_whitespace().collect(); + assert!( + words.contains(&"Combat") && words.contains(&"Kill"), + "{row}" + ); + } } diff --git a/crates/openlogs-gamedata/src/spell_classes.rs b/crates/openlogs-gamedata/src/spell_classes.rs index e2ffa66..1b57b28 100644 --- a/crates/openlogs-gamedata/src/spell_classes.rs +++ b/crates/openlogs-gamedata/src/spell_classes.rs @@ -1,12 +1,28 @@ -use std::collections::HashSet; +use std::collections::BTreeMap; use thiserror::Error; -/// The player class families of `SpellClassOptions.SpellClassSet`: mage 3, warrior 4, warlock 5, -/// priest 6, druid 7, rogue 8, hunter and its pets 9, paladin 10, shaman 11, death knight 15, -/// monk 53, warlock pets 57, demon hunter 107, evoker 224. Not `SkillLineAbility`: it lacks the -/// trait-tree talents; the families cover 83 % of the player auras in real raid logs. -const CLASS_FAMILIES: [u32; 14] = [3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 53, 57, 107, 224]; +/// The player class families of `SpellClassOptions.SpellClassSet` with their class IDs: mage 3, +/// warrior 4, warlock 5, priest 6, druid 7, rogue 8, hunter and its pets 9, paladin 10, shaman 11, +/// death knight 15, monk 53, warlock pets 57, demon hunter 107, evoker 224. Not +/// `SkillLineAbility`: it lacks the trait-tree talents; the families cover 83 % of the player +/// auras in real raid logs. +const CLASS_FAMILIES: [(u32, u32); 14] = [ + (3, 8), + (4, 1), + (5, 9), + (6, 5), + (7, 11), + (8, 4), + (9, 3), + (10, 2), + (11, 7), + (15, 6), + (53, 10), + (57, 9), + (107, 12), + (224, 13), +]; /// `SpellEffect.EffectAura` types that take control: confuse 5, fear 7, stun 12, root 26 and /// 455, silence 27, pacify-silence 60, stun without gravity 298. @@ -24,7 +40,7 @@ pub enum SpellClassesError { Json(#[from] serde_json::Error), } -/// Which spells belong to a player class, and which of those take control of their target. +/// Which spells belong to which player class, and which of those take control of their target. #[derive(Debug, Clone, Default, PartialEq, Eq)] pub struct SpellClasses { loaded: bool, @@ -32,6 +48,8 @@ pub struct SpellClasses { class_spells: Vec, /// Ascending; a subset of `class_spells`. crowd_control: Vec, + /// The family of each of `class_spells`, in the same order. + families: Vec, } #[derive(serde::Serialize, serde::Deserialize)] @@ -41,6 +59,9 @@ struct WebTable { class_spells: Vec, /// Ascending, each as the difference to the previous ID. crowd_control: Vec, + /// Absent from game data exported before classes were known from casts. + #[serde(default)] + families: Vec, } impl SpellClasses { @@ -50,26 +71,25 @@ impl SpellClasses { spell_class_options: &[u8], spell_effect: &[u8], ) -> Result { - let class_spells = sorted(spell_ids_where( - spell_class_options, - "SpellClassSet", - |family| CLASS_FAMILIES.contains(&family), - )?); - if class_spells.is_empty() { + let family_of = spell_values_where(spell_class_options, "SpellClassSet", |family| { + class_of_family(family).is_some() + })?; + if family_of.is_empty() { return Err(SpellClassesError::Empty); } - let controlling = spell_ids_where(spell_effect, "EffectAura", |aura| { + let controlling = spell_values_where(spell_effect, "EffectAura", |aura| { CROWD_CONTROL_AURAS.contains(&aura) })?; - let crowd_control = class_spells - .iter() + let crowd_control = family_of + .keys() .copied() - .filter(|spell| controlling.contains(spell)) + .filter(|spell| controlling.contains_key(spell)) .collect(); Ok(Self { loaded: true, - class_spells, + class_spells: family_of.keys().copied().collect(), crowd_control, + families: family_of.into_values().collect(), }) } @@ -86,6 +106,13 @@ impl SpellClasses { self.crowd_control.binary_search(&spell_id).is_ok() } + /// The class ID of a class spell. `None` for other spells, and for game data exported + /// without families. + pub fn class_of(&self, spell_id: u32) -> Option { + let index = self.class_spells.binary_search(&spell_id).ok()?; + class_of_family(*self.families.get(index)?) + } + pub fn class_spell_count(&self) -> usize { self.class_spells.len() } @@ -95,11 +122,12 @@ impl SpellClasses { } /// The table for the web app: both ID lists in ascending order as differences to the - /// previous ID. + /// previous ID, and the family of each class spell. pub fn to_json(&self) -> String { let table = WebTable { class_spells: deltas(&self.class_spells), crowd_control: deltas(&self.crowd_control), + families: self.families.clone(), }; serde_json::to_string(&table).expect("the spell class table serializes") } @@ -114,36 +142,38 @@ impl SpellClasses { loaded: true, class_spells: undeltas(table.class_spells), crowd_control: undeltas(table.crowd_control), + families: table.families, }) } } -fn spell_ids_where( +fn class_of_family(family: u32) -> Option { + CLASS_FAMILIES + .iter() + .find(|&&(class_family, _)| class_family == family) + .map(|&(_, class)| class) +} + +fn spell_values_where( csv_bytes: &[u8], value_column: &'static str, keep: impl Fn(u32) -> bool, -) -> Result, SpellClassesError> { +) -> Result, SpellClassesError> { let mut reader = csv::Reader::from_reader(csv_bytes); let headers = reader.headers()?.clone(); let value_col = column(&headers, value_column)?; let spell_col = column(&headers, "SpellID")?; - let mut ids = HashSet::new(); + let mut values = BTreeMap::new(); for record in reader.records() { let record = record?; let parse = |col: usize| record.get(col).and_then(|v| v.parse::().ok()); if let (Some(spell), Some(value)) = (parse(spell_col), parse(value_col)) && keep(value) { - ids.insert(spell); + values.insert(spell, value); } } - Ok(ids) -} - -fn sorted(ids: HashSet) -> Vec { - let mut ids: Vec = ids.into_iter().collect(); - ids.sort_unstable(); - ids + Ok(values) } fn deltas(ids: &[u32]) -> Vec { diff --git a/crates/openlogs-gamedata/tests/spell_classes.rs b/crates/openlogs-gamedata/tests/spell_classes.rs index 4a4fced..7170adc 100644 --- a/crates/openlogs-gamedata/tests/spell_classes.rs +++ b/crates/openlogs-gamedata/tests/spell_classes.rs @@ -11,6 +11,9 @@ const KIDNEY_SHOT: u32 = 408; const HEALING_POTION: u32 = 441; const WAR_STOMP: u32 = 20549; +const ROGUE: u32 = 4; +const MAGE: u32 = 8; + fn table() -> SpellClasses { SpellClasses::from_csv(SPELL_CLASS_OPTIONS, SPELL_EFFECT).unwrap() } @@ -57,18 +60,40 @@ fn a_header_only_export_fails_as_empty() { } #[test] -fn round_trips_through_json() { +fn class_of_maps_families_to_classes() { + let table = table(); + assert_eq!(table.class_of(FIREBALL), Some(MAGE)); + assert_eq!(table.class_of(KIDNEY_SHOT), Some(ROGUE)); + assert_eq!(table.class_of(HEALING_POTION), None); + assert_eq!(table.class_of(WAR_STOMP), None); +} + +#[test] +fn web_table_round_trips_families() { let json = table().to_json(); assert_eq!( serde_json::from_str::(&json).unwrap(), - serde_json::json!({ "classSpells": [118, 15, 275], "crowdControl": [118, 290] }) + serde_json::json!({ + "classSpells": [118, 15, 275], + "crowdControl": [118, 290], + "families": [3, 3, 8], + }) ); let read = SpellClasses::from_json(&json).unwrap(); assert_eq!(read, table()); assert!(read.is_loaded()); + assert_eq!(read.class_of(KIDNEY_SHOT), Some(ROGUE)); assert!(!SpellClasses::default().is_loaded()); } +#[test] +fn game_data_exported_without_families_still_loads() { + let read = SpellClasses::from_json(r#"{"classSpells":[118,15,275],"crowdControl":[118,290]}"#) + .unwrap(); + assert!(read.is_crowd_control(KIDNEY_SHOT)); + assert_eq!(read.class_of(KIDNEY_SHOT), None); +} + #[test] fn a_truncated_json_export_fails_as_empty() { assert!(matches!( diff --git a/crates/openlogs-index/src/builder.rs b/crates/openlogs-index/src/builder.rs index 959315d..4a22cc9 100644 --- a/crates/openlogs-index/src/builder.rs +++ b/crates/openlogs-index/src/builder.rs @@ -1,15 +1,16 @@ -use std::collections::{BTreeMap, HashMap, VecDeque}; +use std::collections::{BTreeMap, HashMap, HashSet, VecDeque}; use openlogs_parser::{ - ChallengeModeEnd, ChallengeModeStart, CombatEvent, CombatKind, CombatantInfo, DamageVia, - EncounterEnd, EncounterStart, Event, LogLine, Timestamp, + ChallengeModeEnd, ChallengeModeStart, CombatEvent, CombatKind, CombatantInfo, EncounterEnd, + EncounterStart, Event, LogLine, Timestamp, }; +use crate::combat::{DeadEnemies, Exchange, OpenCombat, counted_damage, exchange}; use crate::markers::MarkerState; use crate::model::{ - ChallengeMode, END_GRACE_LINES, END_GRACE_MICROS, FightSummary, GameFlavor, LogIndex, - MYTHIC_KEYSTONE_DIFFICULTY, MapBounds, Outcome, PRELUDE_MICROS, RESUME_MAX_GAP_MICROS, - RosterEntry, SUPPORTED_LOG_VERSION, WorldMarker, + BOSS_TAIL_MICROS, ChallengeMode, END_GRACE_LINES, END_GRACE_MICROS, FightSummary, GameFlavor, + LogIndex, MYTHIC_KEYSTONE_DIFFICULTY, MapBounds, Outcome, PRELUDE_MICROS, + RESUME_MAX_GAP_MICROS, RosterEntry, SUPPORTED_LOG_VERSION, WorldMarker, }; /// Byte range of one line in the log file. @@ -24,16 +25,29 @@ pub struct LineSpan { pub struct IndexBuilder { index: LogIndex, open: Option, + /// The combat pull in progress; never open together with a boss pull. + combat: Option, /// The Mythic+ run in progress; boss pulls opened meanwhile belong to it. run: Option, /// The run's `CHALLENGE_MODE_END`, held while its open boss pull may still end. held_end: Option, /// Lines of the last [`PRELUDE_MICROS`], oldest first, as (timestamp, offset). recent: VecDeque<(Timestamp, u64)>, - /// `end_offset` of the last closed fight or run; preludes never reach back past it. + /// `end_offset` of the last closed boss pull or run; preludes never reach back past it. + /// Combat pulls leave it alone, so a boss pull keeps the trash before it in its prelude. last_fight_end: u64, - /// Zone of the latest `ZONE_CHANGE`. + /// `end_offset` of the last closed combat pull; combat pull preludes never reach back + /// past it either. + last_combat_end: u64, + /// The last closed boss pull, whose trailing lines start no combat pull. + boss_tail: Option, + dead_enemies: DeadEnemies, + /// Zone, instance ID and difficulty of the latest `ZONE_CHANGE`. zone: Option, + zone_instance_id: u32, + zone_difficulty: u32, + /// Spec of each player's latest `COMBATANT_INFO`, by GUID. + last_specs: HashMap, markers: MarkerState, /// Latest bounds per `MAP_CHANGE` map ID; facts about the map, so never reset. map_bounds: BTreeMap, @@ -53,28 +67,40 @@ impl IndexBuilder { Self { index: LogIndex::empty(), open: None, + combat: None, run: None, held_end: None, recent: VecDeque::new(), last_fight_end: 0, + last_combat_end: 0, + boss_tail: None, + dead_enemies: DeadEnemies::default(), zone: None, + zone_instance_id: 0, + zone_difficulty: 0, + last_specs: HashMap::new(), markers: MarkerState::default(), map_bounds: BTreeMap::new(), last_index: 0, } } - /// Whether a fight is open. Outside fights, callers may feed lines via - /// [`Self::push_skipped`] instead of parsing them, also while a run is open. + /// Whether a boss pull is open. Outside boss pulls, callers may feed lines via + /// [`Self::push_skipped`] instead of parsing them, also while a run or combat pull is + /// open, except damage, miss and death events, which start and end combat pulls. pub fn in_fight(&self) -> bool { self.open.is_some() } - /// Records a line outside fights that was only parsed up to its event name. + /// Records a line outside boss pulls that was only parsed up to its event name. pub fn push_skipped(&mut self, span: LineSpan, timestamp: Timestamp) { self.release_end(None); + self.end_quiet_combat(timestamp); self.index.line_count += 1; self.remember(span, timestamp); + if let Some(combat) = &mut self.combat { + extend(&mut combat.summary, span, timestamp); + } if let Some(run) = &mut self.run { extend(&mut run.summary, span, timestamp); } @@ -93,13 +119,12 @@ impl IndexBuilder { } } } - if let Some(fight) = &mut self.open { - fight.summary.broken_lines += 1; - fight.summary.end_offset = span.next_offset; - } - if let Some(run) = &mut self.run { - run.summary.broken_lines += 1; - run.summary.end_offset = span.next_offset; + let open = self.open.as_mut().map(|fight| &mut fight.summary); + let combat = self.combat.as_mut().map(|combat| &mut combat.summary); + let run = self.run.as_mut().map(|run| &mut run.summary); + for summary in [open, combat, run].into_iter().flatten() { + summary.broken_lines += 1; + summary.end_offset = span.next_offset; } } @@ -107,6 +132,7 @@ impl IndexBuilder { self.index.line_count += 1; self.remember(span, line.timestamp); self.release_end(Some(line)); + self.end_quiet_combat(line.timestamp); // A repeated START of the open key (reconnect, /reload) continues its run. let resumes_run = matches!(&line.event, Event::ChallengeModeStart(start) if self.is_same_key(start, line.timestamp)); // A boss pull open across a reconnect may have ended while the player was offline. @@ -122,6 +148,9 @@ impl IndexBuilder { if !starts_fight && let Some(fight) = &mut self.open { extend(&mut fight.summary, span, line.timestamp); } + if let Some(combat) = &mut self.combat { + extend(&mut combat.summary, span, line.timestamp); + } if !starts_run && let Some(run) = &mut self.run { extend(&mut run.summary, span, line.timestamp); } @@ -140,6 +169,7 @@ impl IndexBuilder { Event::ChallengeModeStart(_) => {} Event::ChallengeModeEnd(end) => self.end_run(end), Event::CombatantInfo(info) => { + self.last_specs.insert(info.guid.to_string(), info.spec_id); if let Some(fight) = &mut self.open { add_combatant(&mut fight.summary.roster, info); } @@ -148,8 +178,14 @@ impl IndexBuilder { } } Event::Combat(event) => { - if let Some(fight) = &mut self.open { - fight.observe(event); + if let CombatKind::UnitDied { unconscious: false } = event.kind + && event.target.is_enemy_npc() + { + self.dead_enemies.record(event.target.guid, line.timestamp); + } + match &mut self.open { + Some(fight) => fight.observe(event), + None => self.observe_combat(span, line.timestamp, event), } } Event::Unhandled { name } => { @@ -198,16 +234,27 @@ impl IndexBuilder { }, ); } - Event::ZoneChange { zone_id, name, .. } => { + Event::ZoneChange { + zone_id, + name, + difficulty, + } => { self.markers.change_zone(line.timestamp, *zone_id); self.zone = Some((*name).to_string()); + self.zone_instance_id = *zone_id; + self.zone_difficulty = *difficulty; } } } - /// Closes a still-open fight and run as incomplete and returns the index. + /// Closes a still-open boss pull and run as incomplete, and a combat pull as incomplete or, + /// once quiet past [`crate::COMBAT_QUIET_MICROS`], as ended, and returns the index. pub fn finish(mut self) -> LogIndex { self.release_end(None); + if let Some(&(latest, _)) = self.recent.back() { + self.end_quiet_combat(latest); + } + self.close_combat(Outcome::Incomplete); self.close_open(Outcome::Incomplete); self.close_run(Outcome::Incomplete); // A run closes after its boss pulls but is numbered before them. @@ -217,8 +264,8 @@ impl IndexBuilder { /// The closed entries that no later line can change, as an index. With `settle_ms`, only /// those with a line more than `settle_ms` past their end, which the analysis may still read; - /// measured as it does, in whole ms from their start against `duration_ms`. Boss pulls of the - /// open run wait for it. + /// measured as it does, in whole ms from their start against `duration_ms`. Boss and combat + /// pulls of the open run wait for it. pub fn settled(&self, settle_ms: Option) -> LogIndex { let open_run = self.run.as_ref().map(|run| run.summary.index); let latest = self.recent.back().map(|&(timestamp, _)| timestamp); @@ -254,8 +301,22 @@ impl IndexBuilder { } /// Ends, at the previous line, what this line leaves behind: leaving the instance or - /// another key ends the open pull and run; a run's END is held while a pull is open. + /// another key ends the open pull and run; a run's END is held while a pull is open. A + /// boss pull, a key's start or end, or leaving the instance ends a combat pull. fn close_before(&mut self, span: LineSpan, line: &LogLine<'_>) { + let ends_combat = match &line.event { + Event::EncounterStart(_) + | Event::ChallengeModeStart(_) + | Event::ChallengeModeEnd(_) => true, + Event::ZoneChange { zone_id, .. } => self + .combat + .as_ref() + .is_some_and(|combat| combat.summary.instance_id != *zone_id), + _ => false, + }; + if ends_combat { + self.close_combat(Outcome::Ended); + } match &line.event { Event::ZoneChange { zone_id, .. } => { if self @@ -399,13 +460,12 @@ impl IndexBuilder { self.last_index } - /// First line within [`PRELUDE_MICROS`] before `span`, never before the end of the last - /// closed fight or run. - fn prelude_offset(&self, span: LineSpan) -> u64 { + /// First line within [`PRELUDE_MICROS`] before `span`, never before `not_before`. + fn prelude_offset(&self, span: LineSpan, not_before: u64) -> u64 { self.recent .front() .map_or(span.offset, |&(_, offset)| offset) - .max(self.last_fight_end) + .max(not_before) } fn is_open_run(&self, instance_id: u32) -> bool { @@ -430,7 +490,7 @@ impl IndexBuilder { fn open_fight(&mut self, span: LineSpan, timestamp: Timestamp, start: &EncounterStart<'_>) { self.close_open(Outcome::Incomplete); let index = self.next_index(); - let prelude_offset = self.prelude_offset(span); + let prelude_offset = self.prelude_offset(span, self.last_fight_end); self.open = Some(OpenFight { summary: FightSummary { index, @@ -454,6 +514,7 @@ impl IndexBuilder { run_index: self.run.as_ref().map(|run| run.summary.index), world_markers: self.markers.active(), map_bounds: self.map_bounds.values().copied().collect(), + combat: None, }, hostile: HashMap::new(), player_names: HashMap::new(), @@ -486,7 +547,7 @@ impl IndexBuilder { /// Opens a run; [`Self::close_before`] has already ended what was open. fn open_run(&mut self, span: LineSpan, timestamp: Timestamp, start: &ChallengeModeStart<'_>) { let index = self.next_index(); - let prelude_offset = self.prelude_offset(span); + let prelude_offset = self.prelude_offset(span, self.last_fight_end); self.run = Some(OpenRun { summary: FightSummary { index, @@ -515,6 +576,7 @@ impl IndexBuilder { run_index: None, world_markers: Vec::new(), map_bounds: Vec::new(), + combat: None, }, player_names: HashMap::new(), last_pull: None, @@ -549,6 +611,10 @@ impl IndexBuilder { } if let Some(fight) = self.open.take() { self.last_fight_end = fight.summary.end_offset; + self.boss_tail = Some(BossTail { + hostile: fight.hostile.keys().cloned().collect(), + end: fight.summary.end, + }); // The index reads only boss pulls in full, so a run's names come from them. if let Some(run) = &mut self.run { for (guid, name) in &fight.player_names { @@ -570,6 +636,88 @@ impl IndexBuilder { self.index.fights.push(run.finish(outcome)); } } + + /// Feeds a combat event outside boss pulls; an exchange between one of the group's players + /// and an enemy NPC that is not spent starts a combat pull. + fn observe_combat(&mut self, span: LineSpan, timestamp: Timestamp, event: &CombatEvent<'_>) { + let exchange = exchange(event); + let spent = exchange + .as_ref() + .is_some_and(|exchange| self.is_spent_enemy(exchange.enemy.guid, timestamp)); + if self.combat.is_none() { + if spent || !exchange.is_some_and(|Exchange { ours, .. }| ours.is_player()) { + return; + } + self.open_combat(span, timestamp); + } + let Some(combat) = &mut self.combat else { + return; + }; + combat.observe(event, span, timestamp, spent); + if let CombatKind::UnitDied { unconscious: false } = event.kind + && let Some(outcome) = combat.on_death(event.target.guid) + { + self.close_combat(outcome); + } + } + + fn open_combat(&mut self, span: LineSpan, timestamp: Timestamp) { + let index = self.next_index(); + let prelude_offset = + self.prelude_offset(span, self.last_fight_end.max(self.last_combat_end)); + self.combat = Some(OpenCombat::new(FightSummary { + index, + encounter_id: 0, + name: String::new(), + difficulty: self.zone_difficulty, + group_size: 0, + instance_id: self.zone_instance_id, + zone: self.zone.clone(), + outcome: Outcome::Incomplete, + start: timestamp, + end: timestamp, + duration_ms: 0, + prelude_offset, + start_offset: span.offset, + end_offset: span.next_offset, + boss_hp_percent: None, + roster: Vec::new(), + broken_lines: 0, + challenge: None, + run_index: self.run.as_ref().map(|run| run.summary.index), + world_markers: self.markers.active(), + map_bounds: self.map_bounds.values().copied().collect(), + combat: None, + })); + } + + /// Whether `guid` is an enemy that died, or a hostile unit of the last boss pull, which + /// ended at most [`BOSS_TAIL_MICROS`] before `timestamp`. + fn is_spent_enemy(&mut self, guid: &str, timestamp: Timestamp) -> bool { + self.dead_enemies.named(guid, timestamp) + || self.boss_tail.as_ref().is_some_and(|tail| { + timestamp.0 - tail.end.0 <= BOSS_TAIL_MICROS && tail.hostile.contains(guid) + }) + } + + /// Ends a combat pull quiet past [`crate::COMBAT_QUIET_MICROS`] before `timestamp`. + fn end_quiet_combat(&mut self, timestamp: Timestamp) { + if self + .combat + .as_ref() + .is_some_and(|combat| combat.quiet_since(timestamp)) + { + self.close_combat(Outcome::Ended); + } + } + + fn close_combat(&mut self, outcome: Outcome) { + if let Some(combat) = self.combat.take() { + let summary = combat.finish(outcome, &self.last_specs); + self.last_combat_end = summary.end_offset; + self.index.fights.push(summary); + } + } } /// Moves an open entry's end to this line; out-of-order timestamps never shrink it. @@ -588,6 +736,12 @@ fn add_combatant(roster: &mut Vec, info: &CombatantInfo<'_>) { } } +#[derive(Clone)] +struct BossTail { + hostile: HashSet, + end: Timestamp, +} + #[derive(Clone)] struct OpenFight { summary: FightSummary, @@ -640,14 +794,11 @@ impl OpenFight { unit.max_hp = info.max_hp; } } - // Support events and the victim-side melee copy repeat hits already counted. - if let CombatKind::Damage(damage) = event.kind - && damage.supporter.is_none() - && damage.via != DamageVia::SwingLanded + if let Some(damage) = counted_damage(event) && event.target.is_hostile() && !event.target.is_player() { - self.hostile_unit(event.target.guid).damage_taken += damage.amount; + self.hostile_unit(event.target.guid).damage_taken += damage; } if let CombatKind::UnitDied { .. } = event.kind && let Some(unit) = self.hostile.get_mut(event.target.guid) @@ -673,7 +824,7 @@ impl OpenFight { } summary.boss_hp_percent = match outcome { Outcome::Kill => Some(0.0), - Outcome::Wipe | Outcome::Incomplete => boss_hp_percent(&self.hostile), + Outcome::Wipe | Outcome::Incomplete | Outcome::Ended => boss_hp_percent(&self.hostile), }; for entry in &mut summary.roster { entry.name = self.player_names.get(&entry.guid).cloned(); @@ -723,7 +874,7 @@ fn run_outcome(end: &ChallengeModeEnd, last_pull: Option) -> Outcome { _ if end.total_time_ms == 0 => false, Some(Outcome::Kill) => true, Some(Outcome::Wipe) => false, - Some(Outcome::Incomplete) | None => end.success, + Some(Outcome::Incomplete | Outcome::Ended) | None => end.success, }; if completed { Outcome::Kill diff --git a/crates/openlogs-index/src/combat.rs b/crates/openlogs-index/src/combat.rs new file mode 100644 index 0000000..79ab8e2 --- /dev/null +++ b/crates/openlogs-index/src/combat.rs @@ -0,0 +1,256 @@ +use std::collections::{HashMap, HashSet}; + +use openlogs_parser::{CombatEvent, CombatKind, DamageVia, Timestamp, Unit}; + +use crate::builder::LineSpan; +use crate::model::{ + COMBAT_QUIET_MICROS, CombatPull, DEAD_ENEMY_MEMORY_MICROS, FightSummary, Outcome, RosterEntry, +}; + +/// A combat pull still going on. +#[derive(Clone)] +pub(crate) struct OpenCombat { + pub(crate) summary: FightSummary, + /// Enemies that traded damage or misses with the group, by GUID. + enemies: HashMap, + /// The group's players seen in the pull, by GUID, and whether they died. + players: HashMap, + in_roster: HashSet, + /// Where an `Ended` pull ends: its last exchange, just past that line, and the broken lines, + /// roster entries and group players up to it. + last_exchange: Timestamp, + last_exchange_end_offset: u64, + broken_at_last_exchange: u64, + roster_at_last_exchange: usize, + players_at_last_exchange: usize, +} + +#[derive(Clone)] +struct Enemy { + name: String, + damage_taken: u64, + dead: bool, + /// Order in which the enemies were engaged; the first one wins a tie on damage. + engaged: usize, +} + +impl OpenCombat { + /// A pull whose first exchange is the line at the start of `summary`. + pub(crate) fn new(summary: FightSummary) -> Self { + Self { + last_exchange: summary.start, + last_exchange_end_offset: summary.end_offset, + broken_at_last_exchange: 0, + roster_at_last_exchange: 0, + players_at_last_exchange: 0, + summary, + enemies: HashMap::new(), + players: HashMap::new(), + in_roster: HashSet::new(), + } + } + + /// A `spent` enemy, dead or trailing the last boss pull, never keeps the pull going: one the + /// pull engaged counts as dead, an exchange with any other is ignored. + pub(crate) fn observe( + &mut self, + event: &CombatEvent<'_>, + span: LineSpan, + timestamp: Timestamp, + spent: bool, + ) { + let exchange = exchange(event); + if spent + && exchange + .as_ref() + .is_some_and(|exchange| !self.enemies.contains_key(exchange.enemy.guid)) + { + return; + } + for unit in [&event.source, &event.target] { + if unit.is_player() + && unit.is_group_combatant() + && !self.players.contains_key(unit.guid) + { + self.players.insert(unit.guid.to_string(), false); + } + } + if !matches!(event.kind, CombatKind::Damage(_) | CombatKind::Missed(_)) { + return; + } + for (player, other) in [ + (&event.source, &event.target), + (&event.target, &event.source), + ] { + if player.is_player() && other.is_enemy_npc() { + self.add_to_roster(player); + } + } + let Some(Exchange { enemy, .. }) = exchange else { + return; + }; + if !spent { + self.last_exchange = self.last_exchange.max(timestamp); + self.last_exchange_end_offset = span.next_offset; + self.broken_at_last_exchange = self.summary.broken_lines; + self.roster_at_last_exchange = self.summary.roster.len(); + self.players_at_last_exchange = self.players.len(); + } + let damage = if enemy.guid == event.target.guid { + counted_damage(event).unwrap_or(0) + } else { + 0 + }; + if !self.enemies.contains_key(enemy.guid) { + let engaged = self.enemies.len(); + self.enemies.insert( + enemy.guid.to_string(), + Enemy { + name: enemy.name.unwrap_or(enemy.guid).to_string(), + damage_taken: 0, + dead: false, + engaged, + }, + ); + } + let engaged = self.enemies.get_mut(enemy.guid).expect("inserted above"); + engaged.damage_taken += damage; + engaged.dead |= spent; + } + + /// The outcome when the death of `guid` ends the pull: all engaged enemies or all of the + /// group's players seen are dead. + pub(crate) fn on_death(&mut self, guid: &str) -> Option { + if let Some(enemy) = self.enemies.get_mut(guid) { + enemy.dead = true; + return self + .enemies + .values() + .all(|enemy| enemy.dead) + .then_some(Outcome::Kill); + } + let dead = self.players.get_mut(guid)?; + *dead = true; + self.players + .values() + .all(|&dead| dead) + .then_some(Outcome::Wipe) + } + + /// Whether more than [`COMBAT_QUIET_MICROS`] passed since the last exchange. + pub(crate) fn quiet_since(&self, timestamp: Timestamp) -> bool { + timestamp.0 - self.last_exchange.0 > COMBAT_QUIET_MICROS + } + + /// An `Ended` pull ends at its last exchange, any other at its latest line. + pub(crate) fn finish(mut self, outcome: Outcome, specs: &HashMap) -> FightSummary { + let summary = &mut self.summary; + summary.outcome = outcome; + if outcome == Outcome::Ended { + summary.end = self.last_exchange; + summary.end_offset = self.last_exchange_end_offset; + summary.broken_lines = self.broken_at_last_exchange; + summary.roster.truncate(self.roster_at_last_exchange); + } + summary.duration_ms = u64::try_from(summary.end.millis_since(summary.start)).unwrap_or(0); + if let Some(top) = self + .enemies + .values() + .max_by_key(|enemy| (enemy.damage_taken, std::cmp::Reverse(enemy.engaged))) + { + summary.name.clone_from(&top.name); + } + summary.combat = Some(CombatPull { + enemy_count: self.enemies.len() as u32, + }); + summary.group_size = if outcome == Outcome::Ended { + self.players_at_last_exchange + } else { + self.players.len() + } as u32; + for entry in &mut summary.roster { + entry.spec_id = specs.get(&entry.guid).copied().unwrap_or(0); + } + self.summary + } + + fn add_to_roster(&mut self, player: &Unit<'_>) { + if !self.in_roster.contains(player.guid) { + self.in_roster.insert(player.guid.to_string()); + self.summary.roster.push(RosterEntry { + guid: player.guid.to_string(), + name: player.name.map(str::to_string), + spec_id: 0, + }); + } + } +} + +/// A damage or miss between the group and an enemy NPC. +pub(crate) struct Exchange<'e, 'a> { + /// The group's player, pet or guardian. + pub(crate) ours: &'e Unit<'a>, + pub(crate) enemy: &'e Unit<'a>, +} + +pub(crate) fn exchange<'e, 'a>(event: &'e CombatEvent<'a>) -> Option> { + if !matches!(event.kind, CombatKind::Damage(_) | CombatKind::Missed(_)) { + return None; + } + let (source, target) = (&event.source, &event.target); + if source.is_group_combatant() && target.is_enemy_npc() { + Some(Exchange { + ours: source, + enemy: target, + }) + } else if target.is_group_combatant() && source.is_enemy_npc() { + Some(Exchange { + ours: target, + enemy: source, + }) + } else { + None + } +} + +/// Enemy NPCs whose death the log showed, by GUID, with the latest death or exchange naming them +/// outside boss pulls. One is forgotten [`DEAD_ENEMY_MEMORY_MICROS`] after that line. +#[derive(Clone, Default)] +pub(crate) struct DeadEnemies(HashMap); + +impl DeadEnemies { + pub(crate) fn record(&mut self, guid: &str, timestamp: Timestamp) { + self.0.retain(|_, seen| !forgotten(*seen, timestamp)); + self.0.insert(guid.to_string(), timestamp); + } + + /// Whether `guid` died, which a line at `timestamp` names. + pub(crate) fn named(&mut self, guid: &str, timestamp: Timestamp) -> bool { + let Some(seen) = self.0.get_mut(guid) else { + return false; + }; + if forgotten(*seen, timestamp) { + self.0.remove(guid); + return false; + } + *seen = (*seen).max(timestamp); + true + } +} + +fn forgotten(seen: Timestamp, now: Timestamp) -> bool { + now.0 - seen.0 > DEAD_ENEMY_MEMORY_MICROS +} + +/// The damage of a hit, `None` for support events and the victim-side melee copy, which +/// repeat hits already counted. +pub(crate) fn counted_damage(event: &CombatEvent<'_>) -> Option { + match event.kind { + CombatKind::Damage(damage) + if damage.supporter.is_none() && damage.via != DamageVia::SwingLanded => + { + Some(damage.amount) + } + _ => None, + } +} diff --git a/crates/openlogs-index/src/lib.rs b/crates/openlogs-index/src/lib.rs index 231379f..3e03bf5 100644 --- a/crates/openlogs-index/src/lib.rs +++ b/crates/openlogs-index/src/lib.rs @@ -2,6 +2,7 @@ mod builder; mod cache; +mod combat; mod markers; mod model; mod scan; diff --git a/crates/openlogs-index/src/model.rs b/crates/openlogs-index/src/model.rs index e9af3c3..7cc31ff 100644 --- a/crates/openlogs-index/src/model.rs +++ b/crates/openlogs-index/src/model.rs @@ -4,7 +4,7 @@ use openlogs_parser::Timestamp; use serde::{Deserialize, Serialize}; /// Bumped whenever the index layout or its rules change; invalidates cached indexes. -pub const INDEX_FORMAT_VERSION: u32 = 13; +pub const INDEX_FORMAT_VERSION: u32 = 14; /// The combat log format this tool is built and tested against. pub const SUPPORTED_LOG_VERSION: u32 = 22; /// Lookback before `ENCOUNTER_START` that belongs to a fight (pre-pots, pre-casts). @@ -18,6 +18,14 @@ pub const END_GRACE_LINES: u32 = 200; /// Longest time since a run's last line after which a repeated `CHALLENGE_MODE_START` of /// its key still continues it (reconnect, /reload); a later one is a new key. pub const RESUME_MAX_GAP_MICROS: i64 = 600_000_000; +/// Time after its last exchange of damage after which a combat pull has ended. +pub const COMBAT_QUIET_MICROS: i64 = 10_000_000; +/// Time after a boss pull's end in which exchanges with its hostile units that did not die are +/// trailing lines of it (a last hit, a DoT tick) and start no combat pull. +pub const BOSS_TAIL_MICROS: i64 = 1_000_000; +/// Time without a line naming a dead enemy after which it is forgotten, which bounds the dead +/// enemies kept. NPC GUIDs are per spawn, so a forgotten one rarely comes back. +pub const DEAD_ENEMY_MEMORY_MICROS: i64 = 60_000_000; /// The game a log comes from, by the `PROJECT_ID` of its header. Only retail is fully /// supported; the others are read with retail's rules. @@ -66,15 +74,16 @@ pub struct LogIndex { pub flavor: Option, pub advanced_logging: bool, pub line_count: u64, - /// Only lines the index parses: inside boss pulls, and meta events everywhere. Other lines - /// outside pulls are skipped unread, so a layout break there goes unnoticed. + /// Only lines the index parses: inside boss pulls, and meta, damage, miss and death events + /// everywhere. Other lines outside boss pulls are skipped unread, so a layout break there + /// goes unnoticed. pub broken_lines: u64, /// Broken lines by event name; lines without a readable name are only in `broken_lines`. pub broken_by_event: BTreeMap, /// Lines inside fights whose event the parser does not model, by event name. pub unhandled_in_fights: BTreeMap, pub warnings: Vec, - /// Boss pulls and Mythic+ runs, in the order of their start lines. + /// Boss pulls, combat pulls and Mythic+ runs, in the order of their start lines. pub fights: Vec, } @@ -96,10 +105,17 @@ impl LogIndex { } } -/// One boss pull, or a whole Mythic+ run when `challenge` is set. A run spans -/// `CHALLENGE_MODE_START` to `CHALLENGE_MODE_END`; it has encounter ID 0, the dungeon as -/// `name` and `zone`, difficulty [`MYTHIC_KEYSTONE_DIFFICULTY`], its roster size as -/// `group_size` and no boss HP. Its boss pulls are entries of their own with `run_index`. +/// One boss pull, a combat pull when `combat` is set, or a whole Mythic+ run when `challenge` +/// is set. A run spans `CHALLENGE_MODE_START` to `CHALLENGE_MODE_END`; it has encounter ID 0, +/// the dungeon as `name` and `zone`, difficulty [`MYTHIC_KEYSTONE_DIFFICULTY`], its roster size +/// as `group_size` and no boss HP. Its boss and combat pulls are entries of their own with +/// `run_index`. +/// +/// A combat pull is a fight outside boss encounters, from the first exchange of damage between +/// the group and an enemy NPC. It has encounter ID 0, the enemy that took the most damage from +/// the group as `name`, difficulty and instance of the latest `ZONE_CHANGE`, the number of the +/// group's players as `group_size`, no boss HP, and every player who fought an enemy NPC +/// meanwhile, outsiders included, in its roster. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct FightSummary { /// 1-based position of the start line in the file; a run comes before its boss pulls. @@ -109,7 +125,7 @@ pub struct FightSummary { pub difficulty: u32, pub group_size: u32, pub instance_id: u32, - /// Zone of the last `ZONE_CHANGE` before `ENCOUNTER_START`, if any; a run's dungeon. + /// Zone of the last `ZONE_CHANGE` before the start line, if any; a run's dungeon. pub zone: Option, /// For a run: `Kill` = completed (`CHALLENGE_MODE_END` after a killed last boss pull), /// `Wipe` = not completed (any other end, or a logged time of 0), `Incomplete` = no @@ -130,7 +146,7 @@ pub struct FightSummary { pub broken_lines: u64, /// Key details when this entry is a whole Mythic+ run. pub challenge: Option, - /// `index` of the Mythic+ run this boss pull belongs to. + /// `index` of the Mythic+ run this boss or combat pull belongs to. pub run_index: Option, /// World markers active at the start line, sorted by marker; empty for runs. #[serde(default)] @@ -139,6 +155,14 @@ pub struct FightSummary { /// map ID; empty for runs. #[serde(default)] pub map_bounds: Vec, + /// Set when this entry is a combat pull. + pub combat: Option, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +pub struct CombatPull { + /// Enemy NPCs that traded damage or misses with the group. + pub enemy_count: u32, } #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] @@ -163,6 +187,11 @@ impl FightSummary { pub fn is_run(&self) -> bool { self.challenge.is_some() } + + /// Whether this entry is a combat pull outside boss encounters. + pub fn is_combat(&self) -> bool { + self.combat.is_some() + } } /// Key details of a Mythic+ run from `CHALLENGE_MODE_START` and `CHALLENGE_MODE_END`. @@ -179,9 +208,11 @@ pub struct ChallengeMode { pub enum Outcome { Kill, Wipe, - /// No matching `ENCOUNTER_END` or `CHALLENGE_MODE_END` (crash, disconnect, log still - /// being written). + /// No matching `ENCOUNTER_END` or `CHALLENGE_MODE_END`, or a combat pull still going on + /// (crash, disconnect, log still being written). Incomplete, + /// A combat pull that ended after quiet time. + Ended, } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/openlogs-index/src/scan.rs b/crates/openlogs-index/src/scan.rs index d1327af..5d59735 100644 --- a/crates/openlogs-index/src/scan.rs +++ b/crates/openlogs-index/src/scan.rs @@ -20,13 +20,33 @@ const META_EVENTS: [&str; 9] = [ "MAP_CHANGE", ]; +/// Events that start and end combat pulls outside boss pulls. `_SUPPORT` copies repeat hits +/// already logged, and environmental damage has no enemy. +const COMBAT_PULL_EVENTS: [&str; 15] = [ + "SWING_DAMAGE", + "SWING_DAMAGE_LANDED", + "SWING_MISSED", + "RANGE_DAMAGE", + "RANGE_MISSED", + "SPELL_DAMAGE", + "SPELL_MISSED", + "SPELL_PERIODIC_DAMAGE", + "SPELL_PERIODIC_MISSED", + "SPELL_BUILDING_DAMAGE", + "SPELL_BUILDING_MISSED", + "DAMAGE_SHIELD", + "DAMAGE_SHIELD_MISSED", + "DAMAGE_SPLIT", + "UNIT_DIED", +]; + /// A longer line is no combat log line. It counts as broken instead of being kept, which bounds /// the memory a wrong file (a video, an archive) can take. const MAX_LINE_BYTES: u64 = 1 << 20; /// Indexes a log that arrives in chunks of any size, e.g. while streaming a file. Lines -/// outside fights are only read up to their event name, which keeps indexing fast on -/// trash-heavy logs. +/// outside boss pulls other than meta and combat pull events are only read up to their event +/// name, which keeps indexing fast on trash-heavy logs. #[derive(Clone, Default)] pub struct Indexer { builder: IndexBuilder, @@ -129,7 +149,9 @@ impl Indexer { }; if !self.builder.in_fight() { match parse_header(text) { - Ok((timestamp, name)) if !META_EVENTS.contains(&name) => { + Ok((timestamp, name)) + if !META_EVENTS.contains(&name) && !COMBAT_PULL_EVENTS.contains(&name) => + { self.builder.push_skipped(span, timestamp); return; } diff --git a/crates/openlogs-index/tests/combat_pulls.rs b/crates/openlogs-index/tests/combat_pulls.rs new file mode 100644 index 0000000..0f00050 --- /dev/null +++ b/crates/openlogs-index/tests/combat_pulls.rs @@ -0,0 +1,503 @@ +use openlogs_index::{CombatPull, FightSummary, Indexer, Outcome, index_bytes}; +use openlogs_parser::Timestamp; + +/// Open world in Tirisfal Glades: the logging rogue kills one Vile Fin Minor Oracle while +/// players outside the group fight Puddlejumpers and Mongrels around them. +const FOREVER: &str = include_str!("fixtures/forever_open_world.txt"); +const MYTHIC_PLUS: &str = include_str!("fixtures/mythic_plus.txt"); +const MINI_RAID: &str = include_str!("fixtures/mini_raid.txt"); + +const FAELAN: Unit = Unit { + guid: "Player-4101-8E8C0182", + name: "Faelan-Emberfall-EU", + flags: "0x512", +}; +const PYRRIN: Unit = Unit { + guid: "Player-4101-77D4A765", + name: "Pyrrin-Emberfall-EU", + flags: "0x514", +}; +const STRANGER: Unit = Unit { + guid: "Player-4101-0A0B0C0D", + name: "Stranger-Emberfall-EU", + flags: "0x518", +}; +const KNIGHT: Unit = Unit { + guid: "Creature-0-3892-2649-1387-206698-0000468001", + name: "Arathi Knight", + flags: "0xa48", +}; +const DAILCRY: Unit = Unit { + guid: "Creature-0-3892-2649-1387-207946-0000468002", + name: "Captain Dailcry", + flags: "0x10a48", +}; +const FOOTMAN: Unit = Unit { + guid: "Creature-0-3892-2649-1387-206699-0000468002", + name: "Arathi Footman", + flags: "0xa48", +}; +const WOLF: Unit = Unit { + guid: "Pet-0-3892-2649-1387-165189-0102C3D4E5", + name: "Wolf", + flags: "0x1111", +}; + +struct Unit { + guid: &'static str, + name: &'static str, + flags: &'static str, +} + +fn hit(ts: &str, source: &Unit, target: &Unit, amount: u64) -> String { + let (s, t) = (source, target); + format!( + "{ts} SPELL_DAMAGE,{},\"{}\",{},0x80000000,{},\"{}\",{},0x80000000,44425,\"Arcane Barrage\",0x40,{},0000000000000000,1000,50000000,0,0,0,0,0,0,1,0,0,0,1590.00,-3.00,2308,1.0000,80,{amount},{amount},-1,64,0,0,0,nil,nil,nil,ST\n", + s.guid, s.name, s.flags, t.guid, t.name, t.flags, t.guid + ) +} + +fn died(ts: &str, unit: &Unit) -> String { + format!( + "{ts} UNIT_DIED,0000000000000000,nil,0x80000000,0x80000000,{},\"{}\",{},0x80000000,0\n", + unit.guid, unit.name, unit.flags + ) +} + +fn buff(ts: &str) -> String { + format!( + "{ts} SPELL_AURA_APPLIED,{},\"{}\",{},0x80000000,{},\"{}\",{},0x80000000,774,\"Rejuvenation\",0x8,BUFF\n", + PYRRIN.guid, PYRRIN.name, PYRRIN.flags, PYRRIN.guid, PYRRIN.name, PYRRIN.flags + ) +} + +fn ts(text: &str) -> Timestamp { + Timestamp::parse(text).unwrap() +} + +fn combat_pulls(fights: &[FightSummary]) -> Vec<&FightSummary> { + fights.iter().filter(|fight| fight.is_combat()).collect() +} + +#[test] +fn forever_open_world_is_one_killed_pull() { + let index = index_bytes(FOREVER.as_bytes()); + assert_eq!(index.broken_lines, 0); + let pulls = combat_pulls(&index.fights); + assert_eq!(pulls.len(), 1, "{:?}", index.fights); + let pull = pulls[0]; + assert_eq!( + (pull.outcome, pull.name.as_str()), + (Outcome::Kill, "Vile Fin Minor Oracle") + ); + assert_eq!(pull.combat, Some(CombatPull { enemy_count: 1 })); + assert!( + (11_700..=11_900).contains(&pull.duration_ms), + "{}", + pull.duration_ms + ); + assert_eq!( + ( + pull.encounter_id, + pull.boss_hp_percent, + pull.instance_id, + pull.zone.as_deref() + ), + (0, None, 0, Some("Tirisfal Glades")) + ); + let roster: Vec<_> = pull + .roster + .iter() + .map(|entry| entry.guid.as_str()) + .collect(); + assert!(roster.contains(&"Player-6949-0066C9DA"), "{roster:?}"); + assert!( + roster.contains(&"Player-6941-006597A9"), + "an outsider fighting a Puddlejumper meanwhile: {roster:?}" + ); +} + +#[test] +fn outsiders_neither_start_nor_hold_a_pull() { + let alone = [ + hit("10/8/2026 20:00:00.0000", &STRANGER, &KNIGHT, 100), + died("10/8/2026 20:00:05.0000", &KNIGHT), + ] + .concat(); + assert!(index_bytes(alone.as_bytes()).fights.is_empty()); + + let beside_us = [ + hit("10/8/2026 20:00:00.0000", &FAELAN, &KNIGHT, 100), + hit("10/8/2026 20:00:08.0000", &STRANGER, &KNIGHT, 100), + hit("10/8/2026 20:00:16.0000", &STRANGER, &KNIGHT, 100), + buff("10/8/2026 20:00:24.0000"), + ] + .concat(); + let index = index_bytes(beside_us.as_bytes()); + assert_eq!(index.fights.len(), 1); + let pull = &index.fights[0]; + assert_eq!( + (pull.outcome, pull.end), + (Outcome::Ended, ts("10/8/2026 20:00:00.0000")) + ); + let roster: Vec<_> = pull + .roster + .iter() + .map(|entry| entry.guid.as_str()) + .collect(); + assert_eq!( + roster, + [FAELAN.guid], + "the outsider fought only after the pull's last exchange" + ); +} + +#[test] +fn packs_with_a_short_gap_are_two_pulls() { + let data = [ + hit("10/8/2026 20:00:00.0000", &FAELAN, &KNIGHT, 100), + died("10/8/2026 20:00:03.0000", &KNIGHT), + hit("10/8/2026 20:00:08.0000", &FAELAN, &FOOTMAN, 100), + died("10/8/2026 20:00:10.0000", &FOOTMAN), + ] + .concat(); + let index = index_bytes(data.as_bytes()); + let pulls: Vec<_> = index + .fights + .iter() + .map(|fight| (fight.index, fight.name.clone(), fight.outcome)) + .collect(); + assert_eq!( + pulls, + [ + (1, "Arathi Knight".to_string(), Outcome::Kill), + (2, "Arathi Footman".to_string(), Outcome::Kill), + ] + ); + assert_eq!( + index.fights[1].prelude_offset, index.fights[0].end_offset, + "a prelude never reaches into the previous pull" + ); +} + +#[test] +fn boss_units_open_no_combat_pull_right_after_the_boss_pull_or_once_dead() { + let data = [ + "10/8/2026 20:01:00.0000 ENCOUNTER_START,2847,\"Captain Dailcry\",8,5,2649 +" + .to_string(), + hit("10/8/2026 20:01:10.0000", &FAELAN, &KNIGHT, 100), + hit("10/8/2026 20:01:20.0000", &FAELAN, &DAILCRY, 100), + died("10/8/2026 20:01:59.0000", &DAILCRY), + "10/8/2026 20:02:00.0000 ENCOUNTER_END,2847,\"Captain Dailcry\",8,5,1,60000 +" + .to_string(), + hit("10/8/2026 20:02:00.0050", &FAELAN, &KNIGHT, 100), + hit("10/8/2026 20:02:05.0000", &DAILCRY, &FAELAN, 100), + hit("10/8/2026 20:02:20.0000", &FAELAN, &KNIGHT, 100), + ] + .concat(); + let index = index_bytes(data.as_bytes()); + let pulls: Vec<_> = combat_pulls(&index.fights) + .iter() + .map(|pull| pull.start) + .collect(); + assert_eq!( + pulls, + [ts("10/8/2026 20:02:20.0000")], + "a living boss unit starts one only past a second after the boss pull, a dead one never" + ); +} + +#[test] +fn a_dead_enemy_neither_opens_nor_holds_a_pull() { + let data = [ + hit("10/8/2026 20:00:00.0000", &FAELAN, &KNIGHT, 100), + died("10/8/2026 20:00:03.0000", &KNIGHT), + hit("10/8/2026 20:00:03.5000", &KNIGHT, &FAELAN, 100), + hit("10/8/2026 20:00:08.0000", &FAELAN, &FOOTMAN, 100), + hit("10/8/2026 20:00:09.0000", &KNIGHT, &FAELAN, 100), + died("10/8/2026 20:00:10.0000", &FOOTMAN), + ] + .concat(); + let index = index_bytes(data.as_bytes()); + let pulls: Vec<_> = index + .fights + .iter() + .map(|fight| (fight.name.as_str(), fight.outcome, fight.start)) + .collect(); + assert_eq!( + pulls, + [ + ( + "Arathi Knight", + Outcome::Kill, + ts("10/8/2026 20:00:00.0000") + ), + ( + "Arathi Footman", + Outcome::Kill, + ts("10/8/2026 20:00:08.0000") + ), + ] + ); + assert_eq!( + index.fights[1].combat, + Some(CombatPull { enemy_count: 1 }), + "the knight of the earlier pull ticking into this one is no enemy of it" + ); + + let ticking = [ + hit("10/8/2026 20:00:00.0000", &FAELAN, &KNIGHT, 100), + hit("10/8/2026 20:00:00.5000", &FAELAN, &FOOTMAN, 100), + died("10/8/2026 20:00:01.0000", &KNIGHT), + hit("10/8/2026 20:00:08.0000", &KNIGHT, &FAELAN, 100), + hit("10/8/2026 20:00:16.0000", &KNIGHT, &FAELAN, 100), + buff("10/8/2026 20:00:20.0000"), + ] + .concat(); + let index = index_bytes(ticking.as_bytes()); + assert_eq!(index.fights.len(), 1); + assert_eq!( + (index.fights[0].outcome, index.fights[0].end), + (Outcome::Ended, ts("10/8/2026 20:00:00.5000")), + "the dead knight's ticks do not keep the escaped footman's pull going" + ); +} + +#[test] +fn only_a_player_of_ours_opens_a_pull() { + let pet_alone = [ + hit("10/8/2026 20:00:00.0000", &KNIGHT, &WOLF, 100), + hit("10/8/2026 20:00:05.0000", &WOLF, &KNIGHT, 100), + buff("10/8/2026 20:00:20.0000"), + ] + .concat(); + assert!(index_bytes(pet_alone.as_bytes()).fights.is_empty()); + + let pet_beside_us = [ + hit("10/8/2026 20:00:00.0000", &FAELAN, &KNIGHT, 100), + hit("10/8/2026 20:00:01.0000", &WOLF, &FOOTMAN, 100), + died("10/8/2026 20:00:02.0000", &KNIGHT), + died("10/8/2026 20:00:03.0000", &FOOTMAN), + ] + .concat(); + let index = index_bytes(pet_beside_us.as_bytes()); + assert_eq!(index.fights.len(), 1); + assert_eq!( + (index.fights[0].outcome, index.fights[0].combat), + (Outcome::Kill, Some(CombatPull { enemy_count: 2 })), + "the pet's enemy belongs to the pull" + ); +} + +#[test] +fn a_pull_is_named_after_the_enemy_that_took_the_most_damage() { + let pull_of = |knight: u64, footman: u64| { + let data = [ + hit("10/8/2026 20:00:00.0000", &FAELAN, &KNIGHT, knight), + hit("10/8/2026 20:00:01.0000", &FAELAN, &FOOTMAN, footman), + died("10/8/2026 20:00:02.0000", &KNIGHT), + died("10/8/2026 20:00:03.0000", &FOOTMAN), + ] + .concat(); + let index = index_bytes(data.as_bytes()); + let pull = &index.fights[0]; + (pull.name.clone(), pull.combat) + }; + let two = Some(CombatPull { enemy_count: 2 }); + assert_eq!(pull_of(100, 300), ("Arathi Footman".to_string(), two)); + assert_eq!( + pull_of(100, 100), + ("Arathi Knight".to_string(), two), + "the first engaged wins a tie" + ); +} + +#[test] +fn a_quiet_pull_ends_ten_seconds_after_the_last_exchange() { + let first = hit("10/8/2026 20:00:00.0000", &FAELAN, &KNIGHT, 100); + let quiet = [first.clone(), buff("10/8/2026 20:00:10.5000")].concat(); + let index = index_bytes(quiet.as_bytes()); + assert_eq!(index.fights.len(), 1); + let pull = &index.fights[0]; + assert_eq!( + (pull.outcome, pull.end, pull.duration_ms, pull.end_offset), + ( + Outcome::Ended, + ts("10/8/2026 20:00:00.0000"), + 0, + first.len() as u64 + ) + ); + + let mut indexer = Indexer::new(); + indexer.feed([first, buff("10/8/2026 20:00:09.5000")].concat().as_bytes()); + assert!(indexer.settled_index(None).fights.is_empty(), "still open"); + let index = indexer.finish(); + assert_eq!(index.fights.len(), 1); + assert_eq!(index.fights[0].outcome, Outcome::Incomplete); +} + +#[test] +fn a_quiet_pull_settles_once_a_line_comes_ten_seconds_later() { + let mut indexer = Indexer::new(); + indexer.feed(hit("10/8/2026 20:00:00.0000", &FAELAN, &KNIGHT, 100).as_bytes()); + assert!(indexer.settled_index(Some(1000)).fights.is_empty()); + indexer.feed(buff("10/8/2026 20:00:10.5000").as_bytes()); + let settled = indexer.settled_index(Some(1000)); + assert_eq!(settled.fights.len(), 1); + assert_eq!(settled.fights[0].outcome, Outcome::Ended); +} + +#[test] +fn our_players_all_dead_is_a_wipe() { + let data = [ + hit("10/8/2026 20:00:00.0000", &FAELAN, &KNIGHT, 100), + hit("10/8/2026 20:00:01.0000", &PYRRIN, &KNIGHT, 100), + hit("10/8/2026 20:00:02.0000", &KNIGHT, &FAELAN, 100), + died("10/8/2026 20:00:04.0000", &FAELAN), + hit("10/8/2026 20:00:05.0000", &KNIGHT, &PYRRIN, 100), + died("10/8/2026 20:00:07.0000", &PYRRIN), + hit("10/8/2026 20:00:08.0000", &STRANGER, &KNIGHT, 100), + ] + .concat(); + let index = index_bytes(data.as_bytes()); + assert_eq!(index.fights.len(), 1); + let pull = &index.fights[0]; + assert_eq!( + (pull.outcome, pull.end, pull.duration_ms), + (Outcome::Wipe, ts("10/8/2026 20:00:07.0000"), 7_000) + ); +} + +#[test] +fn encounter_start_closes_an_open_combat_pull() { + let data = [ + hit("10/8/2026 20:00:00.0000", &FAELAN, &KNIGHT, 100), + "10/8/2026 20:00:03.0000 ENCOUNTER_START,2847,\"Captain Dailcry\",8,5,2649\n".to_string(), + hit("10/8/2026 20:00:10.0000", &FAELAN, &KNIGHT, 100), + "10/8/2026 20:01:03.0000 ENCOUNTER_END,2847,\"Captain Dailcry\",8,5,1,60000\n".to_string(), + ] + .concat(); + let index = index_bytes(data.as_bytes()); + assert_eq!(index.fights.len(), 2); + let (pull, boss) = (&index.fights[0], &index.fights[1]); + assert_eq!( + (pull.is_combat(), pull.outcome, pull.end), + (true, Outcome::Ended, ts("10/8/2026 20:00:00.0000")) + ); + assert_eq!( + ( + boss.is_combat(), + boss.index, + boss.outcome, + boss.duration_ms, + boss.prelude_offset + ), + (false, 2, Outcome::Kill, 60_000, 0) + ); +} + +#[test] +fn trash_in_a_run_keeps_the_run_result() { + let end = "10/8/2026 20:10:00.0000 CHALLENGE_MODE_END"; + let trash = hit("10/8/2026 20:09:58.0000", &FAELAN, &KNIGHT, 100); + let data = MYTHIC_PLUS.replacen(end, &format!("{trash}{end}"), 1); + let index = index_bytes(data.as_bytes()); + let run = index.fights.iter().find(|fight| fight.is_run()).unwrap(); + assert_eq!(run.outcome, Outcome::Kill); + let last = combat_pulls(&index.fights).pop().unwrap(); + assert_eq!( + ( + last.start, + last.outcome, + last.run_index, + last.difficulty, + last.instance_id + ), + ( + ts("10/8/2026 20:09:58.0000"), + Outcome::Ended, + Some(run.index), + 8, + 2649 + ) + ); +} + +#[test] +fn combat_pulls_take_the_last_known_spec() { + let data = [ + "10/7/2026 19:03:02.0762 ENCOUNTER_START,3492,\"Ula'tek\",15,23,3004\n", + "10/7/2026 19:03:02.0762 COMBATANT_INFO,Player-4101-8E8C0182,1,100,200,300,400,0,0,0,0,10,10,10,0,92,1025,1025,1025,230,807,110,110,110,2726,62,[(90269,112121,1)],(0,0,0,0),[(249976,330,(),(7364,0),())],[Player-4101-77D4A765,1126,1],57,0,0,0\n", + "10/7/2026 19:04:02.0762 ENCOUNTER_END,3492,\"Ula'tek\",15,23,0,60000\n", + &hit("10/7/2026 19:05:00.0000", &FAELAN, &KNIGHT, 100), + &hit("10/7/2026 19:05:01.0000", &KNIGHT, &PYRRIN, 100), + ] + .concat(); + let index = index_bytes(data.as_bytes()); + let pull = combat_pulls(&index.fights)[0]; + let specs: Vec<_> = pull + .roster + .iter() + .map(|entry| (entry.guid.as_str(), entry.name.as_deref(), entry.spec_id)) + .collect(); + assert_eq!( + specs, + [ + (FAELAN.guid, Some(FAELAN.name), 62), + (PYRRIN.guid, Some(PYRRIN.name), 0), + ] + ); +} + +#[test] +fn boss_pulls_are_unchanged() { + let index = index_bytes(MINI_RAID.as_bytes()); + let offset_of = |prefix: &str| MINI_RAID.find(prefix).unwrap() as u64; + let bosses: Vec<_> = index + .fights + .iter() + .filter(|fight| !fight.is_combat()) + .map(|fight| { + ( + fight.index, + fight.outcome, + fight.duration_ms, + fight.boss_hp_percent.map(|hp| hp.round() as u32), + fight.prelude_offset, + fight.end_offset, + ) + }) + .collect(); + assert_eq!( + bosses, + [ + ( + 1, + Outcome::Wipe, + 60_000, + Some(75), + offset_of("10/7/2026 19:02:50.0000"), + offset_of("10/7/2026 19:10:00.0000") + ), + ( + 2, + Outcome::Wipe, + 19, + None, + offset_of("10/7/2026 19:10:00.0000"), + offset_of("10/7/2026 19:20:00.0000") + ), + ( + 3, + Outcome::Incomplete, + 30_500, + Some(50), + offset_of("10/7/2026 19:20:00.0000"), + MINI_RAID.len() as u64 + ), + ] + ); +} diff --git a/crates/openlogs-index/tests/fixtures/forever_open_world.txt b/crates/openlogs-index/tests/fixtures/forever_open_world.txt new file mode 100644 index 0000000..ace9638 --- /dev/null +++ b/crates/openlogs-index/tests/fixtures/forever_open_world.txt @@ -0,0 +1,174 @@ +11/5/2026 02:45:20.8301 COMBAT_LOG_VERSION,22,ADVANCED_LOG_ENABLED,1,BUILD_VERSION,1.60.1,PROJECT_ID,18 +11/5/2026 02:45:20.8301 ZONE_CHANGE,0,"Tirisfal Glades",0 +11/5/2026 02:45:20.8301 MAP_CHANGE,1420,"Tirisfal Glades",3837.499756,824.999939,3033.333252,-1485.416626 +11/5/2026 02:45:21.1071 SPELL_PERIODIC_HEAL,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,20578,"Cannibalize",0x1,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,115,204,0,2996.69,169.26,1420,1.0574,0,13,13,13,0,nil +11/5/2026 02:45:21.1071 SPELL_PERIODIC_ENERGIZE,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,20578,"Cannibalize",0x1,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,115,204,0,2996.69,169.26,1420,1.0574,0,14.0000,0.0000,0,204 +11/5/2026 02:45:21.2591 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1675-00016BDE2C,"Rot Hide Mongrel",0xa28,0x80000000,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,Player-6939-002654D1,0000000000000000,139,167,84,0,202,0,0,0,3,54,100,0,2859.70,409.70,1420,1.5951,1,9,11,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:21.3631 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1675-00006BDE3F,"Rot Hide Mongrel",0xa28,0x80000000,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,Player-6939-002654D1,0000000000000000,128,167,84,0,202,0,0,0,3,54,100,0,2859.70,409.70,1420,1.5951,1,11,13,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:21.5991 SWING_DAMAGE,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1675-00016BDE2C,"Rot Hide Mongrel",0xa28,0x80000000,Player-6939-002654D1,0000000000000000,128,167,84,0,202,0,0,0,3,66,100,0,2859.98,411.15,1420,1.0861,1,8,9,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:21.5991 SPELL_ENERGIZE,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,1757,"Sinister Strike",0x1,Player-6939-002654D1,0000000000000000,128,167,84,0,202,0,0,0,3,66,100,0,2859.98,411.15,1420,1.0861,1,1.0000,0.0000,4,5 +11/5/2026 02:45:21.5991 SPELL_CAST_SUCCESS,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1675-00016BDE2C,"Rot Hide Mongrel",0xa28,0x80000000,1757,"Sinister Strike",0x1,Player-6939-002654D1,0000000000000000,128,167,84,0,202,0,0,0,3,66,100,45,2859.98,411.15,1420,1.0861,1 +11/5/2026 02:45:21.5991 SPELL_CAST_START,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,0000000000000000,nil,0x80000000,0x80000000,5019,"Shoot",0x1 +11/5/2026 02:45:22.0451 RANGE_DAMAGE,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,151,156,25,0,322,0,0,0,1,0,0,0,2985.89,198.88,1420,2.1616,8,5,4,-1,64,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:22.1431 SPELL_MISSED,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,1260198,"Touch of the Grave",0x20,MISS,nil,ST +11/5/2026 02:45:22.1431 SPELL_CAST_SUCCESS,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Player-6945-0018C45F,0000000000000000,207,207,39,0,98,0,0,0,0,349,349,0,2982.89,227.97,1420,4.3621,3 +11/5/2026 02:45:22.1431 SPELL_ENERGIZE,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,100,"Charge",0x1,Player-6941-006597A9,0000000000000000,143,243,115,0,461,0,0,0,1,90,1000,0,2984.89,221.06,1420,4.5996,2,9.0000,0.0000,1,1000 +11/5/2026 02:45:22.1431 SPELL_CAST_SUCCESS,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,100,"Charge",0x1,Player-6941-006597A9,0000000000000000,143,243,115,0,461,0,0,0,1,90,1000,0,2984.89,221.06,1420,4.5996,2 +11/5/2026 02:45:22.1441 SPELL_AURA_APPLIED,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,7922,"Charge Stun",0x1,DEBUFF +11/5/2026 02:45:22.8011 SPELL_CAST_START,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,0000000000000000,nil,0x80000000,0x80000000,9532,"Lightning Bolt",0x8 +11/5/2026 02:45:23.0361 SPELL_PERIODIC_HEAL,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,20578,"Cannibalize",0x1,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,145,204,0,2996.69,169.26,1420,1.0574,0,13,13,13,0,nil +11/5/2026 02:45:23.0361 SPELL_PERIODIC_ENERGIZE,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,20578,"Cannibalize",0x1,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,145,204,0,2996.69,169.26,1420,1.0574,0,15.0000,0.0000,0,204 +11/5/2026 02:45:23.0361 SPELL_AURA_REMOVED,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,20578,"Cannibalize",0x1,BUFF +11/5/2026 02:45:23.1401 SPELL_CAST_START,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,0000000000000000,nil,0x80000000,0x80000000,5019,"Shoot",0x1 +11/5/2026 02:45:23.1401 SPELL_AURA_REMOVED,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,7922,"Charge Stun",0x1,DEBUFF +11/5/2026 02:45:23.1401 SWING_DAMAGE,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,0000000000000000,143,243,115,0,461,0,0,0,1,162,1000,0,2984.64,202.73,1420,4.9529,2,15,19,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:23.1401 SWING_DAMAGE,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,151,156,25,0,322,0,0,0,1,0,0,0,2985.45,199.55,1420,2.1520,8,10,13,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:23.1401 SWING_DAMAGE_LANDED,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,136,156,25,0,322,0,0,0,1,0,0,0,2985.45,199.55,1420,2.1520,8,15,19,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:23.1401 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Player-6941-006597A9,0000000000000000,133,243,115,0,461,0,0,0,1,175,1000,0,2984.64,202.73,1420,4.9529,2,10,13,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:23.1401 SWING_DAMAGE,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1675-00006BDE3F,"Rot Hide Mongrel",0xa28,0x80000000,Player-6939-002654D1,0000000000000000,128,167,84,0,202,0,0,0,3,29,100,0,2861.90,411.63,1420,1.2326,1,15,10,-1,1,0,0,0,1,nil,nil +11/5/2026 02:45:23.2751 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1675-00016BDE2C,"Rot Hide Mongrel",0xa28,0x80000000,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,Player-6939-002654D1,0000000000000000,120,167,84,0,202,0,0,0,3,29,100,0,2861.90,411.63,1420,1.2326,1,8,9,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:23.2751 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1675-00006BDE3F,"Rot Hide Mongrel",0xa28,0x80000000,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,Player-6939-002654D1,0000000000000000,109,167,84,0,202,0,0,0,3,29,100,0,2861.90,411.63,1420,1.2326,1,11,13,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:23.3991 SPELL_AURA_REMOVED,Player-6947-0066B6FD,"Corwin-Highcliff-Normal-EU",0x518,0x80000000,Player-6947-0066B6FD,"Corwin-Highcliff-Normal-EU",0x518,0x80000000,21084,"Seal of Righteousness",0x2,BUFF +11/5/2026 02:45:23.6161 RANGE_DAMAGE,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,130,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,6,6,-1,64,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:23.6161 SPELL_CAST_SUCCESS,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Player-6945-0018C45F,0000000000000000,207,207,39,0,98,0,0,0,0,349,349,0,2982.89,227.97,1420,4.3621,3 +11/5/2026 02:45:23.6161 SPELL_CAST_SUCCESS,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,772,"Rend",0x1,Player-6941-006597A9,0000000000000000,134,243,115,0,461,0,0,0,1,175,1000,100,2984.64,202.73,1420,4.9529,2 +11/5/2026 02:45:23.6161 SPELL_AURA_APPLIED,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,772,"Rend",0x1,DEBUFF +11/5/2026 02:45:24.1721 SPELL_ENERGIZE,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,1757,"Sinister Strike",0x1,Player-6939-002654D1,0000000000000000,109,167,84,0,202,0,0,0,3,47,100,0,2863.84,410.98,1420,1.2815,1,1.0000,0.0000,4,5 +11/5/2026 02:45:24.1721 SPELL_CAST_SUCCESS,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1675-00016BDE2C,"Rot Hide Mongrel",0xa28,0x80000000,1757,"Sinister Strike",0x1,Player-6939-002654D1,0000000000000000,109,167,84,0,202,0,0,0,3,47,100,45,2863.84,410.98,1420,1.2815,1 +11/5/2026 02:45:24.6041 SPELL_CAST_START,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,0000000000000000,nil,0x80000000,0x80000000,5019,"Shoot",0x1 +11/5/2026 02:45:24.7881 SWING_DAMAGE,Player-6939-002654D1,"Tessa-Duskhollow-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1675-00016BDE2C,"Rot Hide Mongrel",0xa28,0x80000000,Player-6939-002654D1,0000000000000000,109,167,84,0,202,0,0,0,3,4,100,0,2863.84,410.98,1420,1.2815,1,8,10,0,1,0,0,0,nil,nil,nil +11/5/2026 02:45:24.9111 SPELL_ENERGIZE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,1776,"Gouge",0x1,Player-6949-0066C9DA,0000000000000000,184,184,89,0,161,0,0,0,3,100,100,0,2912.15,215.46,1420,4.2973,1,1.0000,0.0000,4,5 +11/5/2026 02:45:24.9121 SPELL_CAST_SUCCESS,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1776,"Gouge",0x1,Player-6949-0066C9DA,0000000000000000,184,184,89,0,161,0,0,0,3,100,100,45,2912.15,215.46,1420,4.2973,1 +11/5/2026 02:45:24.9121 SPELL_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1776,"Gouge",0x1,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,146,156,23,0,260,0,0,0,0,165,165,0,2911.08,213.45,1420,1.1924,8,10,12,-1,1,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:24.9121 SPELL_AURA_APPLIED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,1324481,"Gouge",0x1,BUFF +11/5/2026 02:45:24.9131 SPELL_AURA_APPLIED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1776,"Gouge",0x1,DEBUFF +11/5/2026 02:45:25.0161 RANGE_DAMAGE,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,125,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,5,5,-1,64,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:25.1381 SPELL_CAST_SUCCESS,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Player-6945-0018C45F,0000000000000000,207,207,39,0,98,0,0,0,0,349,349,0,2982.89,227.97,1420,4.3621,3 +11/5/2026 02:45:25.2401 SWING_DAMAGE,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,0000000000000000,134,243,115,0,461,0,0,0,1,148,1000,0,2984.64,202.73,1420,5.3041,2,15,19,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:25.2401 SWING_DAMAGE,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,125,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,9,12,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:25.2401 SWING_DAMAGE_LANDED,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,110,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,15,19,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:25.2401 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Player-6941-006597A9,0000000000000000,126,243,115,0,461,0,0,0,1,160,1000,0,2984.64,202.73,1420,5.3041,2,9,12,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:25.7271 SPELL_AURA_REMOVED,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,21084,"Seal of Righteousness",0x2,BUFF +11/5/2026 02:45:25.7271 SPELL_AURA_APPLIED,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,21084,"Seal of Righteousness",0x2,BUFF +11/5/2026 02:45:25.7271 SPELL_CAST_SUCCESS,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,0000000000000000,nil,0x80000000,0x80000000,21084,"Seal of Righteousness",0x2,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,170,204,20,2993.48,167.86,1420,3.8045,0 +11/5/2026 02:45:26.1201 SPELL_CAST_START,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,0000000000000000,nil,0x80000000,0x80000000,5019,"Shoot",0x1 +11/5/2026 02:45:26.2221 SWING_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,0000000000000000,184,184,89,0,161,0,0,0,3,58,100,0,2911.70,214.47,1420,4.2757,1,10,11,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:26.2221 SPELL_AURA_REMOVED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,1324481,"Gouge",0x1,BUFF +11/5/2026 02:45:26.2221 SPELL_AURA_BROKEN,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1776,"Gouge",0x1,DEBUFF +11/5/2026 02:45:26.2221 SPELL_AURA_REMOVED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1776,"Gouge",0x1,DEBUFF +11/5/2026 02:45:26.2221 SWING_DAMAGE,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,146,156,23,0,260,0,0,0,0,165,165,0,2911.08,213.45,1420,1.1924,8,9,10,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:26.2221 SWING_DAMAGE_LANDED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,136,156,23,0,260,0,0,0,0,165,165,0,2911.08,213.45,1420,1.1924,8,10,11,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:26.2231 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Player-6949-0066C9DA,0000000000000000,175,184,89,0,161,0,0,0,3,58,100,0,2911.70,214.47,1420,4.2757,1,9,10,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:26.4591 SPELL_AURA_APPLIED,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,324,"Lightning Shield",0x8,BUFF +11/5/2026 02:45:26.4591 SPELL_CAST_SUCCESS,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,0000000000000000,nil,0x80000000,0x80000000,324,"Lightning Shield",0x8,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,136,156,23,0,260,0,0,0,0,165,165,45,2911.08,213.45,1420,1.1924,8 +11/5/2026 02:45:26.5621 RANGE_DAMAGE,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,106,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,4,4,-1,64,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:26.6871 SPELL_CAST_SUCCESS,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Player-6945-0018C45F,0000000000000000,207,207,39,0,98,0,0,0,0,349,349,0,2982.89,227.97,1420,4.3621,3 +11/5/2026 02:45:26.6871 SPELL_PERIODIC_DAMAGE,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,772,"Rend",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,99,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,7,6,-1,1,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:27.3061 SWING_DAMAGE,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,99,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,9,12,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:27.3061 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Player-6941-006597A9,0000000000000000,117,243,115,0,461,0,0,0,1,171,1000,0,2984.64,202.73,1420,5.3041,2,9,12,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:27.3061 SPELL_CAST_SUCCESS,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,284,"Heroic Strike",0x1,Player-6941-006597A9,0000000000000000,118,243,115,0,461,0,0,0,1,171,1000,150,2984.64,202.73,1420,5.3041,2 +11/5/2026 02:45:27.3061 SPELL_DAMAGE,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,284,"Heroic Strike",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,69,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,30,38,-1,1,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:27.6481 SPELL_CAST_START,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,0000000000000000,nil,0x80000000,0x80000000,5019,"Shoot",0x1 +11/5/2026 02:45:27.7531 SPELL_ENERGIZE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,1757,"Sinister Strike",0x1,Player-6949-0066C9DA,0000000000000000,175,184,89,0,161,0,0,0,3,83,100,0,2911.70,214.47,1420,4.2757,1,1.0000,0.0000,4,5 +11/5/2026 02:45:27.7541 SPELL_CAST_SUCCESS,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1757,"Sinister Strike",0x1,Player-6949-0066C9DA,0000000000000000,175,184,89,0,161,0,0,0,3,83,100,45,2911.70,214.47,1420,4.2757,1 +11/5/2026 02:45:27.7541 SPELL_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1757,"Sinister Strike",0x1,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,106,156,23,0,260,0,0,0,0,120,165,0,2911.08,213.45,1420,1.1924,8,30,18,-1,1,0,0,0,1,nil,nil,ST +11/5/2026 02:45:27.7541 SWING_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,0000000000000000,175,184,89,0,161,0,0,0,3,38,100,0,2911.70,214.47,1420,4.2757,1,9,12,-1,1,0,0,0,nil,1,nil +11/5/2026 02:45:27.7541 SPELL_AURA_REMOVED_DOSE,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,324,"Lightning Shield",0x8,BUFF,2 +11/5/2026 02:45:27.7541 SWING_DAMAGE_LANDED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,97,156,23,0,260,0,0,0,0,120,165,0,2911.08,213.45,1420,1.1924,8,9,12,-1,1,0,0,0,nil,1,nil +11/5/2026 02:45:27.7541 SPELL_MISSED,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,26364,"Lightning Shield",0x8,MISS,nil,ST +11/5/2026 02:45:27.8351 SPELL_CAST_FAILED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,0000000000000000,nil,0x80000000,0x80000000,1757,"Sinister Strike",0x1,"Not yet recovered" +11/5/2026 02:45:27.9181 SWING_DAMAGE,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-0045A21C,0000000000000000,203,203,125,0,308,0,0,0,1,236,1000,0,2975.52,186.38,1420,2.7356,0,21,28,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:27.9181 SWING_DAMAGE_LANDED,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,0000000000000000,135,156,25,0,322,0,0,0,1,0,0,0,2972.54,187.63,1420,5.8868,8,21,28,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:28.1101 RANGE_DAMAGE,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,61,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,8,7,-1,64,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:28.1101 SWING_MISSED,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,MISS,nil +11/5/2026 02:45:28.1101 SPELL_CAST_SUCCESS,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Player-6945-0018C45F,0000000000000000,207,207,39,0,98,0,0,0,0,349,349,0,2982.89,227.97,1420,4.3621,3 +11/5/2026 02:45:28.1101 SPELL_CAST_SUCCESS,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,772,"Rend",0x1,Player-6941-0045A21C,0000000000000000,203,203,125,0,308,0,0,0,1,236,1000,100,2975.52,186.38,1420,2.7356,0 +11/5/2026 02:45:28.1101 SPELL_AURA_APPLIED,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,772,"Rend",0x1,DEBUFF +11/5/2026 02:45:28.2101 SPELL_DAMAGE,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,1260198,"Touch of the Grave",0x20,Creature-0-6846-0-240-1543-0000EBDF6C,0000000000000000,125,156,25,0,322,0,0,0,1,0,0,0,2972.54,187.63,1420,5.8868,8,10,10,-1,32,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:28.2101 SPELL_HEAL,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,1260198,"Touch of the Grave",0x20,Player-6941-0045A21C,0000000000000000,203,203,125,0,308,0,0,0,1,136,1000,0,2975.52,186.38,1420,2.7356,0,10,10,10,0,nil +11/5/2026 02:45:28.2101 SWING_DAMAGE,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,97,156,23,0,260,0,0,0,0,120,165,0,2911.08,213.45,1420,1.1924,8,9,11,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:28.2101 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Player-6949-0066C9DA,0000000000000000,166,184,89,0,161,0,0,0,3,38,100,0,2911.70,214.47,1420,4.2757,1,9,11,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:28.9241 SPELL_CAST_START,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,0000000000000000,nil,0x80000000,0x80000000,9532,"Lightning Bolt",0x8 +11/5/2026 02:45:29.1821 SPELL_CAST_START,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,0000000000000000,nil,0x80000000,0x80000000,5019,"Shoot",0x1 +11/5/2026 02:45:29.2861 SWING_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,0000000000000000,166,184,89,0,161,0,0,0,3,38,100,0,2911.70,214.47,1420,4.2757,1,10,11,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:29.2861 SWING_DAMAGE_LANDED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,87,156,23,0,260,0,0,0,0,120,165,0,2911.08,213.45,1420,1.1007,8,10,11,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:29.2861 SWING_DAMAGE,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,61,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,7,10,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:29.2861 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Player-6941-006597A9,0000000000000000,111,243,115,0,461,0,0,0,1,30,1000,0,2984.64,202.73,1420,5.3041,2,7,10,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:29.5141 SWING_DAMAGE,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,0000000000000000,111,243,115,0,461,0,0,0,1,103,1000,0,2984.64,202.73,1420,5.3041,2,15,19,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:29.5141 SWING_DAMAGE_LANDED,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,46,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,15,19,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:29.6181 RANGE_DAMAGE,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,38,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,8,7,-1,64,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:29.6181 SPELL_CAST_SUCCESS,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Player-6945-0018C45F,0000000000000000,207,207,39,0,98,0,0,0,0,349,349,0,2982.89,227.97,1420,4.3621,3 +11/5/2026 02:45:29.6181 SPELL_PERIODIC_DAMAGE,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,772,"Rend",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,31,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,7,6,-1,1,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:29.7341 SWING_DAMAGE,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,150,204,0,2975.68,184.26,1420,1.5827,0,17,21,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:29.7341 SWING_DAMAGE_LANDED,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,0000000000000000,108,156,25,0,322,0,0,0,1,0,0,0,2972.54,187.63,1420,5.8868,8,17,21,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:29.7341 SPELL_CAST_SUCCESS,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,679,"Holy Strike",0x2,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,150,204,5,2975.68,184.26,1420,1.5827,0 +11/5/2026 02:45:29.7341 SPELL_MISSED,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,679,"Holy Strike",0x2,PARRY,nil,ST +11/5/2026 02:45:29.7341 SPELL_DAMAGE,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,25741,"Seal of Righteousness",0x2,Creature-0-6846-0-240-1543-0000EBDF6C,0000000000000000,101,156,25,0,322,0,0,0,1,0,0,0,2972.54,187.63,1420,5.8868,8,7,7,-1,2,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:30.1151 SWING_DAMAGE,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,0000000000000000,101,156,25,0,322,0,0,0,1,0,0,0,2972.54,187.63,1420,5.8868,8,10,13,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:30.1151 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Player-6941-0045A21C,0000000000000000,193,203,125,0,308,0,0,0,1,147,1000,0,2974.90,186.65,1420,2.7356,0,10,13,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:30.4551 SPELL_CAST_SUCCESS,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,20271,"Judgement",0x2,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,145,204,9,2973.68,186.76,1420,2.5434,0 +11/5/2026 02:45:30.4551 SPELL_DAMAGE,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,20187,"Judgement of Righteousness",0x2,Creature-0-6846-0-240-1543-0000EBDF6C,0000000000000000,77,156,25,0,322,0,0,0,1,0,0,0,2972.54,187.63,1420,5.8868,8,24,24,-1,2,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:30.5671 SPELL_ENERGIZE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,1757,"Sinister Strike",0x1,Player-6949-0066C9DA,0000000000000000,166,184,89,0,161,0,0,0,3,66,100,0,2911.70,214.47,1420,4.2757,1,1.0000,0.0000,4,5 +11/5/2026 02:45:30.5681 SPELL_CAST_SUCCESS,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1757,"Sinister Strike",0x1,Player-6949-0066C9DA,0000000000000000,166,184,89,0,161,0,0,0,3,66,100,45,2911.70,214.47,1420,4.2757,1 +11/5/2026 02:45:30.5681 SPELL_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1757,"Sinister Strike",0x1,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,74,156,23,0,260,0,0,0,0,120,165,0,2911.08,213.45,1420,1.1007,8,13,16,-1,1,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:30.6851 SPELL_CAST_FAILED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,0000000000000000,nil,0x80000000,0x80000000,1757,"Sinister Strike",0x1,"Not yet recovered" +11/5/2026 02:45:30.7111 SPELL_CAST_START,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,0000000000000000,nil,0x80000000,0x80000000,5019,"Shoot",0x1 +11/5/2026 02:45:30.7111 SWING_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,0000000000000000,166,184,89,0,161,0,0,0,3,21,100,0,2911.70,214.47,1420,4.2757,1,7,8,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:30.7111 SWING_DAMAGE_LANDED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,67,156,23,0,260,0,0,0,0,120,165,0,2911.08,213.45,1420,1.1007,8,7,8,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:31.1251 RANGE_DAMAGE,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,26,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,5,5,-1,64,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:31.1251 SWING_DAMAGE,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-0045A21C,0000000000000000,193,203,125,0,308,0,0,0,1,435,1000,0,2974.90,186.65,1420,2.7356,0,48,31,-1,1,0,0,0,1,nil,nil +11/5/2026 02:45:31.1251 SWING_DAMAGE_LANDED,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,0000000000000000,29,156,25,0,322,0,0,0,1,0,0,0,2972.54,187.63,1420,5.8868,8,48,31,-1,1,0,0,0,1,nil,nil +11/5/2026 02:45:31.1251 SPELL_PERIODIC_DAMAGE,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,772,"Rend",0x1,Creature-0-6846-0-240-1543-0000EBDF6C,0000000000000000,16,156,25,0,322,0,0,0,1,0,0,0,2972.54,187.63,1420,5.8868,8,13,6,-1,1,0,0,0,1,nil,nil,ST +11/5/2026 02:45:31.1251 SPELL_CAST_SUCCESS,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Player-6945-0018C45F,0000000000000000,207,207,39,0,98,0,0,0,0,349,349,0,2982.89,227.97,1420,4.3621,3 +11/5/2026 02:45:31.2571 SWING_DAMAGE,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,26,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,9,13,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:31.2571 SWING_DAMAGE_LANDED,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Player-6941-006597A9,0000000000000000,102,243,115,0,461,0,0,0,1,114,1000,0,2984.64,202.73,1420,5.3041,2,9,13,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:31.6111 SWING_MISSED,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,DODGE,nil +11/5/2026 02:45:31.9241 SPELL_CAST_SUCCESS,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,9532,"Lightning Bolt",0x8,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,67,156,23,0,260,0,0,0,0,122,165,90,2911.08,213.45,1420,1.1007,8 +11/5/2026 02:45:32.0221 SPELL_DAMAGE,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,9532,"Lightning Bolt",0x8,Player-6949-0066C9DA,0000000000000000,138,184,89,0,161,0,0,0,3,29,100,0,2911.70,214.47,1420,4.2757,1,28,28,-1,8,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:32.1691 SPELL_CAST_START,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,0000000000000000,nil,0x80000000,0x80000000,5019,"Shoot",0x1 +11/5/2026 02:45:32.2941 SWING_MISSED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,DODGE,nil +11/5/2026 02:45:32.5831 SPELL_CAST_START,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,0000000000000000,nil,0x80000000,0x80000000,9532,"Lightning Bolt",0x8 +11/5/2026 02:45:32.5831 RANGE_DAMAGE,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,21,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,5,5,-1,64,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:32.7081 SPELL_PERIODIC_DAMAGE,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,772,"Rend",0x1,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,14,156,25,0,322,0,0,0,1,0,0,0,2986.69,200.04,1420,2.2216,8,7,6,-1,1,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:32.7081 SPELL_AURA_REMOVED,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,772,"Rend",0x1,DEBUFF +11/5/2026 02:45:32.7081 SPELL_CAST_SUCCESS,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,5019,"Shoot",0x1,Player-6945-0018C45F,0000000000000000,207,207,39,0,98,0,0,0,0,349,349,0,2982.89,227.97,1420,4.3621,3 +11/5/2026 02:45:33.1841 SWING_DAMAGE,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,136,204,0,2973.84,185.78,1420,4.8747,0,17,21,1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:33.1841 SPELL_AURA_REMOVED,Player-6941-0045A21C,"Gorvan-Ironvale-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,772,"Rend",0x1,DEBUFF +11/5/2026 02:45:33.1841 SWING_DAMAGE_LANDED,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,0000000000000000,0,156,25,0,322,0,0,0,1,0,0,0,2973.10,183.08,1420,4.7124,8,17,21,1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:33.1841 UNIT_DIED,0000000000000000,nil,0x80000000,0x80000000,Creature-0-6846-0-240-1543-0000EBDF6C,"Vile Fin Puddlejumper",0xa48,0x80000000,0 +11/5/2026 02:45:33.6161 SPELL_CAST_SUCCESS,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,6760,"Eviscerate",0x1,Player-6949-0066C9DA,0000000000000000,138,184,89,0,161,0,0,0,3|4,51|3,100|5,35|3,2911.70,214.47,1420,4.2757,1 +11/5/2026 02:45:33.6161 SPELL_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,6760,"Eviscerate",0x1,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,32,156,23,0,260,0,0,0,0,79,165,0,2911.08,213.45,1420,1.1007,8,35,43,-1,1,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:33.6161 SPELL_AURA_REMOVED_DOSE,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,324,"Lightning Shield",0x8,BUFF,1 +11/5/2026 02:45:33.6171 SPELL_DAMAGE,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,26364,"Lightning Shield",0x8,Player-6949-0066C9DA,0000000000000000,125,184,89,0,161,0,0,0,3,16,100,0,2911.70,214.47,1420,4.2757,1,13,13,-1,8,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:33.6171 SWING_DAMAGE,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6941-006597A9,0000000000000000,104,243,115,0,461,0,0,0,1,187,1000,0,2984.64,202.73,1420,5.3041,2,14,18,0,1,0,0,0,nil,nil,nil +11/5/2026 02:45:33.6931 SPELL_CAST_FAILED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,0000000000000000,nil,0x80000000,0x80000000,6760,"Eviscerate",0x1,"Not yet recovered" +11/5/2026 02:45:33.7161 SPELL_CAST_START,Player-6945-0018C45F,"Wenna-Brightmoor-Normal-EU",0x518,0x80000000,0000000000000000,nil,0x80000000,0x80000000,5019,"Shoot",0x1 +11/5/2026 02:45:33.7161 SWING_DAMAGE_LANDED,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,0000000000000000,0,156,25,0,322,0,0,0,1,0,0,0,2984.74,200.50,1420,3.3269,8,14,18,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:33.7161 UNIT_DIED,0000000000000000,nil,0x80000000,0x80000000,Creature-0-6846-0-240-1543-00006BDF7F,"Vile Fin Puddlejumper",0xa48,0x80000000,0 +11/5/2026 02:45:33.7161 SWING_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,0000000000000000,125,184,89,0,161,0,0,0,3,16,100,0,2911.70,214.47,1420,4.2757,1,7,8,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:33.7161 SWING_DAMAGE_LANDED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,25,156,23,0,260,0,0,0,0,79,165,0,2911.08,213.45,1420,1.1007,8,7,8,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:34.1921 SPELL_DAMAGE,Creature-0-6846-0-240-1544-00006BDBF5,"Vile Fin Minor Oracle",0xa28,0x80000000,Player-6937-0058E8D5,"Liora-Fenmere-Normal-EU",0x518,0x80000000,9532,"Lightning Bolt",0x8,Player-6937-0058E8D5,0000000000000000,214,243,132,0,364,0,0,0,1,96,1000,0,2911.78,95.32,1420,2.8569,0,29,29,-1,8,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:35.2311 SWING_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,0000000000000000,125,184,89,0,161,0,0,0,3,16,100,0,2911.70,214.47,1420,4.2757,1,8,9,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:35.2321 SWING_DAMAGE_LANDED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,17,156,23,0,260,0,0,0,0,79,165,0,2911.08,213.45,1420,1.1007,8,8,9,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:35.3351 SPELL_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1260198,"Touch of the Grave",0x20,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,7,156,23,0,260,0,0,0,0,79,165,0,2911.08,213.45,1420,1.1007,8,10,9,-1,32,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:35.3351 SPELL_HEAL,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,1260198,"Touch of the Grave",0x20,Player-6949-0066C9DA,0000000000000000,135,184,89,0,161,0,0,0,3,33,100,0,2911.70,214.47,1420,4.2757,1,10,10,0,0,nil +11/5/2026 02:45:35.5811 SPELL_CAST_SUCCESS,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,9532,"Lightning Bolt",0x8,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,7,156,23,0,260,0,0,0,0,79,165,90,2911.08,213.45,1420,1.1007,8 +11/5/2026 02:45:35.5821 SPELL_DAMAGE,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,9532,"Lightning Bolt",0x8,Player-6949-0066C9DA,0000000000000000,109,184,89,0,161,0,0,0,3,34,100,0,2911.70,214.47,1420,4.2757,1,26,26,-1,8,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:35.6901 SPELL_AURA_REMOVED,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,21084,"Seal of Righteousness",0x2,BUFF +11/5/2026 02:45:35.6901 SPELL_AURA_APPLIED,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,21084,"Seal of Righteousness",0x2,BUFF +11/5/2026 02:45:35.6901 SPELL_CAST_SUCCESS,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,0000000000000000,nil,0x80000000,0x80000000,21084,"Seal of Righteousness",0x2,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,144,204,20,2964.27,183.26,1420,3.1649,0 +11/5/2026 02:45:35.7371 SPELL_CAST_FAILED,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,0000000000000000,nil,0x80000000,0x80000000,1757,"Sinister Strike",0x1,"Not enough energy" +11/5/2026 02:45:36.7271 SPELL_ENERGIZE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,1757,"Sinister Strike",0x1,Player-6949-0066C9DA,0000000000000000,109,184,89,0,161,0,0,0,3,47,100,0,2911.70,214.47,1420,3.1457,1,1.0000,0.0000,4,5 +11/5/2026 02:45:36.7271 SPELL_CAST_SUCCESS,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1757,"Sinister Strike",0x1,Player-6949-0066C9DA,0000000000000000,109,184,89,0,161,0,0,0,3,47,100,45,2911.70,214.47,1420,3.1457,1 +11/5/2026 02:45:36.7281 SPELL_AURA_REMOVED,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,324,"Lightning Shield",0x8,BUFF +11/5/2026 02:45:36.7281 PARTY_KILL,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,0 +11/5/2026 02:45:36.7281 SPELL_DAMAGE,Player-6949-0066C9DA,"Ravel-Ashwood-Normal-EU",0x511,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,1757,"Sinister Strike",0x1,Creature-0-6846-0-240-1544-00016BDF9A,0000000000000000,0,156,23,0,260,0,0,0,0,0,165,0,2910.43,214.52,1420,2.1118,8,14,17,7,1,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:36.7281 UNIT_DIED,0000000000000000,nil,0x80000000,0x80000000,Creature-0-6846-0-240-1544-00016BDF9A,"Vile Fin Minor Oracle",0x10a48,0x80000000,0 +11/5/2026 02:45:36.8401 SWING_DAMAGE,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF9A,"Vile Fin Puddlejumper",0xa48,0x80000000,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,124,204,0,2956.32,183.98,1420,3.0471,0,17,21,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:36.8401 SWING_DAMAGE_LANDED,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF9A,"Vile Fin Puddlejumper",0xa48,0x80000000,Creature-0-6846-0-240-1543-0000EBDF9A,0000000000000000,139,156,25,0,322,0,0,0,1,0,0,0,2950.26,185.06,1420,6.1144,8,17,21,-1,1,0,0,0,nil,nil,nil +11/5/2026 02:45:36.8401 SPELL_DAMAGE,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF9A,"Vile Fin Puddlejumper",0xa48,0x80000000,25741,"Seal of Righteousness",0x2,Creature-0-6846-0-240-1543-0000EBDF9A,0000000000000000,132,156,25,0,322,0,0,0,1,0,0,0,2950.26,185.06,1420,6.1144,8,7,7,-1,2,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:36.8401 SPELL_DAMAGE,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF9A,"Vile Fin Puddlejumper",0xa48,0x80000000,1260198,"Touch of the Grave",0x20,Creature-0-6846-0-240-1543-0000EBDF9A,0000000000000000,122,156,25,0,322,0,0,0,1,0,0,0,2950.26,185.06,1420,6.1144,8,10,9,-1,32,0,0,0,nil,nil,nil,ST +11/5/2026 02:45:36.9401 SPELL_HEAL,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,Player-6855-00084911,"Mordak-Stonereach-Normal-EU",0x518,0x80000000,1260198,"Touch of the Grave",0x20,Player-6855-00084911,0000000000000000,194,194,100,0,401,0,0,0,0,124,204,0,2955.59,184.05,1420,3.0471,0,10,10,10,0,nil +11/5/2026 02:45:37.3181 SPELL_ENERGIZE,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,100,"Charge",0x1,Player-6941-006597A9,0000000000000000,117,243,115,0,461,0,0,0,1,226,1000,0,2970.12,203.07,1420,3.8920,2,9.0000,0.0000,1,1000 +11/5/2026 02:45:37.3191 SPELL_CAST_SUCCESS,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF9A,"Vile Fin Puddlejumper",0xa48,0x80000000,100,"Charge",0x1,Player-6941-006597A9,0000000000000000,117,243,115,0,461,0,0,0,1,226,1000,0,2970.12,203.07,1420,3.8920,2 +11/5/2026 02:45:37.3191 SPELL_AURA_APPLIED,Player-6941-006597A9,"Brakk-Thornfield-Normal-EU",0x518,0x80000000,Creature-0-6846-0-240-1543-0000EBDF9A,"Vile Fin Puddlejumper",0xa48,0x80000000,7922,"Charge Stun",0x1,DEBUFF diff --git a/crates/openlogs-index/tests/index_runs.rs b/crates/openlogs-index/tests/index_runs.rs index 9928518..58b670d 100644 --- a/crates/openlogs-index/tests/index_runs.rs +++ b/crates/openlogs-index/tests/index_runs.rs @@ -1,5 +1,6 @@ use openlogs_index::{ - ChallengeMode, MYTHIC_KEYSTONE_DIFFICULTY, Outcome, RosterEntry, difficulty_label, index_bytes, + ChallengeMode, FightSummary, LogIndex, MYTHIC_KEYSTONE_DIFFICULTY, Outcome, RosterEntry, + difficulty_label, index_bytes, }; use openlogs_parser::Timestamp; @@ -15,6 +16,15 @@ fn ts(text: &str) -> Timestamp { Timestamp::parse(text).unwrap() } +/// Boss pulls and runs, without the combat pulls among them. +fn entries(index: &LogIndex) -> Vec<&FightSummary> { + index + .fights + .iter() + .filter(|fight| !fight.is_combat()) + .collect() +} + fn key_start(ts: &str) -> String { format!("{ts} CHALLENGE_MODE_START,\"Priory of the Sacred Flame\",2649,499,12,[10,147,9]\n") } @@ -47,7 +57,7 @@ fn a_run_is_indexed_with_its_key_its_roster_and_its_prelude() { assert!(index.warnings.is_empty(), "{:?}", index.warnings); assert_eq!(index.broken_lines, 0); assert!(index.unhandled_in_fights.is_empty()); - assert_eq!(index.fights.len(), 4); + assert_eq!(entries(&index).len(), 4); let run = &index.fights[0]; assert!(run.is_run()); @@ -124,7 +134,7 @@ fn a_run_is_indexed_with_its_key_its_roster_and_its_prelude() { #[test] fn boss_pulls_of_a_run_come_after_it_and_know_it() { let index = index_bytes(FIXTURE.as_bytes()); - let pulls: Vec<_> = index.fights[1..] + let pulls: Vec<_> = entries(&index)[1..] .iter() .map(|f| { ( @@ -140,12 +150,12 @@ fn boss_pulls_of_a_run_come_after_it_and_know_it() { assert_eq!( pulls, [ - (2, "Captain Dailcry", Outcome::Kill, 60_000, Some(1), false), - (3, "Baron Braunpyke", Outcome::Wipe, 30_000, Some(1), false), - (4, "Baron Braunpyke", Outcome::Kill, 60_000, Some(1), false), + (3, "Captain Dailcry", Outcome::Kill, 60_000, Some(1), false), + (5, "Baron Braunpyke", Outcome::Wipe, 30_000, Some(1), false), + (6, "Baron Braunpyke", Outcome::Kill, 60_000, Some(1), false), ] ); - let wipe = &index.fights[2]; + let wipe = entries(&index)[2]; assert!((wipe.boss_hp_percent.unwrap() - 87.5).abs() < 0.01); assert_eq!(difficulty_label(wipe.difficulty), Some("Mythic+")); assert_eq!(wipe.roster.len(), 2); diff --git a/crates/openlogs-index/tests/run_semantics.rs b/crates/openlogs-index/tests/run_semantics.rs index 83721d4..dea96a4 100644 --- a/crates/openlogs-index/tests/run_semantics.rs +++ b/crates/openlogs-index/tests/run_semantics.rs @@ -2,7 +2,7 @@ //! means, whether a reconnect or /reload writes `CHALLENGE_MODE_START` again, and whether //! the run's end can come before the last `ENCOUNTER_END` of the same moment. -use openlogs_index::{END_GRACE_LINES, LogIndex, Outcome, index_bytes}; +use openlogs_index::{END_GRACE_LINES, FightSummary, LogIndex, Outcome, index_bytes}; use openlogs_parser::Timestamp; /// A +12 Priory of the Sacred Flame: Captain Dailcry (kill), Baron Braunpyke (wipe, then @@ -18,12 +18,13 @@ const OFFLINE_WIPE: &str = include_str!("fixtures/mythic_plus_offline_wipe.txt") /// The fixture with the run's end at 20:07:00, logged before the boss's death and the /// Baron kill of the same moment; the group leaves at 20:12. const END_FIRST: &str = include_str!("fixtures/mythic_plus_end_first.txt"); -/// (index, is run, outcome, run index) of the fixture's entries. +/// (index, is run, outcome, run index) of the fixture's run and boss pulls; trash pulls take +/// indices 2 and 4. const FIXTURE_ROWS: [(u32, bool, Outcome, Option); 4] = [ (1, true, Outcome::Kill, None), - (2, false, Outcome::Kill, Some(1)), - (3, false, Outcome::Wipe, Some(1)), - (4, false, Outcome::Kill, Some(1)), + (3, false, Outcome::Kill, Some(1)), + (5, false, Outcome::Wipe, Some(1)), + (6, false, Outcome::Kill, Some(1)), ]; const END: &str = "10/8/2026 20:10:00.0000 CHALLENGE_MODE_END"; const LAST_KILL: &str = "10/8/2026 20:07:00.0000 ENCOUNTER_END"; @@ -32,12 +33,20 @@ fn ts(text: &str) -> Timestamp { Timestamp::parse(text).unwrap() } -/// (index, is run, outcome, run index) per entry. +/// (index, is run, outcome, run index) per run and boss pull. fn rows(index: &LogIndex) -> Vec<(u32, bool, Outcome, Option)> { + entries(index) + .iter() + .map(|f| (f.index, f.is_run(), f.outcome, f.run_index)) + .collect() +} + +/// Boss pulls and runs, without the combat pulls among them. +fn entries(index: &LogIndex) -> Vec<&FightSummary> { index .fights .iter() - .map(|f| (f.index, f.is_run(), f.outcome, f.run_index)) + .filter(|fight| !fight.is_combat()) .collect() } @@ -216,7 +225,7 @@ fn a_repeated_start_of_the_same_key_continues_the_run_and_its_open_pull() { ) ); - let wipe = &index.fights[2]; + let wipe = entries(&index)[2]; assert_eq!( (wipe.name.as_str(), wipe.outcome, wipe.duration_ms, wipe.end), ( @@ -294,7 +303,7 @@ fn the_same_key_after_its_end_starts_a_new_run() { fn the_last_pull_keeps_its_kill_when_its_end_follows_the_run_end_in_the_same_moment() { let index = index_bytes(END_FIRST.as_bytes()); assert_eq!(rows(&index), FIXTURE_ROWS); - let (run, kill) = (&index.fights[0], &index.fights[3]); + let (run, kill) = (&index.fights[0], entries(&index)[3]); assert_eq!( (kill.duration_ms, kill.boss_hp_percent, kill.end), (60_000, Some(0.0), ts("10/8/2026 20:07:00.0000")) @@ -471,12 +480,12 @@ fn a_pull_whose_end_was_missed_offline_ends_where_the_key_was_started_again() { rows(&index), [ (1, true, Outcome::Kill, None), - (2, false, Outcome::Kill, Some(1)), - (3, false, Outcome::Incomplete, Some(1)), - (4, false, Outcome::Kill, Some(1)), + (3, false, Outcome::Kill, Some(1)), + (5, false, Outcome::Incomplete, Some(1)), + (6, false, Outcome::Kill, Some(1)), ] ); - let wipe = &index.fights[2]; + let wipe = entries(&index)[2]; assert_eq!( (wipe.end, wipe.duration_ms, wipe.end_offset), ( diff --git a/crates/openlogs-parser/src/event.rs b/crates/openlogs-parser/src/event.rs index 358d398..402048a 100644 --- a/crates/openlogs-parser/src/event.rs +++ b/crates/openlogs-parser/src/event.rs @@ -118,6 +118,18 @@ pub struct CombatantInfo<'a> { pub spec_id: u32, } +/// `COMBATLOG_OBJECT_*` bits of a unit's flags. +pub mod unit_flags { + pub const TYPE_PET: u32 = 0x1000; + pub const TYPE_GUARDIAN: u32 = 0x2000; + /// Affiliation mine | party | raid. + pub const AFFILIATION_GROUP: u32 = 0x7; + pub const REACTION_FRIENDLY: u32 = 0x10; + pub const REACTION_NEUTRAL: u32 = 0x20; + pub const REACTION_HOSTILE: u32 = 0x40; + pub const CONTROL_NPC: u32 = 0x200; +} + #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Unit<'a> { pub guid: &'a str, @@ -138,7 +150,27 @@ impl Unit<'_> { /// `COMBATLOG_OBJECT_REACTION_HOSTILE`. pub fn is_hostile(&self) -> bool { - self.flags & 0x40 != 0 + self.flags & unit_flags::REACTION_HOSTILE != 0 + } + + /// Affiliation mine, party or raid. + pub fn in_group(&self) -> bool { + self.flags & unit_flags::AFFILIATION_GROUP != 0 + } + + /// A player, or a pet or guardian, of the logging player's group. + pub fn is_group_combatant(&self) -> bool { + self.in_group() + && (self.is_player() + || self.flags & (unit_flags::TYPE_PET | unit_flags::TYPE_GUARDIAN) != 0) + } + + /// An NPC-controlled, hostile or neutral unit outside our group. + pub fn is_enemy_npc(&self) -> bool { + !self.is_player() + && !self.in_group() + && self.flags & unit_flags::CONTROL_NPC != 0 + && self.flags & (unit_flags::REACTION_HOSTILE | unit_flags::REACTION_NEUTRAL) != 0 } } diff --git a/crates/openlogs-parser/tests/events_combat.rs b/crates/openlogs-parser/tests/events_combat.rs index 57645c2..59afcf8 100644 --- a/crates/openlogs-parser/tests/events_combat.rs +++ b/crates/openlogs-parser/tests/events_combat.rs @@ -578,3 +578,28 @@ fn forever_lines_have_the_retail_layout() { }; assert_eq!((heal.amount, heal.overheal, heal.critical), (10, 10, false)); } + +#[test] +fn unit_flags_tell_our_group_from_enemy_npcs() { + let player = "Player-4103-63B5FD29"; + let npc = "Creature-0-3892-3004-1387-257758-00004679D4"; + let pet = "Pet-0-3892-3004-1387-257758-00004679D4"; + let unit = |guid, flags| Unit { + guid, + name: None, + flags, + raid_flags: 0, + }; + + for flags in [0x511, 0x512] { + assert!(unit(player, flags).is_group_combatant()); + } + assert!(!unit(player, 0x518).is_group_combatant()); + assert!(unit(pet, 0x1111).is_group_combatant()); + + for flags in [0xa48, 0xa28, 0x10a48] { + assert!(unit(npc, flags).is_enemy_npc()); + } + assert!(!unit(npc, 0xa18).is_enemy_npc()); + assert!(!unit(player, 0x511).is_enemy_npc()); +} diff --git a/crates/openlogs-service/src/log_dto.rs b/crates/openlogs-service/src/log_dto.rs index d5016ec..ee3d23a 100644 --- a/crates/openlogs-service/src/log_dto.rs +++ b/crates/openlogs-service/src/log_dto.rs @@ -13,6 +13,7 @@ pub enum OutcomeDto { Kill, Wipe, Incomplete, + Ended, } impl From for OutcomeDto { @@ -20,6 +21,7 @@ impl From for OutcomeDto { match outcome { Outcome::Kill => Self::Kill, Outcome::Wipe => Self::Wipe, + Outcome::Ended => Self::Ended, Outcome::Incomplete => Self::Incomplete, } } @@ -101,7 +103,14 @@ pub struct RunDto { pub timer: Option, } -/// A boss pull or a whole Mythic+ run; both open the same way by `index`. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct CombatDto { + /// Enemies fought, the one the row is named after included. + pub enemy_count: u32, +} + +/// A boss pull, a combat pull or a whole Mythic+ run; all open the same way by `index`. #[derive(Debug, Clone, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct FightRow { @@ -118,8 +127,10 @@ pub struct FightRow { pub zone: Option, /// Set when the row is a whole Mythic+ run; its boss pulls are rows of their own. pub run: Option, - /// `index` of the run this boss pull belongs to. + /// `index` of the run this boss or combat pull belongs to. pub run_index: Option, + /// Set when the row is a combat pull; `None` for boss pulls and runs. + pub combat: Option, } #[derive(Debug, Clone, PartialEq, Serialize)] @@ -176,6 +187,9 @@ pub fn fight_row( timer: result.timer.map(Into::into), }), run_index: fight.run_index, + combat: fight.combat.as_ref().map(|combat| CombatDto { + enemy_count: combat.enemy_count, + }), } } diff --git a/crates/openlogs-service/src/overview_dto.rs b/crates/openlogs-service/src/overview_dto.rs index 2dcd3de..f5ad828 100644 --- a/crates/openlogs-service/src/overview_dto.rs +++ b/crates/openlogs-service/src/overview_dto.rs @@ -2,7 +2,7 @@ use std::collections::BTreeMap; use openlogs_analysis::{ ActorId, ContextItem, ContextState, Death, DeathContext, Fight, Hit, NO_SPELL, NOBODY, - PhaseKind, QuickOverview, SpellId, + PhaseKind, QuickOverview, SpellId, listed_player, }; use openlogs_gamedata::{ConsumableKind, CooldownCategory, Curated, Role}; use serde::Serialize; @@ -454,7 +454,7 @@ pub fn quick_overview_dto( let mut player_ids: Vec = fight .actors .players() - .filter(|p| p.spec_id.is_some()) + .filter(|p| listed_player(fight, p.id)) .map(|p| p.id) .collect(); for id in overview @@ -569,7 +569,7 @@ pub fn quick_overview_dto( pub fn player_ref(fight: &Fight, id: ActorId) -> PlayerRef { let actor = fight.actors.get(id); let spec = actor.spec_id.and_then(openlogs_gamedata::spec); - let class = spec.and_then(|spec| openlogs_gamedata::class(spec.class_id)); + let class = actor.class().and_then(openlogs_gamedata::class); PlayerRef { actor_id: id, name: actor.name.clone().unwrap_or_else(|| actor.guid.clone()), diff --git a/crates/openlogs-service/src/player_dto.rs b/crates/openlogs-service/src/player_dto.rs index 2ba170f..698df45 100644 --- a/crates/openlogs-service/src/player_dto.rs +++ b/crates/openlogs-service/src/player_dto.rs @@ -2,7 +2,7 @@ use std::collections::BTreeMap; use openlogs_analysis::{ AbilityLink, ActorId, ActorKind, BuffKind, CastKind, EBON_MIGHT, Fight, Metric, NOBODY, - PlayerDetail, SpellId, + PlayerDetail, SpellId, listed_player, }; use openlogs_gamedata::{ConsumableKind, Curated}; use serde::{Deserialize, Serialize}; @@ -406,12 +406,12 @@ pub fn player_detail_dto( spells.entry(id).or_insert(spell); } - // Players with a spec for the switcher, plus every player the page names (an Evoker or - // buff source without COMBATANT_INFO would otherwise show as "?"). + // Listed players for the switcher, plus every player the page names (an Evoker or buff + // source without COMBATANT_INFO would otherwise show as "?"). let mut roster: Vec = fight .actors .players() - .filter(|actor| actor.spec_id.is_some()) + .filter(|actor| listed_player(fight, actor.id)) .map(|actor| player_ref(fight, actor.id)) .collect(); for player in referenced { diff --git a/crates/openlogs-service/src/set_merge.rs b/crates/openlogs-service/src/set_merge.rs index bff40fb..e0b6a37 100644 --- a/crates/openlogs-service/src/set_merge.rs +++ b/crates/openlogs-service/src/set_merge.rs @@ -3,7 +3,7 @@ use std::collections::{BTreeMap, HashMap}; use std::mem::take; use openlogs_analysis::{ - ActorId, COLOR_GROUPS, SpellId, TOP_ABILITIES_PER_GROUP, largest_first, per_second, + ActorId, COLOR_GROUPS, SpellId, TOP_ABILITIES_PER_GROUP, largest_first, per_second, spec_class, }; use serde::Serialize; @@ -396,14 +396,21 @@ fn merge_rows( } } -/// Keeps the later pull's entry unless only an earlier one knows the spec. +/// Keeps the later pull's entry unless only an earlier one knows the spec, or without a known +/// spec the class. fn merge_roster(roster: &mut Vec, next: Vec) { + let knowledge = |player: &PlayerRef| { + ( + spec_class(player.spec_id).is_some(), + player.class_id.is_some(), + ) + }; for player in next { match roster .iter_mut() .find(|known| known.actor_id == player.actor_id) { - Some(known) if known.spec_id.is_some() && player.spec_id.is_none() => {} + Some(known) if knowledge(known) > knowledge(&player) => {} Some(known) => *known = player, None => roster.push(player), } @@ -1402,4 +1409,20 @@ mod tests { assert_eq!(set.overview.kpis.duration_ms, 100_001); assert_eq!(set.overview.timeline.cutoff_ms, None); } + + #[test] + fn a_class_from_casts_in_an_earlier_pull_outlives_a_later_pull_without_one() { + let ravel = |class_id: Option| PlayerRef { + actor_id: 1, + name: "Ravel-Ashwood-EU".into(), + spec_id: None, + spec_name: None, + class_id, + class_token: class_id.map(|_| "ROGUE".into()), + role: None, + }; + let mut roster = vec![ravel(Some(4))]; + merge_roster(&mut roster, vec![ravel(None)]); + assert_eq!(roster, [ravel(Some(4))]); + } } diff --git a/crates/openlogs-service/src/set_merge/deaths.rs b/crates/openlogs-service/src/set_merge/deaths.rs index bf1ba84..2abae58 100644 --- a/crates/openlogs-service/src/set_merge/deaths.rs +++ b/crates/openlogs-service/src/set_merge/deaths.rs @@ -2,7 +2,8 @@ use std::collections::{BTreeMap, BTreeSet}; use std::mem::take; use openlogs_analysis::{ - ActorId, Fight, Hit, ReportFilter, Scope, Side, SpellId, deaths, deaths_report, unit_of, + ActorId, Fight, Hit, ReportFilter, Scope, Side, SpellId, deaths, deaths_report, listed_player, + unit_of, }; use openlogs_gamedata::Curated; use serde::Serialize; @@ -135,7 +136,7 @@ pub fn deaths_set_part( } } -/// Present players are those with COMBATANT_INFO in this pull, plus anyone who died in it. +/// Present players are the listed players of this pull, plus anyone who died in it. fn lifetime(fight: &Fight, filter: &ReportFilter, scope: &Scope) -> Vec { let mut first_deaths: BTreeMap = BTreeMap::new(); for death in deaths(fight).into_iter().filter(|d| filter.contains(d.t)) { @@ -145,7 +146,7 @@ fn lifetime(fight: &Fight, filter: &ReportFilter, scope: &Scope) -> Vec fight .actors .players() - .filter(|p| p.spec_id.is_some() || first_deaths.contains_key(&p.id)) + .filter(|p| listed_player(fight, p.id) || first_deaths.contains_key(&p.id)) .filter(|p| dead_side.accepts(fight, None, None, Some(&unit_of(fight, p.id)))) .map(|p| LifeDto { player: p.id, diff --git a/crates/openlogs-service/src/test_fight.rs b/crates/openlogs-service/src/test_fight.rs index 6ee2643..4424672 100644 --- a/crates/openlogs-service/src/test_fight.rs +++ b/crates/openlogs-service/src/test_fight.rs @@ -1,6 +1,6 @@ //! Hand-built fights for DTO unit tests. -use std::collections::BTreeMap; +use std::collections::{BTreeMap, BTreeSet}; use openlogs_analysis::{ ActorId, Actors, Damage, DamageVia, Event, EventKind, Fight, FightKind, Heal, NOBODY, SpellId, @@ -47,6 +47,7 @@ pub fn fight(actors: Actors, mut events: Vec) -> Fight { logger_turned: Vec::new(), heal_grants: Vec::new(), delayed_hits: Vec::new(), + roster: BTreeSet::new(), } } diff --git a/crates/openlogs-wasm/src/engine.rs b/crates/openlogs-wasm/src/engine.rs index d1946f5..95706b7 100644 --- a/crates/openlogs-wasm/src/engine.rs +++ b/crates/openlogs-wasm/src/engine.rs @@ -1,7 +1,8 @@ use std::collections::BTreeSet; use openlogs_analysis::{ - Actors, Fight, LANDED_MATCH_MS, LANDED_TAIL_BYTES, load_fight_slice, load_fight_slice_with, + Actors, Fight, LANDED_MATCH_MS, LANDED_TAIL_BYTES, infer_classes, load_fight_slice, + load_fight_slice_with, }; use openlogs_gamedata::{ChannelSpells, Curated, DungeonTable, SpellClasses}; use openlogs_index::{FightSummary, Indexer, LogIndex}; @@ -161,7 +162,8 @@ impl Engine { fight_index: u32, ) -> Result<(), String> { let summary = self.summary(fight_index)?.clone(); - let fight = load_fight_slice(part, base_offset, &summary); + let mut fight = load_fight_slice(part, base_offset, &summary); + infer_classes(&mut fight, &self.spell_classes); let cut_tail = base_offset + (part.len() as u64) < summary.end_offset + LANDED_TAIL_BYTES; self.fights.retain(|pulled| pulled.index != fight_index); self.fights.insert( @@ -212,7 +214,9 @@ impl Engine { )); } let summary = summary_of(&self.index, fight_index)?; - let fight = load_fight_slice_with(part, base_offset, summary, pass.actors.carried_over()); + let mut fight = + load_fight_slice_with(part, base_offset, summary, pass.actors.carried_over()); + infer_classes(&mut fight, &self.spell_classes); let mut cuts = PullCuts::new(&fight); for command in &mut pass.commands { command.add(fight_index, &fight, &self.curated, &mut cuts); diff --git a/crates/openlogs-wasm/tests/engine.rs b/crates/openlogs-wasm/tests/engine.rs index 087f2bc..76a4289 100644 --- a/crates/openlogs-wasm/tests/engine.rs +++ b/crates/openlogs-wasm/tests/engine.rs @@ -18,6 +18,16 @@ fn open(log: &str) -> (Engine, Value) { open_with(Engine::default(), log) } +/// The view's runs and boss pulls, without combat pulls. +fn runs_and_boss_pulls(view: &Value) -> Vec<&Value> { + view["fights"] + .as_array() + .unwrap() + .iter() + .filter(|f| f["combat"].is_null()) + .collect() +} + fn open_with(mut engine: Engine, log: &str) -> (Engine, Value) { engine.begin_index(); for chunk in log.as_bytes().chunks(4096) { @@ -665,9 +675,7 @@ fn comparing_pulls_lists_every_player_of_either_pull_while_both_stay_loaded() { #[test] fn opening_a_mythic_plus_log_lists_the_run_and_its_boss_pulls() { let (_, view) = open(MYTHIC_PLUS); - let rows: Vec<_> = view["fights"] - .as_array() - .unwrap() + let rows: Vec<_> = runs_and_boss_pulls(&view) .iter() .map(|f| { ( @@ -687,9 +695,9 @@ fn opening_a_mythic_plus_log_lists_the_run_and_its_boss_pulls() { json!("kill"), Value::Null ), - (json!(2), json!("Captain Dailcry"), json!("kill"), json!(1)), - (json!(3), json!("Baron Braunpyke"), json!("wipe"), json!(1)), - (json!(4), json!("Baron Braunpyke"), json!("kill"), json!(1)), + (json!(3), json!("Captain Dailcry"), json!("kill"), json!(1)), + (json!(5), json!("Baron Braunpyke"), json!("wipe"), json!(1)), + (json!(6), json!("Baron Braunpyke"), json!("kill"), json!(1)), ] ); let run = &view["fights"][0]; @@ -757,7 +765,7 @@ fn dungeon_data_decides_the_result_of_a_run() { assert_eq!(run["outcome"], "wipe", "Prioress Murrpray lives"); assert_eq!(run["run"]["bosses"], json!({ "killed": 2, "total": 3 })); assert_eq!(run["run"]["timer"], Value::Null); - let outcomes: Vec<_> = view["fights"].as_array().unwrap()[1..] + let outcomes: Vec<_> = runs_and_boss_pulls(&view)[1..] .iter() .map(|f| f["outcome"].clone()) .collect(); @@ -830,11 +838,11 @@ fn a_run_opens_like_a_pull_with_boss_phases_and_no_boss_hp() { let second_baron = json!({ "startMs": 360000, "endMs": 420000, "attribution": "augmented", "includeOverkill": false }); assert_eq!(damage(second_baron), 400_000_000); - load(&mut engine, MYTHIC_PLUS, 2); + load(&mut engine, MYTHIC_PLUS, 3); let pull = call( &engine, "quick_overview", - json!({ "fightIndex": 2, "filter": null }), + json!({ "fightIndex": 3, "filter": null }), ); assert!( pull["timeline"]["bossHp"] @@ -845,3 +853,73 @@ fn a_run_opens_like_a_pull_with_boss_phases_and_no_boss_hp() { "a boss pull of the run keeps its boss HP" ); } + +#[test] +fn players_without_a_spec_take_the_class_of_their_casts() { + const OPEN_WORLD: &str = + include_str!("../../openlogs-index/tests/fixtures/forever_open_world.txt"); + let mut engine = Engine::default(); + let charge_and_sinister_strike = + r#"{"classSpells":[100,1657],"crowdControl":[],"families":[4,8]}"#; + engine + .set_spell_classes(charge_and_sinister_strike) + .unwrap(); + let (mut engine, view) = open_with(engine, OPEN_WORLD); + let pull = view["fights"] + .as_array() + .unwrap() + .iter() + .find(|f| !f["combat"].is_null()) + .unwrap()["index"] + .as_u64() + .unwrap() as u32; + let class_of = |report: &Value, name: &str| { + report["roster"] + .as_array() + .unwrap() + .iter() + .find(|p| p["name"] == name) + .unwrap()["classId"] + .clone() + }; + + load(&mut engine, OPEN_WORLD, pull); + let single = call( + &engine, + "damage_done_report", + json!({ "fightIndex": pull, "filter": whole_pull() }), + ); + let set = feed_set(&mut engine, OPEN_WORLD, &[pull], set_damage()).remove(0); + + for report in [single, set] { + assert_eq!(class_of(&report, "Ravel-Ashwood-Normal-EU"), 4); + assert_eq!(class_of(&report, "Brakk-Thornfield-Normal-EU"), 1); + } +} + +#[test] +fn opening_a_forever_open_world_log_lists_its_combat_pull() { + const OPEN_WORLD: &str = + include_str!("../../openlogs-index/tests/fixtures/forever_open_world.txt"); + let (mut engine, view) = open(OPEN_WORLD); + let rows: Vec<_> = view["fights"] + .as_array() + .unwrap() + .iter() + .filter(|f| !f["combat"].is_null()) + .collect(); + assert_eq!(rows.len(), 1); + let row = rows[0]; + assert_eq!(row["combat"], json!({ "enemyCount": 1 })); + assert_eq!(row["outcome"], "kill"); + assert!(row["playerCount"].as_u64().unwrap() >= 1); + + let pull = row["index"].as_u64().unwrap() as u32; + load(&mut engine, OPEN_WORLD, pull); + let report = call( + &engine, + "damage_done_report", + json!({ "fightIndex": pull, "filter": whole_pull() }), + ); + assert!(report["total"].as_u64().unwrap() > 0); +} diff --git a/ui/src/api/client.test.ts b/ui/src/api/client.test.ts index cf71b50..acad276 100644 --- a/ui/src/api/client.test.ts +++ b/ui/src/api/client.test.ts @@ -3,7 +3,8 @@ import type { Engine } from '../engine/engine'; import { createClient, SetCancelled } from './client'; import type { Database, StoreName } from './db'; import type { LogSource } from './logSource'; -import type { LogView } from './types'; +import { runLogFixture } from '../test/runFixture'; +import type { FightRow, LogView } from './types'; const MiB = 1 << 20; @@ -200,6 +201,16 @@ describe('opening logs', () => { expect((await api.openLog(source('a.txt', 10))).cacheHit).toBe(false); }); + it('counts only the boss pulls of a log in the recent list', async () => { + const fake = fakeEngine(); + const bossPull = runLogFixture.fights[1]; + const trash: FightRow = { ...bossPull, index: 20, encounterId: 0, name: 'Arathi Knight', combat: { enemyCount: 2 } }; + fake.engine.finishIndex = async (logId) => ({ ...view(logId), fights: [...runLogFixture.fights, trash, { ...trash, index: 21, runIndex: null }] }); + const api = createClient({ engine: () => fake.engine, dungeons: async () => null, channelSpells: async () => null, spellClasses: async () => null, db: memoryDatabase(), now: () => 1 }); + await api.openLog(source('a.txt', 10)); + expect((await api.recentLogs())[0].pullCount).toBe(6); + }); + it('remembers combat logs newest first; without a file handle they must be chosen again', async () => { const { api } = client(); await api.openLog(source('older.txt', 10)); diff --git a/ui/src/api/recent.ts b/ui/src/api/recent.ts index a09d20b..1fc2976 100644 --- a/ui/src/api/recent.ts +++ b/ui/src/api/recent.ts @@ -1,3 +1,4 @@ +import { isCombatPull } from '../pulls/groupPulls'; import type { Database } from './db'; import type { LogSource } from './logSource'; import type { LogView } from './types'; @@ -29,8 +30,8 @@ export async function rememberLog(db: Database, source: LogSource, view: LogView sizeBytes: source.size, zone: view.zone, startUnixMs: view.startUnixMs, - // A run is no pull; its boss pulls are. - pullCount: view.fights.filter((fight) => fight.run === null).length, + // Boss pulls only: a run is no pull, and combat pulls stay out of the count. + pullCount: view.fights.filter((fight) => fight.run === null && !isCombatPull(fight)).length, openedAtUnixMs, handle: source.handle, } satisfies RecentRecord); diff --git a/ui/src/api/types.ts b/ui/src/api/types.ts index bb0bee5..1b5eaca 100644 --- a/ui/src/api/types.ts +++ b/ui/src/api/types.ts @@ -1,5 +1,6 @@ /** Mirrors the DTOs of `crates/openlogs-service` (serde camelCase). Times are zone-less log wall-clock values sent as Unix ms. */ -export type Outcome = 'kill' | 'wipe' | 'incomplete'; +/** `ended`: a combat pull that went quiet without a kill or a wipe. */ +export type Outcome = 'kill' | 'wipe' | 'incomplete' | 'ended'; export type Role = 'tank' | 'healer' | 'damage'; /** Bosses of the dungeon killed in a run (mirrors `BossProgressDto`). */ @@ -28,7 +29,13 @@ export interface RunInfo { timer: KeyTimer | null; } -/** A boss pull, or a whole Mythic+ run when `run` is set; both open by `index`. */ +/** A fight outside boss encounters, found from the combat itself (mirrors `CombatDto`). */ +export interface CombatInfo { + /** Enemies fought, the one the row is named after included. */ + enemyCount: number; +} + +/** A boss pull, a combat pull when `combat` is set, or a whole Mythic+ run when `run` is set; all open by `index`. */ export interface FightRow { index: number; encounterId: number; @@ -44,8 +51,9 @@ export interface FightRow { zone: string | null; /** Set when this row is a whole Mythic+ run; its boss pulls are rows of their own. */ run: RunInfo | null; - /** Log index of the run this boss pull belongs to. */ + /** Log index of the run this boss or combat pull belongs to. */ runIndex: number | null; + combat: CombatInfo | null; } export interface LogView { diff --git a/ui/src/components/CombatName.tsx b/ui/src/components/CombatName.tsx new file mode 100644 index 0000000..76ef8f6 --- /dev/null +++ b/ui/src/components/CombatName.tsx @@ -0,0 +1,18 @@ +import { t } from '../i18n/i18n'; + +/** A combat pull's name and a `+N` tag for the further enemies, which assistive tech hears as "and N more enemies". */ +export function CombatName({ name, more }: { name: string; more: number }) { + return ( + <> + {name} + {more > 0 && ( + <> + + {t('combat.moreEnemies', { count: more })} + + )} + + ); +} diff --git a/ui/src/components/FightView.test.tsx b/ui/src/components/FightView.test.tsx index ecd88bf..252a0a4 100644 --- a/ui/src/components/FightView.test.tsx +++ b/ui/src/components/FightView.test.tsx @@ -37,7 +37,7 @@ const LOG = { { index: 1, encounterId: 3492, name: "Ula'tek", difficulty: 15, difficultyLabel: 'Heroic', outcome: 'kill', durationMs: 478_610, bossHpPercent: 0, playerCount: 23, startUnixMs: Date.UTC(2026, 9, 7, 19, 3, 2), - zone: 'The Venomous Abyss', run: null, runIndex: null, + zone: 'The Venomous Abyss', run: null, runIndex: null, combat: null, }, ], } as LogView; diff --git a/ui/src/components/PullList.test.tsx b/ui/src/components/PullList.test.tsx index 3316377..e3adac5 100644 --- a/ui/src/components/PullList.test.tsx +++ b/ui/src/components/PullList.test.tsx @@ -1,9 +1,11 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { describe, expect, it, vi } from 'vitest'; -import { groupPulls } from '../pulls/groupPulls'; +import type { FightRow } from '../api/types'; +import { groupPulls, groupRuns } from '../pulls/groupPulls'; import { compareLogFixture } from '../test/compareFixture'; -import { PullList } from './PullList'; +import { runLogFixture } from '../test/runFixture'; +import { PullList, RunCards } from './PullList'; vi.mock('../api/client', () => ({ api: {} })); @@ -18,3 +20,54 @@ describe('pull list', () => { expect(onOpenSet).toHaveBeenCalledWith({ kind: 'wipes', encounterId: 3492, difficulty: 15, fights: [1, 4] }); }); }); + +describe('run cards', () => { + const [run, dailcry, ...rest] = runLogFixture.fights; + const trash = (index: number, name: string): FightRow => ({ ...dailcry, index, name, encounterId: 0, bossHpPercent: null, combat: { enemyCount: 1 } }); + const labels = () => screen.getAllByRole('button').map((button) => button.getAttribute('aria-label')); + + it('run card folds consecutive trash into one row that expands to the pulls', async () => { + const onOpen = vi.fn(); + render(); + const fold = screen.getByRole('button', { name: '2 combat pulls' }); + expect(fold).toHaveAttribute('aria-expanded', 'false'); + expect(labels().slice(1, 4)).toEqual(['Open Captain Dailcry, pull 1 of the run', '2 combat pulls', 'Open Baron Braunpyke, pull 3 of the run']); + + fold.focus(); + await userEvent.keyboard('{Enter}'); + expect(fold).toHaveAttribute('aria-expanded', 'true'); + expect(labels().slice(2, 6)).toEqual([ + '2 combat pulls', + expect.stringMatching(/^Open combat pull Arathi Knight,/), + expect.stringMatching(/^Open combat pull Arathi Footman,/), + 'Open Baron Braunpyke, pull 3 of the run', + ]); + await userEvent.click(screen.getByRole('button', { name: /^Open combat pull Arathi Footman/ })); + expect(onOpen).toHaveBeenCalledWith(11); + + await userEvent.click(fold); + expect(screen.queryByRole('button', { name: /^Open combat pull/ })).not.toBeInTheDocument(); + }); + + it('shows a single combat pull between boss pulls as its own row', async () => { + const onOpen = vi.fn(); + render(); + expect(labels().slice(1, 4)).toEqual([ + 'Open Captain Dailcry, pull 1 of the run', + expect.stringMatching(/^Open combat pull Arathi Knight,/), + 'Open Baron Braunpyke, pull 3 of the run', + ]); + await userEvent.click(screen.getByRole('button', { name: /^Open combat pull Arathi Knight/ })); + expect(onOpen).toHaveBeenCalledWith(10); + }); + + it('keeps the fold open when aborted pulls are shown', async () => { + const short = { ...trash(10, 'Arathi Knight'), outcome: 'ended' as const, durationMs: 4_000 }; + const fights = [run, dailcry, short, trash(11, 'Arathi Footman'), trash(12, 'Arathi Footman'), ...rest]; + const { rerender } = render( {}} />); + await userEvent.click(screen.getByRole('button', { name: '2 combat pulls' })); + + rerender( {}} />); + expect(screen.getByRole('button', { name: '3 combat pulls' })).toHaveAttribute('aria-expanded', 'true'); + }); +}); diff --git a/ui/src/components/PullList.tsx b/ui/src/components/PullList.tsx index c571733..aa4ac4d 100644 --- a/ui/src/components/PullList.tsx +++ b/ui/src/components/PullList.tsx @@ -1,8 +1,24 @@ +import { useId, useState } from 'react'; import type { PullSet } from '../api/types'; -import { formatClock, formatDuration, formatInteger, formatKeystoneLevel, formatPercent, formatSeconds } from '../i18n/format'; +import { formatClock, formatDuration, formatInteger, formatKeystoneLevel, formatPercent } from '../i18n/format'; import { t } from '../i18n/i18n'; -import { type BossGroup, type PullStatus, type PullView, RUN_CHIP, type RunView, runChipLabel, runSubtitle, runTimeMs } from '../pulls/groupPulls'; +import { + type BossGroup, + type CombatPullView, + PULL_CHIP, + type PullStatus, + type PullView, + RUN_CHIP, + type RunView, + pullTime, + pullViewTime, + runChipLabel, + runSubtitle, + runTimeMs, + spokenCombatName, +} from '../pulls/groupPulls'; import { BossTile } from './BossTile'; +import { CombatName } from './CombatName'; interface Props { groups: BossGroup[]; @@ -10,8 +26,7 @@ interface Props { onOpenSet: (set: PullSet) => void; } -const CHIP: Record = { kill: 'kill', wipe: 'wipe', incomplete: 'wipe', aborted: 'abort' }; -const FILL: Record = { kill: 'fill-kill', wipe: 'fill-wipe', incomplete: 'fill-wipe', aborted: 'fill-abort' }; +const FILL: Record = { kill: 'fill-kill', wipe: 'fill-wipe', incomplete: 'fill-wipe', ended: 'fill-abort', aborted: 'fill-abort' }; function bestLabel(group: BossGroup): string { if (group.killDurationMs !== null) return t('pulls.bestKill', { duration: formatDuration(group.killDurationMs) }); @@ -24,10 +39,6 @@ function hpLabel(pull: PullView): string { return pull.bossHpPercent !== null ? formatPercent(pull.bossHpPercent) : '—'; } -function pullDuration(pull: PullView): string { - return pull.status === 'aborted' ? formatSeconds(pull.durationMs) : formatDuration(pull.durationMs); -} - /** Boss HP at the end of a pull as a bar and a value; inside a run the boss name comes first. */ function PullHp({ pull, name }: { pull: PullView; name?: string }) { return ( @@ -41,9 +52,9 @@ function PullHp({ pull, name }: { pull: PullView; name?: string }) { ); } -function Chevron() { +function Chevron({ open }: { open?: boolean }) { return ( - {runChipLabel(run)} - + - {run.pulls.map((pull) => ( - - ))} + {run.entries.map((entry) => + entry.kind === 'trash' ? ( + entry.pulls.length === 1 ? ( + + ) : ( + + ) + ) : ( + + ), + )} ); })} diff --git a/ui/src/components/StartPage.test.tsx b/ui/src/components/StartPage.test.tsx index 7b0282d..5cb0817 100644 --- a/ui/src/components/StartPage.test.tsx +++ b/ui/src/components/StartPage.test.tsx @@ -46,6 +46,7 @@ function row(index: number, name: string, encounterId: number, outcome: FightRow zone: 'The Venomous Abyss', run: null, runIndex: null, + combat: null, ...extra, }; } @@ -201,3 +202,45 @@ describe('Mythic+ runs', () => { expect(api.quickOverview).toHaveBeenLastCalledWith(runLogFixture.id, 1, { startMs: null, endMs: null, attribution: 'reattributed', includeOverkill: false, deathCutoff: null }); }); }); + +describe('combat pulls', () => { + const trash = (index: number, name: string, more: number, outcome: FightRow['outcome'], durationMs: number) => + row(index, name, 0, outcome, durationMs, { bossHpPercent: null, playerCount: 19, combat: { enemyCount: more + 1 } }); + + it('combat section lists pulls in order and hides short non-kills when toggled', async () => { + vi.mocked(api.openLog).mockResolvedValue({ + ...LOG, + fights: [ + LOG.fights[0], + trash(4, 'Venomfang Juggernaut', 1, 'kill', 36_200), + trash(5, "Nek'zali the Soulcoiler", 0, 'ended', 400), + trash(6, 'Venomfang Juggernaut', 26, 'ended', 74_100), + trash(7, 'Vigilant Protector', 0, 'kill', 4_000), + ], + }); + render(); + await userEvent.click(await screen.findByRole('button', { name: /^WoWCombatLog/ })); + const section = await screen.findByRole('region', { name: 'Combat pulls' }); + expect(screen.getByRole('heading', { name: 'Raid bosses' })).toBeInTheDocument(); + const labels = () => within(section).getAllByRole('button').map((button) => button.getAttribute('aria-label')); + expect(labels()).toEqual([ + 'Open combat pull Venomfang Juggernaut and 1 more enemy, Kill after 0:36, started 19:40', + 'Open combat pull Venomfang Juggernaut and 26 more enemies, Ended after 1:14, started 20:00', + 'Open combat pull Vigilant Protector, Kill after 0:04, started 20:10', + ]); + await userEvent.click(screen.getByLabelText('Hide aborted pulls (< 10 s)')); + expect(labels()[1]).toBe("Open combat pull Nek'zali the Soulcoiler, Ended after 0.4 s, started 19:50"); + + await userEvent.click(within(section).getByRole('button', { name: /^Open combat pull Vigilant Protector/ })); + expect(api.quickOverview).toHaveBeenLastCalledWith(LOG_ID, 7, { startMs: null, endMs: null, attribution: 'reattributed', includeOverkill: false, deathCutoff: null }); + }); + + it('a log with only combat pulls shows them instead of the empty state', async () => { + vi.mocked(api.openLog).mockResolvedValue({ ...LOG, fights: [trash(1, 'Vile Fin Minor Oracle', 0, 'kill', 11_800)] }); + render(); + await userEvent.click(await screen.findByRole('button', { name: /^WoWCombatLog/ })); + const section = await screen.findByRole('region', { name: 'Combat pulls' }); + expect(within(section).getByRole('button', { name: /^Open combat pull Vile Fin Minor Oracle/ })).toBeInTheDocument(); + expect(screen.queryByRole('region', { name: 'No pulls' })).not.toBeInTheDocument(); + }); +}); diff --git a/ui/src/components/StartPage.tsx b/ui/src/components/StartPage.tsx index 2fe8be1..16e931c 100644 --- a/ui/src/components/StartPage.tsx +++ b/ui/src/components/StartPage.tsx @@ -4,13 +4,13 @@ import { type ChosenLog, chooseLog as pickLog } from '../api/logSource'; import type { Game, LogView } from '../api/types'; import { formatBytes, formatDateTime, formatList } from '../i18n/format'; import { t } from '../i18n/i18n'; -import { groupPulls, groupRuns } from '../pulls/groupPulls'; +import { combatPulls, groupPulls, groupRuns } from '../pulls/groupPulls'; import { logStartMs } from '../pulls/logStart'; import { useApp } from '../store'; import { AppWordmark } from './AppLogo'; import { ThemeSwitch } from './chrome/ThemeSwitch'; import { DropZone } from './DropZone'; -import { PullList, RunCards } from './PullList'; +import { CombatPullList, PullList, RunCards } from './PullList'; import { RecentLogs } from './RecentLogs'; function gameName(game: Game | null): string { @@ -97,9 +97,11 @@ function LogPulls({ log }: { log: LogView }) { const openSet = useApp((s) => s.openSet); const groups = useMemo(() => groupPulls(log.fights, hideAborted), [log.fights, hideAborted]); const runs = useMemo(() => groupRuns(log.fights, hideAborted), [log.fights, hideAborted]); + const combat = useMemo(() => combatPulls(log.fights, hideAborted), [log.fights, hideAborted]); const start = logStartMs(log.fileName, log.startUnixMs); const heading = [log.zone, start !== null ? formatDateTime(start) : null].filter(Boolean).join(' · '); - const bothKinds = runs.length > 0 && groups.length > 0; + const labelled = [runs, groups, combat].filter((section) => section.length > 0).length > 1; + const open = (index: number) => void openFight(index); return ( <> @@ -130,14 +132,17 @@ function LogPulls({ log }: { log: LogView }) { {t('pulls.hideAborted')} - {bothKinds &&

{t('runs.title')}

} - {runs.length > 0 && void openFight(index)} />} - {bothKinds &&

{t('pulls.raidBosses')}

} - {groups.length > 0 ? ( - void openFight(index)} onOpenSet={(set) => void openSet(set)} /> - ) : ( - runs.length === 0 && + {labelled && runs.length > 0 &&

{t('runs.title')}

} + {runs.length > 0 && } + {labelled && groups.length > 0 &&

{t('pulls.raidBosses')}

} + {groups.length > 0 && void openSet(set)} />} + {combat.length > 0 && ( + <> +

{t('combat.title')}

+ + )} + {runs.length === 0 && groups.length === 0 && combat.length === 0 && } ); } diff --git a/ui/src/components/chrome/FightHeader.tsx b/ui/src/components/chrome/FightHeader.tsx index 98ca982..a432df6 100644 --- a/ui/src/components/chrome/FightHeader.tsx +++ b/ui/src/components/chrome/FightHeader.tsx @@ -2,10 +2,11 @@ import { Fragment, type RefObject } from 'react'; import type { FightRow, LogView, PullSet } from '../../api/types'; import { formatDuration, formatKeystoneLevel } from '../../i18n/format'; import { t } from '../../i18n/i18n'; -import { RUN_CHIP, difficultyName, pullStatus, runStatus } from '../../pulls/groupPulls'; +import { PULL_CHIP, RUN_CHIP, isCombatPull, moreEnemies, pullStatus, runStatus } from '../../pulls/groupPulls'; import { BossTile } from '../BossTile'; +import { CombatName } from '../CombatName'; import { Kpi, KpiStrip } from '../Kpi'; -import { type MetaItem, fightMeta, setIdentity, setMeta } from './fightMeta'; +import { type MetaItem, fightMeta, pullKind, setIdentity, setMeta } from './fightMeta'; import type { HeaderTile } from './headerTiles'; /** @@ -13,19 +14,21 @@ import type { HeaderTile } from './headerTiles'; * tab's key figures to the right. Without `tiles` (detail pages) it is one compact line, and the detail * page's own title stays the page's heading. */ -function fightIdentity(row: FightRow): { title: string; chip: { className: string; label: string } } { +function fightIdentity(row: FightRow): Pick { const run = row.run; const status = pullStatus(row); const title = run ? t('runs.heading', { dungeon: row.name, level: formatKeystoneLevel(run.keystoneLevel) }) : row.name; const chip = run ? { className: RUN_CHIP[runStatus(row)], label: t(`runs.status.${runStatus(row)}`) } - : { className: status === 'kill' ? 'kill' : status === 'aborted' ? 'abort' : 'wipe', label: t(`status.${status}`) }; - return { title, chip }; + : { className: PULL_CHIP[status], label: t(`status.${status}`) }; + return { title, moreEnemies: isCombatPull(row) ? moreEnemies(row.combat) : 0, chip }; } /** What the header shows of a pull or a pull set. */ export interface Heading { title: string; + /** A combat pull's further enemies, a `+N` after the title. */ + moreEnemies: number; chip: { className: string; label: string }; meta: MetaItem[]; portrait: { encounterId: number; name: string }; @@ -42,6 +45,7 @@ export function setHeading(log: LogView, set: PullSet, players: number | null): const identity = setIdentity(log, set); return { title: identity.name, + moreEnemies: 0, chip: { className: 'chip-set', label: t('fight.setChip', { set: t(`pulls.set.${set.kind}`), count: set.fights.length }) }, meta: setMeta(identity, players), portrait: { encounterId: set.encounterId, name: identity.name }, @@ -49,6 +53,10 @@ export function setHeading(log: LogView, set: PullSet, players: number | null): }; } +function Title({ title, moreEnemies: more }: Pick) { + return more > 0 ? : title; +} + function MetaText({ item }: { item: MetaItem }) { if (!item.suffix) return {item.text}; return ( @@ -59,7 +67,8 @@ function MetaText({ item }: { item: MetaItem }) { } export function FightHeader({ heading, tiles, titleRef }: { heading: Heading; tiles: HeaderTile[] | null; titleRef: RefObject }) { - const { title, chip, meta, portrait } = heading; + const { chip, meta, portrait } = heading; + const title = ; const compact = tiles === null; const className = ['fight-header', compact && 'fight-header-compact', heading.set && 'fight-header-set'].filter(Boolean).join(' '); return ( @@ -96,18 +105,18 @@ export function FightHeader({ heading, tiles, titleRef }: { heading: Heading; ti ); } -/** The replay's pull line at the start of the tab row: small portrait, name, result chip, difficulty and duration. */ +/** The replay's pull line at the start of the tab row: small portrait, name, result chip, difficulty or "Combat pull", and duration. */ export function FightHeading({ row, titleRef }: { row: FightRow; titleRef: RefObject<HTMLHeadingElement | null> }) { - const { title, chip } = fightIdentity(row); + const { title, moreEnemies: more, chip } = fightIdentity(row); return ( <div className="fight-heading"> <BossTile encounterId={row.run ? 0 : row.encounterId} name={row.name} /> <h1 id="fight-title" ref={titleRef} tabIndex={-1} className="fight-heading-name"> - {title} + <Title title={title} moreEnemies={more} /> </h1> <span className={`chip ${chip.className}`}>{chip.label}</span> <span className="fight-heading-facts"> - {difficultyName(row)} + {pullKind(row)} <span aria-hidden="true"> · </span> <span className="num">{formatDuration(row.durationMs)}</span> </span> diff --git a/ui/src/components/chrome/LiveNotice.tsx b/ui/src/components/chrome/LiveNotice.tsx index c65c6a7..50c006f 100644 --- a/ui/src/components/chrome/LiveNotice.tsx +++ b/ui/src/components/chrome/LiveNotice.tsx @@ -2,6 +2,7 @@ import { useEffect } from 'react'; import { formatInteger, formatShare } from '../../i18n/format'; import { t } from '../../i18n/i18n'; import type { LiveNotice as Notice } from '../../pulls/follow'; +import { spokenCombatName } from '../../pulls/groupPulls'; import { useApp } from '../../store'; const NOTICE_MS = 4000; @@ -15,6 +16,7 @@ function message(notice: Notice): string { }); } const label = t(`status.${notice.status}`); + if (notice.kind === 'combat') return t('live.combatLoaded', { pull: spokenCombatName(notice.name, notice.moreEnemies), result: label }); const result = notice.status === 'wipe' && notice.bossHpPercent !== null ? `${label} ${formatShare(notice.bossHpPercent)}` : label; return t('live.pullLoaded', { n: notice.n, result }); } diff --git a/ui/src/components/chrome/crumbs.test.ts b/ui/src/components/chrome/crumbs.test.ts index 15e291e..cb0e35b 100644 --- a/ui/src/components/chrome/crumbs.test.ts +++ b/ui/src/components/chrome/crumbs.test.ts @@ -75,6 +75,19 @@ describe('fight breadcrumb', () => { expect(crumbs[1].action).toEqual({ kind: 'fight', index: 1 }); }); + it("names a combat pull after its enemies and keeps it out of the run's boss pull numbers", () => { + const [run, dailcry, ...rest] = runLogFixture.fights; + const trash = { ...dailcry, index: 20, encounterId: 0, name: 'Arathi Knight', outcome: 'ended' as const, durationMs: 45_000, bossHpPercent: null, combat: { enemyCount: 3 } }; + const log = { ...runLogFixture, fights: [run, trash, dailcry, ...rest] }; + const runBase = { ...base, log }; + expect(read(fightCrumbs({ ...runBase, row: trash, tab: 'damage' }))).toEqual([ + [RUN_FILE, 'pulls'], + ['Priory of the Sacred Flame +12', 'fight'], + ['Arathi Knight +2 · Ended 0:45', 'current'], + ]); + expect(read(fightCrumbs({ ...runBase, row: rest[1] }))[2]).toEqual(['Baron Braunpyke · Pull #3', 'current']); + }); + it('a_set_crumb_names_boss_set_and_count', () => { const set = { kind: 'all' as const, encounterId: 3492, difficulty: 15, fights: [1, 2, 3] }; expect(read(setCrumbs({ log: compareLogFixture, set, tab: 'overview' }))).toEqual([ diff --git a/ui/src/components/chrome/crumbs.ts b/ui/src/components/chrome/crumbs.ts index d4c3f3d..ab2cd1a 100644 --- a/ui/src/components/chrome/crumbs.ts +++ b/ui/src/components/chrome/crumbs.ts @@ -1,7 +1,7 @@ import type { Detail, FightRow, LogView, PlayerRef, PullSet, QuickOverview } from '../../api/types'; import { formatDuration, formatKeystoneLevel } from '../../i18n/format'; import { t } from '../../i18n/i18n'; -import { pullStatus, pullView, runStatus } from '../../pulls/groupPulls'; +import { combatName, isCombatPull, moreEnemies, pullNumber, pullStatus, runStatus } from '../../pulls/groupPulls'; import type { FightTab, ReportData } from '../../store'; import { playerIndex, shortName, spellName } from '../overview/players'; import { setIdentity } from './fightMeta'; @@ -36,16 +36,10 @@ export interface CrumbInput { type Level = Omit<Crumb, 'current'>; -/** A boss pull's number among the boss's pulls, or among the boss pulls of its Mythic+ run (hidden pulls count). */ -function pullNumber(fights: FightRow[], row: FightRow): number | null { - if (row.runIndex === null) return pullView(fights, row.index)?.n ?? null; - const at = fights.filter((fight) => fight.runIndex === row.runIndex).findIndex((fight) => fight.index === row.index); - return at === -1 ? null : at + 1; -} - -/** `Ula'tek · Pull #1`, or a run's `Priory of the Sacred Flame +12`. */ +/** `Ula'tek · Pull #1`, a run's `Priory of the Sacred Flame +12`, a combat pull's `Venomfang Juggernaut +10`. */ function pullLabel(fights: FightRow[], row: FightRow): string { if (row.run) return t('runs.heading', { dungeon: row.name, level: formatKeystoneLevel(row.run.keystoneLevel) }); + if (isCombatPull(row)) return combatName(row.name, moreEnemies(row.combat)); const n = pullNumber(fights, row); return n === null ? row.name : t('crumb.pull', { boss: row.name, n }); } diff --git a/ui/src/components/chrome/fightMeta.test.ts b/ui/src/components/chrome/fightMeta.test.ts index 4de10f0..7f75649 100644 --- a/ui/src/components/chrome/fightMeta.test.ts +++ b/ui/src/components/chrome/fightMeta.test.ts @@ -13,6 +13,11 @@ describe('fight meta line', () => { expect(read(compareLogFixture.fights[0])).toEqual(['Heroic', '[2:22]', '4 players', 'Oct 7, 2026 · 19:10', 'The Venomous Abyss', 'Boss HP at end 60.4%']); }); + it('calls a combat pull a combat pull where a boss pull names its difficulty', () => { + const trash: FightRow = { ...compareLogFixture.fights[0], encounterId: 0, outcome: 'ended', bossHpPercent: null, combat: { enemyCount: 3 } }; + expect(read(trash)).toEqual(['Combat pull', '[2:22]', '4 players', 'Oct 7, 2026 · 19:10', 'The Venomous Abyss']); + }); + it('claims nothing a run did not log or the dungeon data does not know', () => { const run = runLogFixture.fights[0]; const bare: FightRow = { ...run, outcome: 'incomplete', run: { ...run.run!, totalTimeMs: null, affixIds: [], bosses: null, timer: null } }; diff --git a/ui/src/components/chrome/fightMeta.ts b/ui/src/components/chrome/fightMeta.ts index d1d0543..68b28c5 100644 --- a/ui/src/components/chrome/fightMeta.ts +++ b/ui/src/components/chrome/fightMeta.ts @@ -1,7 +1,7 @@ import type { FightRow, LogView, PullSet, RunInfo } from '../../api/types'; import { formatClock, formatDateTime, formatDuration, formatPercent } from '../../i18n/format'; import { t } from '../../i18n/i18n'; -import { difficultyName, runProgress } from '../../pulls/groupPulls'; +import { difficultyName, isCombatPull, runProgress } from '../../pulls/groupPulls'; export interface MetaItem { text: string; @@ -12,16 +12,21 @@ export interface MetaItem { const fact = (text: string | null): MetaItem | null => (text ? { text, mono: false } : null); +/** A boss pull's difficulty; a combat pull says what it is instead. */ +export function pullKind(row: FightRow): string { + return isCombatPull(row) ? t('fight.combatPull') : difficultyName(row); +} + /** * The facts after the result chip, one item each (`Heroic · 7:58 · 23 players · Oct 7, 2026 · 19:03 · - * The Venomous Abyss`); a wipe adds the boss HP at its end. + * The Venomous Abyss`, a combat pull's `Combat pull · 0:28 · …`); a wipe adds the boss HP at its end. */ export function fightMeta(row: FightRow): MetaItem[] { const duration: MetaItem = { text: formatDuration(row.durationMs), mono: true }; const items = row.run ? [duration, ...runFacts(row, row.run)] : [ - fact(difficultyName(row)), + fact(pullKind(row)), duration, fact(t('fight.players', { count: row.playerCount })), fact(formatDateTime(row.startUnixMs)), diff --git a/ui/src/components/compare/PullComparisonView.tsx b/ui/src/components/compare/PullComparisonView.tsx index b935b38..e64a8f6 100644 --- a/ui/src/components/compare/PullComparisonView.tsx +++ b/ui/src/components/compare/PullComparisonView.tsx @@ -3,7 +3,7 @@ import type { FightRow, PullComparison } from '../../api/types'; import { useFocusRequest } from '../../hooks/useFocusRequest'; import { formatDuration, formatEventTime } from '../../i18n/format'; import { t } from '../../i18n/i18n'; -import { type PullStatus, type PullView, pullView } from '../../pulls/groupPulls'; +import { PULL_CHIP, type PullView, pullView } from '../../pulls/groupPulls'; import { analysedEndMs, useApp } from '../../store'; import { ComparisonCutoffChip } from '../chrome/DeathCutoffChip'; import { afterCutTitle } from '../reports/CutoffShade'; @@ -13,8 +13,6 @@ import { CompareDeaths } from './CompareDeaths'; import { ComparePlayers } from './ComparePlayers'; import { durationDelta, endHpLabel, kpiRows, phaseRows } from './compareData'; -const CHIP: Record<PullStatus, string> = { kill: 'kill', wipe: 'wipe', incomplete: 'wipe', aborted: 'abort' }; - const startLabel = (ms: number | null) => (ms === null ? '—' : formatEventTime(ms)); /** Two pulls side by side; replaces the pull's tabs until "Back". */ @@ -84,7 +82,7 @@ function PullCard({ pull, side }: { pull: PullView; side: 'a' | 'b' }) { <div role="group" aria-label={label} className="panel panel-pad cmp-pull"> <span className={`cmp-swatch cmp-swatch-${side}`} aria-hidden="true" /> <h2 className="h2">{label}</h2> - <span className={`chip ${CHIP[pull.status]}`}>{t(`status.${pull.status}`)}</span> + <span className={`chip ${PULL_CHIP[pull.status]}`}>{t(`status.${pull.status}`)}</span> <span className="num">{formatDuration(pull.durationMs)}</span> <span className="muted">{t('fight.bossHp', { percent: endHpLabel(pull) })}</span> </div> diff --git a/ui/src/components/overview/SetOverview.tsx b/ui/src/components/overview/SetOverview.tsx index 2abc120..ed376ee 100644 --- a/ui/src/components/overview/SetOverview.tsx +++ b/ui/src/components/overview/SetOverview.tsx @@ -1,8 +1,8 @@ import { useId, useMemo, useState } from 'react'; import type { Kpis, PullSet, SetPull } from '../../api/types'; -import { formatAmount, formatDuration, formatEventTimeTenths, formatInteger, formatOrdinal, formatPercent, formatSeconds } from '../../i18n/format'; +import { formatAmount, formatDuration, formatEventTimeTenths, formatInteger, formatOrdinal, formatPercent } from '../../i18n/format'; import { t } from '../../i18n/i18n'; -import { PULL_CHIP } from '../../pulls/groupPulls'; +import { PULL_CHIP, pullViewTime } from '../../pulls/groupPulls'; import { useApp } from '../../store'; import { CutoffShade } from '../reports/CutoffShade'; import { type SetOrder, type SetRow, averageFirstDeath, bestPull, pullFirstDeaths, rowHpAtEnd, sortRows } from './setOverviewModel'; @@ -15,11 +15,9 @@ function hpAtEndText(row: SetRow): string { return hp !== null ? formatPercent(hp) : '—'; } -const lengthText = (row: SetRow, ms: number) => (row.view.status === 'aborted' ? formatSeconds(ms) : formatDuration(ms)); - function durationText(row: SetRow): string { - const whole = lengthText(row, row.view.durationMs); - return row.pull.cutoffMs === null ? whole : t('setOverview.cutDuration', { analysed: lengthText(row, row.pull.kpis.durationMs), whole }); + const whole = pullViewTime(row.view); + return row.pull.cutoffMs === null ? whole : t('setOverview.cutDuration', { analysed: pullViewTime(row.view, row.pull.kpis.durationMs), whole }); } const potions = (kpis: Kpis) => t('setOverview.potions', { used: formatInteger(kpis.combatPotions), without: formatInteger(kpis.playersWithoutCombatPotion) }); diff --git a/ui/src/components/reports/RangePanel.tsx b/ui/src/components/reports/RangePanel.tsx index 7e085f4..0cc5387 100644 --- a/ui/src/components/reports/RangePanel.tsx +++ b/ui/src/components/reports/RangePanel.tsx @@ -13,6 +13,8 @@ import { type SavedRange, deleteRange, loadSavedRanges, saveRange } from './save import { useBrush } from './useBrush'; import { useRangeKeys } from './useRangeKeys'; +const savedUnder = (key: string | null): SavedRange[] => (key === null ? [] : loadSavedRanges(key)); + /** * The report tabs' "Time range" panel: pills for the full pull, its phases and the saved ranges, * the selection with its duration and the pull's bounds, "+ Save range", and a plot with the selection @@ -26,7 +28,8 @@ export function RangePanel({ collapsible, }: { overview: QuickOverview; - rangeKey: string; + /** `null`: nothing to save ranges under (a combat pull), so no saved ranges and no "Save range". */ + rangeKey: string | null; run?: boolean; collapsible?: { open: boolean; onToggle(open: boolean): void }; }) { @@ -45,14 +48,14 @@ export function RangePanel({ const saveRef = useRef<HTMLButtonElement>(null); const hintId = useId(); const popoverId = useId(); - const [saved, setSaved] = useState<SavedRange[]>(() => loadSavedRanges(rangeKey)); + const [saved, setSaved] = useState<SavedRange[]>(() => savedUnder(rangeKey)); const [saving, setSaving] = useState(false); const expandRef = useRef<HTMLButtonElement>(null); const collapseRef = useRef<HTMLButtonElement>(null); const toggled = useRef(false); const collapsed = collapsible !== undefined && !collapsible.open; - useEffect(() => setSaved(loadSavedRanges(rangeKey)), [rangeKey]); + useEffect(() => setSaved(savedUnder(rangeKey)), [rangeKey]); useEffect(() => { if (!toggled.current) return; toggled.current = false; @@ -197,7 +200,7 @@ export function RangePanel({ type="button" className="pill-saved-x" aria-label={t('range.delete', { name: entry.name })} - onClick={() => setSaved(deleteRange(rangeKey, entry.name))} + onClick={() => rangeKey !== null && setSaved(deleteRange(rangeKey, entry.name))} > × </button> @@ -212,30 +215,32 @@ export function RangePanel({ </span> <span className="num">{t('range.bounds', { start: formatEventTime(0), end: formatEventTime(duration) })}</span> </div> - <div className="range-save" onKeyDown={onSaveKey} onBlur={onSaveBlur}> - <button - ref={saveRef} - type="button" - className="pill" - disabled={range === null} - title={range === null ? t('range.saveNeedsRange') : undefined} - aria-expanded={saving} - aria-controls={saving ? popoverId : undefined} - onClick={() => setSaving(!saving)} - > - {t('range.saveOpen')} - </button> - {saving && range !== null && ( - <SaveRangePopover - id={popoverId} - onSave={(name) => { - setSaved(saveRange(rangeKey, { name, startMs: range.startMs, endMs: range.endMs })); - closeSave(true); - }} - onCancel={() => closeSave(true)} - /> - )} - </div> + {rangeKey !== null && ( + <div className="range-save" onKeyDown={onSaveKey} onBlur={onSaveBlur}> + <button + ref={saveRef} + type="button" + className="pill" + disabled={range === null} + title={range === null ? t('range.saveNeedsRange') : undefined} + aria-expanded={saving} + aria-controls={saving ? popoverId : undefined} + onClick={() => setSaving(!saving)} + > + {t('range.saveOpen')} + </button> + {saving && range !== null && ( + <SaveRangePopover + id={popoverId} + onSave={(name) => { + setSaved(saveRange(rangeKey, { name, startMs: range.startMs, endMs: range.endMs })); + closeSave(true); + }} + onCancel={() => closeSave(true)} + /> + )} + </div> + )} </div> </div> <div diff --git a/ui/src/components/set/PullHead.tsx b/ui/src/components/set/PullHead.tsx index e8fe237..d0a27a9 100644 --- a/ui/src/components/set/PullHead.tsx +++ b/ui/src/components/set/PullHead.tsx @@ -1,18 +1,15 @@ import type { ReactNode } from 'react'; import type { Seam } from '../../api/types'; -import { formatDuration, formatSeconds } from '../../i18n/format'; import { t } from '../../i18n/i18n'; -import { PULL_CHIP, type PullView } from '../../pulls/groupPulls'; +import { PULL_CHIP, type PullView, pullViewTime } from '../../pulls/groupPulls'; import { seamBoxes } from './seams'; -const pullTime = (pull: PullView) => (pull.status === 'aborted' ? formatSeconds(pull.durationMs) : formatDuration(pull.durationMs)); - export function PullHead({ pull, count }: { pull: PullView; count?: ReactNode }) { return ( <div className="pull-head"> <span className="num text-muted">{t('set.pullChip', { n: pull.n })}</span> <span className={`chip ${PULL_CHIP[pull.status]}`}>{t(`status.${pull.status}`)}</span> - <span className="num text-soft">{pullTime(pull)}</span> + <span className="num text-soft">{pullViewTime(pull)}</span> {count !== undefined && <span className="pull-head-count num">{count}</span>} </div> ); @@ -20,7 +17,7 @@ export function PullHead({ pull, count }: { pull: PullView; count?: ReactNode }) /** For narrow pull segments: the number and the result's letter; the full heading is the title and the accessible name. */ export function CompactPullHead({ pull }: { pull: PullView }) { - const full = t('set.pullHead', { n: pull.n, status: t(`status.${pull.status}`), duration: pullTime(pull) }); + const full = t('set.pullHead', { n: pull.n, status: t(`status.${pull.status}`), duration: pullViewTime(pull) }); return ( <div className="pull-head pull-head-compact" title={full}> <span className="num text-muted" aria-hidden="true"> diff --git a/ui/src/i18n/en.ts b/ui/src/i18n/en.ts index e52e6b3..f2262d6 100644 --- a/ui/src/i18n/en.ts +++ b/ui/src/i18n/en.ts @@ -46,8 +46,8 @@ export const en = { 'pulls.bestKill': 'Kill {duration}', 'pulls.bestWipe': 'Best pull {percent}', 'pulls.noKill': 'No kill', - 'pulls.none': 'This log contains no boss pulls.', - 'pulls.noneTitle': 'No boss pulls', + 'pulls.none': 'This log contains no pulls.', + 'pulls.noneTitle': 'No pulls', 'pulls.open': 'Open pull {n} of {boss}', 'pulls.sets': 'Pull sets of {boss}', 'pulls.set.all': 'All pulls', @@ -60,6 +60,14 @@ export const en = { 'pulls.column.bossHp': 'Boss HP at end', 'pulls.column.players': 'Players', 'pulls.column.start': 'Start', + 'combat.title': 'Combat pulls', + 'combat.column.enemies': 'Enemies', + 'combat.column.zone': 'Zone', + 'combat.more': '+{count}', + 'combat.moreEnemies': { one: 'and {count} more enemy', other: 'and {count} more enemies' }, + 'combat.moreTitle': { one: '{count} more enemy fought', other: '{count} more enemies fought' }, + 'combat.named': '{name} {more}', + 'combat.open': 'Open combat pull {pull}, {result} after {duration}, started {start}', 'runs.title': 'Mythic+ runs', 'runs.run': 'Run', 'runs.chipInTime': 'In time +{upgrades} · {duration}', @@ -72,6 +80,7 @@ export const en = { 'runs.status.notCompleted': 'Not completed', 'runs.status.incomplete': 'Incomplete', 'runs.bossPulls': { one: '{count} boss pull', other: '{count} boss pulls' }, + 'runs.combatPulls': { one: '{count} combat pull', other: '{count} combat pulls' }, 'runs.open': 'Open run {dungeon} {level}', 'runs.openPull': 'Open {boss}, pull {n} of the run', 'runs.affixes': 'Affixes {ids}', @@ -84,10 +93,12 @@ export const en = { 'status.wipe': 'Wipe', 'status.aborted': 'Aborted', 'status.incomplete': 'Incomplete', + 'status.ended': 'Ended', 'status.letter.kill': 'K', 'status.letter.wipe': 'W', 'status.letter.aborted': 'A', 'status.letter.incomplete': 'I', + 'status.letter.ended': 'E', 'error.openFailed': 'Could not open {file}: {reason}', 'error.loadFailed': 'Could not load the pull: {reason}', 'error.setLoadFailed': 'Could not load the pulls: {reason}', @@ -152,6 +163,7 @@ export const en = { 'chrome.home': 'OpenLogs – all pulls', 'chrome.breadcrumb': 'Breadcrumb', 'fight.bossHp': 'Boss HP at end {percent}', + 'fight.combatPull': 'Combat pull', 'crumb.pull': '{boss} · Pull #{n}', 'crumb.result': '{result} {duration}', 'crumb.withResult': '{pull} · {result}', @@ -644,6 +656,7 @@ export const en = { 'options.liveRefreshHint': 'Add new pulls while the game writes the log', 'options.liveRefreshUnavailable': 'This log cannot be followed here. Open it again, or use Chrome, Edge or the desktop app.', 'live.pullLoaded': 'Pull {n} loaded · {result}', + 'live.combatLoaded': '{pull} loaded · {result}', 'live.runLoaded': '{dungeon} +{level} loaded · {result}', 'options.deathCutoff': 'Stop at player death', 'options.deathCutoffOff': 'off', diff --git a/ui/src/pulls/follow.test.ts b/ui/src/pulls/follow.test.ts index 210f805..6d536e5 100644 --- a/ui/src/pulls/follow.test.ts +++ b/ui/src/pulls/follow.test.ts @@ -18,6 +18,7 @@ function fight(index: number, outcome: FightRow['outcome'], durationMs: number, zone: 'The Venomous Abyss', run: null, runIndex: null, + combat: null, ...extra, }; } @@ -27,6 +28,7 @@ const RUN: RunInfo = { challengeModeId: 505, keystoneLevel: 12, affixIds: [10, 9 const wipe = (index: number) => fight(index, 'wipe', 120_000); const kill = (index: number) => fight(index, 'kill', 300_000); const aborted = (index: number) => fight(index, 'wipe', 4_000); +const trash = (index: number) => fight(index, 'kill', 30_000, { encounterId: 0, name: 'Venomfang Juggernaut', bossHpPercent: null, combat: { enemyCount: 3 } }); const shown = (fightIndex: number): View => ({ kind: 'fight', fightIndex }); describe('followUpdate jump', () => { @@ -40,6 +42,7 @@ describe('followUpdate jump', () => { ['newest shown while comparing', shown(30), [...before, wipe(40)], true, true, null], ['no pull shown', { kind: 'start' } as View, [...before, wipe(40)], true, false, null], ['newest shown, its outcome changes', shown(30), [wipe(10), wipe(20), kill(30)], true, false, 30], + ['unknown pull shown, new trash', shown(99), [...before, trash(40)], true, false, 40], ] as [string, View, FightRow[], boolean, boolean, number | null][])('%s', (_name, view, after, hideAborted, comparing, jumpTo) => { expect(followUpdate(before, after, view, hideAborted, comparing).jumpTo).toBe(jumpTo); }); @@ -65,6 +68,14 @@ describe('followUpdate jump', () => { ]; expect(followUpdate(runs, [...runs, ...next], shown(40), true, false).jumpTo).toBe(43); }); + + it('follow does not leave a boss pull for new trash but follows new trash from a combat pull', () => { + const before = [wipe(10), trash(20)]; + expect(followUpdate(before, [...before, trash(30)], shown(10), true, false).jumpTo).toBeNull(); + expect(followUpdate(before, [...before, trash(30)], shown(20), true, false).jumpTo).toBe(30); + expect(followUpdate(before, [...before, wipe(30)], shown(10), true, false).jumpTo).toBe(30); + expect(followUpdate(before, [...before, wipe(30)], shown(20), true, false).jumpTo).toBeNull(); + }); }); describe('followUpdate shown pull', () => { @@ -113,4 +124,8 @@ describe('liveNoticeOf', () => { const fights = [fight(5, 'incomplete', 600_000, { run: RUN, name: 'Halls of Atonement' })]; expect(liveNoticeOf(fights, 5)).toEqual({ kind: 'run', dungeon: 'Halls of Atonement', keystoneLevel: 12, status: 'incomplete' }); }); + + it('names a combat pull after its enemies', () => { + expect(liveNoticeOf([wipe(1), trash(2)], 2)).toEqual({ kind: 'combat', name: 'Venomfang Juggernaut', moreEnemies: 2, status: 'kill' }); + }); }); diff --git a/ui/src/pulls/follow.ts b/ui/src/pulls/follow.ts index 16d684d..4e3534d 100644 --- a/ui/src/pulls/follow.ts +++ b/ui/src/pulls/follow.ts @@ -1,6 +1,6 @@ import type { FightRow, PullSet } from '../api/types'; import type { View } from '../store'; -import { pullStatus, pullView, runStatus, type PullStatus, type RunStatus } from './groupPulls'; +import { isAborted, isCombatPull, isGroupedBossPull, moreEnemies, pullNumber, pullStatus, runStatus, type PullStatus, type RunStatus } from './groupPulls'; export interface FollowUpdate { /** Pull or run the view moves to; `null` = stay. */ @@ -13,24 +13,30 @@ export interface FollowUpdate { export type LiveNotice = | { kind: 'pull'; n: number; status: PullStatus; bossHpPercent: number | null } + | { kind: 'combat'; name: string; moreEnemies: number; status: PullStatus } | { kind: 'run'; dungeon: string; keystoneLevel: number; status: RunStatus }; +/** Follows only to rows of the kind shown, or to any while the shown row is unknown: reading a boss pull, new trash never pulls the view away. */ export function followUpdate(before: FightRow[], after: FightRow[], view: View, hideAborted: boolean, comparing: boolean): FollowUpdate { const known = new Map(before.map((fight) => [fight.index, fight])); const isNew = (fight: FightRow) => { const old = known.get(fight.index); return old === undefined || old.outcome !== fight.outcome || old.durationMs !== fight.durationMs; }; - const isVisible = (fight: FightRow) => fight.run !== null || !(hideAborted && pullStatus(fight) === 'aborted'); + const isVisible = (fight: FightRow) => fight.run !== null || !(hideAborted && isAborted(fight)); const arrived = after.filter((fight) => isNew(fight) && isVisible(fight)); let jumpTo: number | null = null; if (view.kind === 'fight' && !comparing) { - const newestShown = newest(before.filter(isVisible)); + const shownRow = known.get(view.fightIndex); + const combatShown = shownRow !== undefined && isCombatPull(shownRow); + const ofShownKind = (fight: FightRow) => isCombatPull(fight) === combatShown; + const newestShown = newest(before.filter((fight) => isVisible(fight) && ofShownKind(fight))); // A run is numbered before its boss pulls, so the newest row may be the last boss pull of the shown run. const onNewest = newestShown !== null && (view.fightIndex === newestShown.index || view.fightIndex === newestShown.runIndex); - if (onNewest || !known.has(view.fightIndex)) { - const target = arrived.find((fight) => fight.run !== null) ?? newest(arrived); + if (onNewest || shownRow === undefined) { + const candidates = shownRow === undefined ? arrived : arrived.filter(ofShownKind); + const target = candidates.find((fight) => fight.run !== null) ?? newest(candidates); jumpTo = target?.index ?? null; } } @@ -52,8 +58,7 @@ function grownSet(set: PullSet, unchanged: Set<number>, arrived: FightRow[]): Pu const added = arrived .filter( (fight) => - fight.run === null && - fight.runIndex === null && + isGroupedBossPull(fight) && fight.encounterId === set.encounterId && fight.difficulty === set.difficulty && (set.kind === 'kills' ? pullStatus(fight) === 'kill' : set.kind === 'wipes' ? pullStatus(fight) !== 'kill' : true), @@ -69,7 +74,6 @@ export function liveNoticeOf(fights: FightRow[], index: number): LiveNotice { if (fight.run !== null) { return { kind: 'run', dungeon: fight.name, keystoneLevel: fight.run.keystoneLevel, status: runStatus(fight) }; } - const n = - pullView(fights, index)?.n ?? fights.filter((other) => other.runIndex === fight.runIndex).findIndex((other) => other.index === index) + 1; - return { kind: 'pull', n, status: pullStatus(fight), bossHpPercent: fight.bossHpPercent }; + if (isCombatPull(fight)) return { kind: 'combat', name: fight.name, moreEnemies: moreEnemies(fight.combat), status: pullStatus(fight) }; + return { kind: 'pull', n: pullNumber(fights, fight)!, status: pullStatus(fight), bossHpPercent: fight.bossHpPercent }; } diff --git a/ui/src/pulls/groupPulls.test.ts b/ui/src/pulls/groupPulls.test.ts index e6d562f..f87d401 100644 --- a/ui/src/pulls/groupPulls.test.ts +++ b/ui/src/pulls/groupPulls.test.ts @@ -1,6 +1,18 @@ import { describe, expect, it } from 'vitest'; import type { FightRow, RunInfo } from '../api/types'; -import { comparablePulls, groupPulls, groupRuns, pullStatus, pullView, rangeKey, runChipLabel, runProgress, runStatus, runSubtitle } from './groupPulls'; +import { + comparablePulls, + groupPulls, + groupRuns, + pullStatus, + pullView, + rangeKey, + runChipLabel, + runProgress, + runStatus, + runSubtitle, + type RunView, +} from './groupPulls'; import { runLogFixture } from '../test/runFixture'; let next = 1; @@ -27,10 +39,16 @@ function fight( zone: 'The Venomous Abyss', run: null, runIndex: null, + combat: null, ...extra, }; } +/** A combat pull named after `name`, with `more` further enemies. */ +function trash(name: string, more: number, outcome: FightRow['outcome'], durationMs: number, extra: Partial<FightRow> = {}): FightRow { + return fight(name, 0, outcome, durationMs, null, { combat: { enemyCount: more + 1 }, ...extra }); +} + // Real values from WoWCombatLog-100626_115111.txt. const LOG = [ fight('Vashnik the Malignant', 3455, 'kill', 364_703, 0), @@ -131,6 +149,53 @@ describe('pullStatus', () => { expect(pullStatus(fight('A', 1, 'incomplete', 60_000, 40))).toBe('incomplete'); expect(pullStatus(fight('A', 1, 'incomplete', 2_000, null))).toBe('aborted'); }); + + it('keeps the logged result of a combat pull, also of a short one', () => { + expect(pullStatus(trash('Arathi Knight', 0, 'ended', 60_000))).toBe('ended'); + expect(pullStatus(trash('Arathi Knight', 0, 'ended', 400))).toBe('ended'); + }); +}); + +describe('combat pulls', () => { + it('combat rows never join boss groups or sets', () => { + const log = [ + trash('Venomfang Juggernaut', 1, 'kill', 36_200), + fight('Sszorak', 3420, 'wipe', 77_693, 82.2), + trash('Venomfang Juggernaut', 26, 'ended', 74_100), + fight('Sszorak', 3420, 'kill', 309_124, 0), + trash('Venomfang Juggernaut', 2, 'kill', 47_100), + ]; + const bossPulls = [log[1].index, log[3].index]; + const groups = groupPulls(log, false); + expect(groups.map((group) => [group.name, group.pulls.map((pull) => pull.index)])).toEqual([['Sszorak', bossPulls]]); + expect(groups[0].sets.map((set) => set.set.fights)).toEqual([bossPulls]); + expect(comparablePulls(log, log[3]).map((pull) => pull.index)).toEqual([log[1].index]); + expect(comparablePulls(log, log[2])).toEqual([]); + expect(pullView(log, log[2].index)).toBeNull(); + expect(rangeKey(log[2])).toBeNull(); + }); + + it('run card lists trash between boss pulls and still counts only boss pulls', () => { + const MPLUS = { difficulty: 8, difficultyLabel: 'Mythic+', playerCount: 5 }; + const info: RunInfo = { challengeModeId: 499, keystoneLevel: 12, affixIds: [], totalTimeMs: 600_000, bosses: null, timer: null }; + const run = fight('Priory of the Sacred Flame', 0, 'kill', 600_000, null, { ...MPLUS, run: info }); + const inRun = { ...MPLUS, runIndex: run.index }; + const log = [ + run, + trash('Arathi Knight', 0, 'ended', 400, inRun), + fight('Captain Dailcry', 2847, 'kill', 60_000, 0, inRun), + trash('Arathi Footman', 2, 'kill', 30_000, inRun), + fight('Baron Braunpyke', 2835, 'wipe', 4_000, null, inRun), + trash('Arathi Knight', 1, 'ended', 25_000, inRun), + fight('Baron Braunpyke', 2835, 'kill', 60_000, 0, inRun), + trash('Lightspawn', 0, 'kill', 12_000), + ]; + const rows = (hideAborted: boolean) => + groupRuns(log, hideAborted)[0].entries.map((entry) => (entry.kind === 'boss' ? `#${entry.pull.n} ${entry.pull.name}` : entry.pulls.map((pull) => pull.name))); + expect(rows(false)).toEqual([['Arathi Knight'], '#1 Captain Dailcry', ['Arathi Footman'], '#2 Baron Braunpyke', ['Arathi Knight'], '#3 Baron Braunpyke']); + expect(rows(true)).toEqual(['#1 Captain Dailcry', ['Arathi Footman', 'Arathi Knight'], '#3 Baron Braunpyke']); + expect(runSubtitle(groupRuns(log, true)[0])).toBe('3 boss pulls'); + }); }); describe('comparable pulls', () => { @@ -177,12 +242,13 @@ describe('Mythic+ runs', () => { [107, 'Priory of the Sacred Flame', 13, 'incomplete', 1, null, null], ]); expect(runs[0].affixIds).toEqual([10, 147, 9]); - expect(runs[0].pulls.map((pull) => [pull.index, pull.n, pull.name, pull.status])).toEqual([ + const bossPulls = (run: RunView) => run.entries.flatMap((entry) => (entry.kind === 'boss' ? [entry.pull] : [])); + expect(bossPulls(runs[0]).map((pull) => [pull.index, pull.n, pull.name, pull.status])).toEqual([ [103, 1, 'Captain Dailcry', 'kill'], [105, 3, 'Baron Braunpyke', 'wipe'], [106, 4, 'Baron Braunpyke', 'kill'], ]); - expect(groupRuns(RUN_LOG, false)[0].pulls.map((pull) => pull.n)).toEqual([1, 2, 3, 4]); + expect(bossPulls(groupRuns(RUN_LOG, false)[0]).map((pull) => pull.n)).toEqual([1, 2, 3, 4]); expect(groupRuns(LOG, false)).toEqual([]); const known: RunInfo = { ...RUN, bosses: { killed: 3, total: 3 }, timer: { kind: 'inTime', upgrades: 2 } }; diff --git a/ui/src/pulls/groupPulls.ts b/ui/src/pulls/groupPulls.ts index b53111c..fdd4b0b 100644 --- a/ui/src/pulls/groupPulls.ts +++ b/ui/src/pulls/groupPulls.ts @@ -1,11 +1,11 @@ -import type { BossProgress, FightRow, KeyTimer, PullSet, PullSetKind, RunInfo } from '../api/types'; -import { formatDuration, formatInteger } from '../i18n/format'; +import type { BossProgress, CombatInfo, FightRow, KeyTimer, PullSet, PullSetKind, RunInfo } from '../api/types'; +import { formatDuration, formatInteger, formatSeconds } from '../i18n/format'; import { t } from '../i18n/i18n'; /** Non-kills shorter than this are "aborted" and can be hidden. */ const ABORT_THRESHOLD_MS = 10_000; -export type PullStatus = 'kill' | 'wipe' | 'aborted' | 'incomplete'; +export type PullStatus = 'kill' | 'wipe' | 'ended' | 'aborted' | 'incomplete'; /** A run's result: completed, ended without completion, or no end in the log. */ export type RunStatus = 'completed' | 'notCompleted' | 'incomplete'; @@ -13,7 +13,7 @@ export type RunStatus = 'completed' | 'notCompleted' | 'incomplete'; /** Chip style of a run result: completed like a kill, not completed like a wipe, no end neutral. */ export const RUN_CHIP: Record<RunStatus, string> = { completed: 'kill', notCompleted: 'wipe', incomplete: 'abort' }; -export const PULL_CHIP: Record<PullStatus, string> = { kill: 'kill', wipe: 'wipe', incomplete: 'wipe', aborted: 'abort' }; +export const PULL_CHIP: Record<PullStatus, string> = { kill: 'kill', wipe: 'wipe', incomplete: 'wipe', ended: 'ended', aborted: 'abort' }; export interface PullView { index: number; @@ -53,7 +53,25 @@ export interface RunPullView extends PullView { name: string; } -/** A Mythic+ run with its boss pulls. */ +/** A fight outside boss encounters, named after the enemy that took the most damage. */ +export interface CombatPullView { + index: number; + name: string; + /** Enemies fought besides the one the pull is named after. */ + moreEnemies: number; + zone: string | null; + status: PullStatus; + /** A non-kill under 10 s: its time in seconds, hidden with the aborted pulls. */ + aborted: boolean; + durationMs: number; + playerCount: number; + startUnixMs: number; +} + +/** A boss pull of a run card, or the combat pulls between two of them; `after` is the index of the boss pull before them, or of the run. */ +export type RunEntry = { kind: 'boss'; pull: RunPullView } | { kind: 'trash'; after: number; pulls: CombatPullView[] }; + +/** A Mythic+ run with its boss and combat pulls. */ export interface RunView { index: number; dungeon: string; @@ -68,18 +86,53 @@ export interface RunView { durationMs: number; playerCount: number; startUnixMs: number; - /** Every boss pull of the run, hidden ones included. */ + /** Every boss pull of the run, hidden ones included; combat pulls do not count. */ pullCount: number; - /** Boss pulls in log order; aborted ones are left out when hidden. */ - pulls: RunPullView[]; + /** In log order, the combat pulls between two boss pulls as one entry; aborted pulls are left out when hidden. */ + entries: RunEntry[]; +} + +export function isCombatPull<T extends Pick<FightRow, 'combat'>>(fight: T): fight is T & { combat: CombatInfo } { + return fight.combat !== null; +} + +/** A non-kill under 10 s: "Hide aborted pulls" hides it, a boss pull's or a combat pull's alike. */ +export function isAborted(fight: Pick<FightRow, 'outcome' | 'durationMs'>): boolean { + return fight.outcome !== 'kill' && fight.durationMs < ABORT_THRESHOLD_MS; } export function pullStatus(fight: FightRow): PullStatus { if (fight.outcome === 'kill') return 'kill'; - if (fight.durationMs < ABORT_THRESHOLD_MS) return 'aborted'; + // A short combat pull keeps its logged result; only boss pulls are labelled aborted. + if (!isCombatPull(fight) && isAborted(fight)) return 'aborted'; + if (fight.outcome === 'ended') return 'ended'; return fight.outcome === 'incomplete' ? 'incomplete' : 'wipe'; } +export function moreEnemies(combat: CombatInfo): number { + return Math.max(0, combat.enemyCount - 1); +} + +/** `Venomfang Juggernaut +10`; the name alone when no other enemy was fought. */ +export function combatName(name: string, more: number): string { + return more > 0 ? t('combat.named', { name, more: t('combat.more', { count: more }) }) : name; +} + +/** `Venomfang Juggernaut and 10 more enemies`: what assistive tech reads for `combatName`. */ +export function spokenCombatName(name: string, more: number): string { + return more > 0 ? t('combat.named', { name, more: t('combat.moreEnemies', { count: more }) }) : name; +} + +/** An aborted pull lasts seconds: `0.4 s` instead of `0:00`. */ +export function pullTime(durationMs: number, aborted: boolean): string { + return aborted ? formatSeconds(durationMs) : formatDuration(durationMs); +} + +/** A boss pull's time as shown, by default its whole length. */ +export function pullViewTime(pull: PullView, durationMs = pull.durationMs): string { + return pullTime(durationMs, pull.status === 'aborted'); +} + export function runStatus(fight: FightRow): RunStatus { if (fight.outcome === 'kill') return 'completed'; return fight.outcome === 'wipe' ? 'notCompleted' : 'incomplete'; @@ -88,9 +141,9 @@ export function runStatus(fight: FightRow): RunStatus { /** Difficulty ID of Mythic+ keystone dungeons. */ const MYTHIC_PLUS_DIFFICULTY = 8; -/** Whether a row belongs to Mythic+: a whole run or a boss pull inside one. */ -function inMythicPlus(fight: FightRow): boolean { - return fight.run !== null || fight.runIndex !== null; +/** What boss groups, sets and comparisons are made of: boss pulls outside Mythic+ runs. */ +export function isGroupedBossPull(fight: FightRow): boolean { + return fight.run === null && fight.runIndex === null && !isCombatPull(fight); } export function difficultyName(fight: Pick<FightRow, 'difficulty' | 'difficultyLabel'>): string { @@ -101,7 +154,7 @@ export function difficultyName(fight: Pick<FightRow, 'difficulty' | 'difficultyL export function groupPulls(fights: FightRow[], hideAborted: boolean): BossGroup[] { const groups = new Map<string, FightRow[]>(); for (const fight of fights) { - if (inMythicPlus(fight)) continue; + if (!isGroupedBossPull(fight)) continue; const key = `${fight.encounterId}:${fight.difficulty}`; const list = groups.get(key); if (list) list.push(fight); @@ -147,14 +200,25 @@ function pullSets(boss: Pick<FightRow, 'encounterId' | 'difficulty'>, pulls: Pul })); } -/** Mythic+ runs in log order, each with its boss pulls numbered within the run. */ +/** Combat pulls outside Mythic+ runs in log order; `groupRuns` lists those inside a run. */ +export function combatPulls(fights: FightRow[], hideAborted: boolean): CombatPullView[] { + return fights.filter(isCombatPull).filter((fight) => fight.runIndex === null && !(hideAborted && isAborted(fight))).map(toCombatView); +} + +/** Mythic+ runs in log order, each with its boss pulls numbered within the run and the combat pulls between them. */ export function groupRuns(fights: FightRow[], hideAborted: boolean): RunView[] { return fights.flatMap((fight) => { const run = fight.run; if (run === null) return []; - const views = fights - .filter((pull) => pull.runIndex === fight.index) - .map((pull, i): RunPullView => ({ ...toView(pull, i + 1), name: pull.name })); + const numbered = runBossPulls(fights, fight.index); + const entries: RunEntry[] = []; + for (const pull of fights) { + if (pull.runIndex !== fight.index || (hideAborted && isAborted(pull))) continue; + const last = entries.at(-1); + if (!isCombatPull(pull)) entries.push({ kind: 'boss', pull: { ...toView(pull, numbered.indexOf(pull) + 1), name: pull.name } }); + else if (last?.kind === 'trash') last.pulls.push(toCombatView(pull)); + else entries.push({ kind: 'trash', after: last?.pull.index ?? fight.index, pulls: [toCombatView(pull)] }); + } return [ { index: fight.index, @@ -168,8 +232,8 @@ export function groupRuns(fights: FightRow[], hideAborted: boolean): RunView[] { durationMs: fight.durationMs, playerCount: fight.playerCount, startUnixMs: fight.startUnixMs, - pullCount: views.length, - pulls: hideAborted ? views.filter((view) => view.status !== 'aborted') : views, + pullCount: numbered.length, + entries, }, ]; }); @@ -235,17 +299,44 @@ function toView(fight: FightRow, n: number): PullView { }; } -/** Key of saved ranges: per boss and difficulty, per dungeon for a Mythic+ run. */ -export function rangeKey(fight: FightRow): string { +function toCombatView(fight: FightRow & { combat: CombatInfo }): CombatPullView { + return { + index: fight.index, + name: fight.name, + moreEnemies: moreEnemies(fight.combat), + zone: fight.zone, + status: pullStatus(fight), + aborted: isAborted(fight), + durationMs: fight.durationMs, + playerCount: fight.playerCount, + startUnixMs: fight.startUnixMs, + }; +} + +/** Key of saved ranges: per boss and difficulty, per dungeon for a Mythic+ run; `null` for a combat pull, which keeps none. */ +export function rangeKey(fight: FightRow): string | null { + if (isCombatPull(fight)) return null; return fight.run ? `run:${fight.run.challengeModeId}` : `${fight.encounterId}:${fight.difficulty}`; } /** Pulls of one boss and difficulty outside Mythic+, numbered as in the pull list (hidden pulls count). */ function bossPulls(fights: FightRow[], boss: Pick<FightRow, 'encounterId' | 'difficulty'>): PullView[] { return fights - .filter((fight) => !inMythicPlus(fight) && fight.encounterId === boss.encounterId && fight.difficulty === boss.difficulty) + .filter((fight) => isGroupedBossPull(fight) && fight.encounterId === boss.encounterId && fight.difficulty === boss.difficulty) .map((fight, i) => toView(fight, i + 1)); } +function runBossPulls(fights: FightRow[], runIndex: number): FightRow[] { + return fights.filter((fight) => fight.runIndex === runIndex && !isCombatPull(fight)); +} + +/** A boss pull's number among its boss's pulls, or among the boss pulls of its run (hidden pulls count); `null` for runs and combat pulls. */ +export function pullNumber(fights: FightRow[], row: FightRow): number | null { + if (row.run !== null || isCombatPull(row)) return null; + if (row.runIndex === null) return pullView(fights, row.index)?.n ?? null; + const at = runBossPulls(fights, row.runIndex).findIndex((fight) => fight.index === row.index); + return at === -1 ? null : at + 1; +} + /** The pull with log index `index`, numbered as in the pull list; `null` if the log has none. */ export function pullView(fights: FightRow[], index: number): PullView | null { const fight = fights.find((candidate) => candidate.index === index); @@ -255,10 +346,10 @@ export function pullView(fights: FightRow[], index: number): PullView | null { /** * Pulls `current` can be compared with: same boss and difficulty, not aborted, not itself. - * Comparison stays with pulls outside Mythic+, so runs and their boss pulls get none. + * Comparison stays with boss pulls outside Mythic+, so runs, their boss pulls and combat pulls get none. */ export function comparablePulls(fights: FightRow[], current: FightRow): PullView[] { // Mythic+ boss pulls stay out, also when their run is missing (logging started mid-key). - if (inMythicPlus(current) || current.difficulty === MYTHIC_PLUS_DIFFICULTY) return []; + if (!isGroupedBossPull(current) || current.difficulty === MYTHIC_PLUS_DIFFICULTY) return []; return bossPulls(fights, current).filter((view) => view.index !== current.index && view.status !== 'aborted'); } diff --git a/ui/src/store.test.ts b/ui/src/store.test.ts index 217bb70..ba1da0c 100644 --- a/ui/src/store.test.ts +++ b/ui/src/store.test.ts @@ -1625,6 +1625,7 @@ describe('live refresh', () => { zone: 'The Venomous Abyss', run: null, runIndex: null, + combat: null, }; } const LIVE: LogView = { ...LOG, fights: [wipe(1), wipe(2)] }; diff --git a/ui/src/styles/base.css b/ui/src/styles/base.css index abd86d0..b89ca08 100644 --- a/ui/src/styles/base.css +++ b/ui/src/styles/base.css @@ -143,6 +143,11 @@ html { background: var(--neutral-tint); color: var(--neutral-text); } +.chip.ended { + background: var(--neutral-tint); + color: var(--text-soft); + box-shadow: inset 0 0 0 1px var(--neutral-fill); +} .chip.chip-set { background: var(--accent-tint); color: var(--accent); diff --git a/ui/src/styles/fight.css b/ui/src/styles/fight.css index 4a1d45b..32391c7 100644 --- a/ui/src/styles/fight.css +++ b/ui/src/styles/fight.css @@ -151,6 +151,15 @@ font: 700 34px var(--font-label); letter-spacing: 0.01em; } +.fight-name .more-tag, +.fight-heading-name .more-tag { + margin-left: 12px; + vertical-align: middle; +} +.fight-name .more-tag { + font-size: 16px; + padding: 2px 8px; +} .fight-meta { display: flex; flex-wrap: wrap; diff --git a/ui/src/styles/runs.css b/ui/src/styles/runs.css index 4595f1a..fa58403 100644 --- a/ui/src/styles/runs.css +++ b/ui/src/styles/runs.css @@ -25,3 +25,24 @@ overflow: hidden; text-overflow: ellipsis; } +.pull.pull-trash { + background: color-mix(in srgb, var(--panel) 50%, var(--bg)); +} +.pull.pull-trash:hover { + background: var(--hover); +} +.pull-trash .combat-enemies .combat-name { + font-size: 13px; + font-weight: 400; + color: var(--text-soft); +} +.pull-trash .chip { + font-size: 11px; + padding: 2px 7px; +} +.pull-fold .chevron { + transition: transform 0.12s ease; +} +.pull-fold .chevron.chevron-open { + transform: rotate(90deg); +} diff --git a/ui/src/styles/start.css b/ui/src/styles/start.css index 53c70c9..b0b22b9 100644 --- a/ui/src/styles/start.css +++ b/ui/src/styles/start.css @@ -300,14 +300,14 @@ font-size: 13px; color: var(--muted); } -.pull-head { +.pull-columns { min-height: 29px; cursor: default; } -.pull-head:hover { +.pull-columns:hover { background: transparent; } -.pull-head .cap { +.pull-columns .cap { font-size: 11px; } .hp { @@ -321,6 +321,41 @@ font-size: 13px; color: var(--text-soft); } +.combat-pulls .pull { + grid-template-columns: minmax(220px, 1fr) minmax(150px, 260px) 92px 64px 70px 64px 20px; +} +.combat-pulls .pull-columns { + border-top: 0; +} +.combat-enemies { + display: flex; + align-items: center; + gap: 8px; + min-width: 0; +} +.combat-enemies .combat-name { + font-weight: 500; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.combat-zone { + font-size: 13px; + color: var(--muted); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.more-tag { + flex: none; + font-size: 12px; + font-weight: 500; + color: var(--muted); + padding: 1px 6px; + border-radius: 4px; + background: var(--tag-bg); + box-shadow: inset 0 0 0 1px var(--line-strong); +} .empty-state { display: flex; flex-direction: column; diff --git a/ui/src/styles/tokens.test.ts b/ui/src/styles/tokens.test.ts index 947425f..c9fc1d1 100644 --- a/ui/src/styles/tokens.test.ts +++ b/ui/src/styles/tokens.test.ts @@ -26,6 +26,7 @@ const FIXED_PAIRS: [foreground: string, background: string, minimum: number][] = ['panel', 'panel-raised'].map((panel): [string, string, number] => [text, panel, TEXT]), ), ['neutral-text', 'neutral-tint', TEXT], + ['text-soft', 'neutral-tint', TEXT], ['on-accent', 'accent', TEXT], ['accent', 'accent-tint', TEXT], ['kill-chip', 'kill-tint', TEXT], diff --git a/ui/src/test/compareFixture.ts b/ui/src/test/compareFixture.ts index cb39e42..889996e 100644 --- a/ui/src/test/compareFixture.ts +++ b/ui/src/test/compareFixture.ts @@ -69,6 +69,7 @@ function pull(index: number, outcome: Outcome, durationMs: number, bossHpPercent zone: 'The Venomous Abyss', run: null, runIndex: null, + combat: null, }; } diff --git a/ui/src/test/runFixture.ts b/ui/src/test/runFixture.ts index 4ef25aa..37ca6e1 100644 --- a/ui/src/test/runFixture.ts +++ b/ui/src/test/runFixture.ts @@ -33,6 +33,7 @@ function row( zone: 'Priory of the Sacred Flame', run: null, runIndex: 1, + combat: null, ...extra, }; }