Add expansion DBC CSVs, Turtle support, and server-specific login

This commit is contained in:
Kelsi 2026-02-13 00:10:01 -08:00
parent 90a1aa8a92
commit 203664af43
139 changed files with 676758 additions and 91 deletions

View file

@ -169,7 +169,7 @@ public:
* Factory function to create the right parser set for an expansion.
*/
inline std::unique_ptr<PacketParsers> createPacketParsers(const std::string& expansionId) {
if (expansionId == "classic") return std::make_unique<ClassicPacketParsers>();
if (expansionId == "classic" || expansionId == "turtle") return std::make_unique<ClassicPacketParsers>();
if (expansionId == "tbc") return std::make_unique<TbcPacketParsers>();
return std::make_unique<WotlkPacketParsers>();
}

View file

@ -71,6 +71,13 @@ public:
*/
BLPImage loadTexture(const std::string& path);
/**
* Set expansion-specific data path for CSV DBC lookup.
* When set, loadDBC() checks expansionDataPath/db/Name.csv before
* falling back to the manifest (binary DBC from extracted MPQs).
*/
void setExpansionDataPath(const std::string& path);
/**
* Load a DBC file
* @param name DBC file name (e.g., "Map.dbc")
@ -127,6 +134,7 @@ public:
private:
bool initialized = false;
std::string dataPath;
std::string expansionDataPath_; // e.g. "Data/expansions/wotlk"
// Base manifest (loaded from dataPath/manifest.json)
AssetManifest manifest_;

View file

@ -130,6 +130,12 @@ private:
mutable bool idCacheBuilt = false;
void buildIdCache() const;
/**
* Load from CSV text format (produced by dbc_to_csv tool).
* Rebuilds the same in-memory layout as binary load.
*/
bool loadCSV(const std::vector<uint8_t>& csvData);
};
} // namespace pipeline

View file

@ -42,6 +42,14 @@ public:
const std::string& getStatusMessage() const { return statusMessage; }
private:
struct ServerProfile {
std::string hostname;
int port = 3724;
std::string username;
std::string passwordHash; // SHA1 hex (UPPER(user):UPPER(pass))
std::string expansionId; // "wotlk", "tbc", "classic", "turtle", ...
};
// UI state
char hostname[256] = "127.0.0.1";
char username[256] = "";
@ -63,6 +71,10 @@ private:
bool usingStoredHash = false;
static constexpr const char* PASSWORD_PLACEHOLDER = "\x01\x01\x01\x01\x01\x01\x01\x01";
// Saved server-specific profiles
std::vector<ServerProfile> servers_;
int selectedServerIndex_ = -1; // -1 = custom/unlisted
// Callbacks
std::function<void()> onSuccess;
@ -79,11 +91,16 @@ private:
/**
* Persist/restore login fields
*/
void saveLoginInfo();
void saveLoginInfo(bool includePasswordHash);
void loadLoginInfo();
static std::string getConfigPath();
bool loginInfoLoaded = false;
static std::string makeServerKey(const std::string& host, int port);
void selectServerProfile(int index);
void upsertCurrentServerProfile(bool includePasswordHash);
std::string currentExpansionId() const;
// Background video
bool videoInitAttempted = false;
rendering::VideoPlayer backgroundVideo;