Vanilla/Turtle WoW compatibility: fix UPDATE_OBJECT, chat, equipment, creatures

- Route SMSG_UPDATE_OBJECT through polymorphic parsers for correct
  vanilla format (uint8 updateFlags, 6 speeds vs WotLK uint16/9)
- Fix SMSG_DESTROY_OBJECT for vanilla (8 bytes, no isDeath field)
- Add MSG_MOVE_* handlers for other player movement relay
- Add ClassicPacketParsers::parseMessageChat with targetGuid read
  and monster-type name handling
- Resolve chat sender names from player name cache before display
- Fix CSV DBC field 0 always treated as numeric ID (fixes 16+ garbled
  Turtle CSVs including Map, AreaTable, Spell, CreatureDisplayInfo)
- Add CSV DBC validation: reject garbled CSVs (>80% zero IDs) and
  fall back to binary DBC files
- Fix ItemDisplayInfo texture component field index (14+ not 15+)
  for binary DBC with gender-aware suffix resolution
- Spawn other players as visible M2 models via creature callback
- Map name cache dedup prevents overwrites from duplicate CSV records
This commit is contained in:
Kelsi 2026-02-13 18:59:09 -08:00
parent 430c2bdcfa
commit fb0ae26fe6
13 changed files with 689 additions and 106 deletions

View file

@ -231,6 +231,12 @@ bool DBCFile::loadCSV(const std::vector<uint8_t>& csvData) {
}
}
// Field 0 is always the numeric record ID in DBC files — never a string.
// Some CSV exports incorrectly mark it as a string column; force-remove it.
if (stringCols.erase(0) > 0) {
LOG_DEBUG("CSV DBC: removed field 0 from string columns (always numeric ID)");
}
recordSize = fieldCount * 4;
// --- Build string block with initial null byte ---
@ -288,7 +294,11 @@ bool DBCFile::loadCSV(const std::vector<uint8_t>& csvData) {
if (end == std::string::npos) end = line.size();
std::string tok = line.substr(pos, end - pos);
if (!tok.empty()) {
row.fields[col] = static_cast<uint32_t>(std::stoul(tok));
try {
row.fields[col] = static_cast<uint32_t>(std::stoul(tok));
} catch (...) {
row.fields[col] = 0; // non-numeric value in numeric field
}
}
pos = (end < line.size()) ? end + 1 : line.size();
}