mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Add multi-expansion support with data-driven protocol layer
Replace hardcoded WotLK protocol constants with a data-driven architecture supporting Classic 1.12.1, TBC 2.4.3, and WotLK 3.3.5a. Each expansion has JSON profiles for opcodes, update fields, and DBC layouts, plus C++ polymorphic packet parsers for binary format differences (movement flags, speed fields, transport data, spline format, char enum layout). Key components: - ExpansionRegistry: scans Data/expansions/*/expansion.json at startup - OpcodeTable: logical enum <-> wire values loaded from JSON - UpdateFieldTable: field indices loaded from JSON per expansion - DBCLayout: schema-driven DBC field lookups replacing magic numbers - PacketParsers: WotLK/TBC/Classic parsers with correct flag positions - Multi-manifest AssetManager: layered manifests with priority ordering - HDPackManager: overlay texture packs with expansion compatibility - Auth screen expansion picker replacing hardcoded version dropdown
This commit is contained in:
parent
aa16a687c2
commit
7092844b5e
51 changed files with 5258 additions and 887 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#include <algorithm>
|
||||
#include "pipeline/asset_manager.hpp"
|
||||
#include "pipeline/dbc_loader.hpp"
|
||||
#include "pipeline/dbc_layout.hpp"
|
||||
#include "pipeline/m2_loader.hpp"
|
||||
#include "pipeline/wmo_loader.hpp"
|
||||
#include "pipeline/adt_loader.hpp"
|
||||
|
|
@ -156,11 +157,16 @@ static void loadEmotesFromDbc() {
|
|||
return;
|
||||
}
|
||||
|
||||
const auto* activeLayout = pipeline::getActiveDBCLayout();
|
||||
const auto* etdL = activeLayout ? activeLayout->getLayout("EmotesTextData") : nullptr;
|
||||
const auto* emL = activeLayout ? activeLayout->getLayout("Emotes") : nullptr;
|
||||
const auto* etL = activeLayout ? activeLayout->getLayout("EmotesText") : nullptr;
|
||||
|
||||
std::unordered_map<uint32_t, std::string> textData;
|
||||
textData.reserve(emotesTextDataDbc->getRecordCount());
|
||||
for (uint32_t r = 0; r < emotesTextDataDbc->getRecordCount(); ++r) {
|
||||
uint32_t id = emotesTextDataDbc->getUInt32(r, 0);
|
||||
std::string text = emotesTextDataDbc->getString(r, 1);
|
||||
uint32_t id = emotesTextDataDbc->getUInt32(r, etdL ? (*etdL)["ID"] : 0);
|
||||
std::string text = emotesTextDataDbc->getString(r, etdL ? (*etdL)["Text"] : 1);
|
||||
if (!text.empty()) textData.emplace(id, std::move(text));
|
||||
}
|
||||
|
||||
|
|
@ -168,8 +174,8 @@ static void loadEmotesFromDbc() {
|
|||
if (auto emotesDbc = assetManager->loadDBC("Emotes.dbc"); emotesDbc && emotesDbc->isLoaded()) {
|
||||
emoteIdToAnim.reserve(emotesDbc->getRecordCount());
|
||||
for (uint32_t r = 0; r < emotesDbc->getRecordCount(); ++r) {
|
||||
uint32_t emoteId = emotesDbc->getUInt32(r, 0);
|
||||
uint32_t animId = emotesDbc->getUInt32(r, 2);
|
||||
uint32_t emoteId = emotesDbc->getUInt32(r, emL ? (*emL)["ID"] : 0);
|
||||
uint32_t animId = emotesDbc->getUInt32(r, emL ? (*emL)["AnimID"] : 2);
|
||||
if (animId != 0) emoteIdToAnim[emoteId] = animId;
|
||||
}
|
||||
}
|
||||
|
|
@ -177,10 +183,10 @@ static void loadEmotesFromDbc() {
|
|||
EMOTE_TABLE.clear();
|
||||
EMOTE_TABLE.reserve(emotesTextDbc->getRecordCount());
|
||||
for (uint32_t r = 0; r < emotesTextDbc->getRecordCount(); ++r) {
|
||||
std::string cmdRaw = emotesTextDbc->getString(r, 1);
|
||||
std::string cmdRaw = emotesTextDbc->getString(r, etL ? (*etL)["Command"] : 1);
|
||||
if (cmdRaw.empty()) continue;
|
||||
|
||||
uint32_t emoteRef = emotesTextDbc->getUInt32(r, 2);
|
||||
uint32_t emoteRef = emotesTextDbc->getUInt32(r, etL ? (*etL)["EmoteRef"] : 2);
|
||||
uint32_t animId = 0;
|
||||
auto animIt = emoteIdToAnim.find(emoteRef);
|
||||
if (animIt != emoteIdToAnim.end()) {
|
||||
|
|
@ -189,8 +195,8 @@ static void loadEmotesFromDbc() {
|
|||
animId = emoteRef; // fallback if EmotesText stores animation id directly
|
||||
}
|
||||
|
||||
uint32_t senderTargetTextId = emotesTextDbc->getUInt32(r, 5); // unisex, target, sender
|
||||
uint32_t senderNoTargetTextId = emotesTextDbc->getUInt32(r, 9); // unisex, no target, sender
|
||||
uint32_t senderTargetTextId = emotesTextDbc->getUInt32(r, etL ? (*etL)["SenderTargetTextID"] : 5); // unisex, target, sender
|
||||
uint32_t senderNoTargetTextId = emotesTextDbc->getUInt32(r, etL ? (*etL)["SenderNoTargetTextID"] : 9); // unisex, no target, sender
|
||||
|
||||
std::string textTarget;
|
||||
std::string textNoTarget;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue