game: add area name cache from WorldMapArea.dbc for /who zone display and exploration messages

- Load WorldMapArea.dbc lazily on first use to build areaId→name lookup
- /who results now show [Zone Name] alongside level: 'Name - Level 70 [Stormwind City]'
- SMSG_EXPLORATION_EXPERIENCE now shows 'Discovered Elwynn Forest! Gained X experience.'
  instead of generic 'Discovered new area!' message when the zone name is available
- Cache is populated once per session and shared across both callsites
This commit is contained in:
Kelsi 2026-03-10 08:06:21 -07:00
parent 846ba58d2e
commit 0a157d3255
2 changed files with 67 additions and 7 deletions

View file

@ -2147,6 +2147,12 @@ private:
std::unordered_map<uint32_t, std::string> achievementNameCache_;
bool achievementNameCacheLoaded_ = false;
void loadAchievementNameCache();
// Area name cache (lazy-loaded from WorldMapArea.dbc; maps AreaTable ID → display name)
std::unordered_map<uint32_t, std::string> areaNameCache_;
bool areaNameCacheLoaded_ = false;
void loadAreaNameCache();
std::string getAreaName(uint32_t areaId) const;
std::vector<TrainerTab> trainerTabs_;
void handleTrainerList(network::Packet& packet);
void loadSpellNameCache();