Kelsidavis-WoWee/include/game/expansion_profile.hpp
Kelsi 886f4daf2e Add per-expansion asset overlay system and fix CharSections DBC layout
Expansion overlays allow each expansion to supplement the base asset data
via an assetManifest field in expansion.json, loaded at priority 50 (below
HD packs). The asset extractor gains --reference-manifest for delta-only
extraction. Also fixes CharSections field indices (VariationIndex=4,
ColorIndex=5, Texture1=6) across all DBC layout references.
2026-02-14 00:00:26 -08:00

76 lines
2.5 KiB
C++

#pragma once
#include <cstdint>
#include <string>
#include <vector>
#include <unordered_map>
#include <optional>
namespace wowee {
namespace game {
/**
* Identifies a WoW expansion for protocol/asset selection.
*/
struct ExpansionProfile {
std::string id; // "classic", "tbc", "wotlk", "cata"
std::string name; // "Wrath of the Lich King"
std::string shortName; // "WotLK"
uint8_t majorVersion = 0;
uint8_t minorVersion = 0;
uint8_t patchVersion = 0;
uint16_t build = 0; // Realm build (sent in LOGON_CHALLENGE)
uint16_t worldBuild = 0; // World build (sent in CMSG_AUTH_SESSION, defaults to build)
uint8_t protocolVersion = 0; // SRP auth protocol version byte
// Client header fields used in LOGON_CHALLENGE.
// Defaults match a typical Windows x86 client.
std::string game = "WoW";
std::string platform = "x86";
std::string os = "Win";
std::string locale = "enUS";
uint32_t timezone = 0;
std::string dataPath; // Absolute path to expansion data dir
std::string assetManifest; // Path to expansion-specific asset manifest (absolute, resolved from dataPath)
uint32_t maxLevel = 60;
std::vector<uint32_t> races;
std::vector<uint32_t> classes;
std::string versionString() const; // e.g. "3.3.5a"
};
/**
* Scans Data/expansions/ for available expansion profiles and manages the active selection.
*/
class ExpansionRegistry {
public:
/**
* Scan dataRoot/expansions/ for expansion.json files.
* @param dataRoot Path to Data/ directory (e.g. "./Data")
* @return Number of profiles discovered
*/
size_t initialize(const std::string& dataRoot);
/** All discovered profiles. */
const std::vector<ExpansionProfile>& getAllProfiles() const { return profiles_; }
/** Lookup by id (e.g. "wotlk"). Returns nullptr if not found. */
const ExpansionProfile* getProfile(const std::string& id) const;
/** Set the active expansion. Returns false if id not found. */
bool setActive(const std::string& id);
/** Get the active expansion profile. Never null after successful initialize(). */
const ExpansionProfile* getActive() const;
/** Convenience: active expansion id. Empty if none. */
const std::string& getActiveId() const { return activeId_; }
private:
std::vector<ExpansionProfile> profiles_;
std::string activeId_;
bool loadProfile(const std::string& jsonPath, const std::string& dirPath);
};
} // namespace game
} // namespace wowee