feat: parse MSG_BATTLEGROUND_PLAYER_POSITIONS and show flag carriers on minimap

Replaces the silent consume with full packet parsing: reads two lists of
(guid, x, y) positions (typically ally and horde flag carriers) and stores
them in bgPlayerPositions_. Renders each as a colored diamond on the minimap
(blue=group0, red=group1) with a "Flag carrier" tooltip showing the player's
name when available.
This commit is contained in:
Kelsi 2026-03-17 20:54:59 -07:00
parent 48cb7df4b4
commit 113be66314
3 changed files with 76 additions and 3 deletions

View file

@ -497,6 +497,15 @@ public:
return bgScoreboard_.players.empty() ? nullptr : &bgScoreboard_;
}
// BG flag carrier / important player positions (MSG_BATTLEGROUND_PLAYER_POSITIONS)
struct BgPlayerPosition {
uint64_t guid = 0;
float wowX = 0.0f; // canonical WoW X (north)
float wowY = 0.0f; // canonical WoW Y (west)
int group = 0; // 0 = first list (usually ally flag carriers), 1 = second list
};
const std::vector<BgPlayerPosition>& getBgPlayerPositions() const { return bgPlayerPositions_; }
// Network latency (milliseconds, updated each PONG response)
uint32_t getLatencyMs() const { return lastLatency; }
@ -2780,6 +2789,9 @@ private:
// BG scoreboard (MSG_PVP_LOG_DATA)
BgScoreboardData bgScoreboard_;
// BG flag carrier / player positions (MSG_BATTLEGROUND_PLAYER_POSITIONS)
std::vector<BgPlayerPosition> bgPlayerPositions_;
// Instance encounter boss units (slots 0-4 from SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT)
std::array<uint64_t, kMaxEncounterSlots> encounterUnitGuids_ = {}; // 0 = empty slot