feat(db): add CharSectionsRec

This commit is contained in:
fallenoak 2025-10-16 10:49:04 -05:00
parent fdd2b02867
commit cf45484044
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
4 changed files with 92 additions and 0 deletions

View File

@ -5,6 +5,7 @@ WowClientDB<AchievementRec> g_achievementDB;
WowClientDB<AreaTableRec> g_areaTableDB; WowClientDB<AreaTableRec> g_areaTableDB;
WowClientDB<Cfg_CategoriesRec> g_cfg_CategoriesDB; WowClientDB<Cfg_CategoriesRec> g_cfg_CategoriesDB;
WowClientDB<Cfg_ConfigsRec> g_cfg_ConfigsDB; WowClientDB<Cfg_ConfigsRec> g_cfg_ConfigsDB;
WowClientDB<CharSectionsRec> g_charSectionsDB;
WowClientDB<ChrClassesRec> g_chrClassesDB; WowClientDB<ChrClassesRec> g_chrClassesDB;
WowClientDB<ChrRacesRec> g_chrRacesDB; WowClientDB<ChrRacesRec> g_chrRacesDB;
WowClientDB<CreatureDisplayInfoRec> g_creatureDisplayInfoDB; WowClientDB<CreatureDisplayInfoRec> g_creatureDisplayInfoDB;
@ -20,6 +21,7 @@ void StaticDBLoadAll(void (*loadFn)(WowClientDB_Base*, const char*, int32_t)) {
loadFn(&g_areaTableDB, __FILE__, __LINE__); loadFn(&g_areaTableDB, __FILE__, __LINE__);
loadFn(&g_cfg_CategoriesDB, __FILE__, __LINE__); loadFn(&g_cfg_CategoriesDB, __FILE__, __LINE__);
loadFn(&g_cfg_ConfigsDB, __FILE__, __LINE__); loadFn(&g_cfg_ConfigsDB, __FILE__, __LINE__);
loadFn(&g_charSectionsDB, __FILE__, __LINE__);
loadFn(&g_chrClassesDB, __FILE__, __LINE__); loadFn(&g_chrClassesDB, __FILE__, __LINE__);
loadFn(&g_chrRacesDB, __FILE__, __LINE__); loadFn(&g_chrRacesDB, __FILE__, __LINE__);
loadFn(&g_creatureDisplayInfoDB, __FILE__, __LINE__); loadFn(&g_creatureDisplayInfoDB, __FILE__, __LINE__);

View File

@ -6,6 +6,7 @@
#include "db/rec/AreaTableRec.hpp" #include "db/rec/AreaTableRec.hpp"
#include "db/rec/Cfg_CategoriesRec.hpp" #include "db/rec/Cfg_CategoriesRec.hpp"
#include "db/rec/Cfg_ConfigsRec.hpp" #include "db/rec/Cfg_ConfigsRec.hpp"
#include "db/rec/CharSectionsRec.hpp"
#include "db/rec/ChrClassesRec.hpp" #include "db/rec/ChrClassesRec.hpp"
#include "db/rec/ChrRacesRec.hpp" #include "db/rec/ChrRacesRec.hpp"
#include "db/rec/CreatureDisplayInfoRec.hpp" #include "db/rec/CreatureDisplayInfoRec.hpp"
@ -16,6 +17,7 @@ extern WowClientDB<AchievementRec> g_achievementDB;
extern WowClientDB<AreaTableRec> g_areaTableDB; extern WowClientDB<AreaTableRec> g_areaTableDB;
extern WowClientDB<Cfg_CategoriesRec> g_cfg_CategoriesDB; extern WowClientDB<Cfg_CategoriesRec> g_cfg_CategoriesDB;
extern WowClientDB<Cfg_ConfigsRec> g_cfg_ConfigsDB; extern WowClientDB<Cfg_ConfigsRec> g_cfg_ConfigsDB;
extern WowClientDB<CharSectionsRec> g_charSectionsDB;
extern WowClientDB<ChrClassesRec> g_chrClassesDB; extern WowClientDB<ChrClassesRec> g_chrClassesDB;
extern WowClientDB<ChrRacesRec> g_chrRacesDB; extern WowClientDB<ChrRacesRec> g_chrRacesDB;
extern WowClientDB<CreatureDisplayInfoRec> g_creatureDisplayInfoDB; extern WowClientDB<CreatureDisplayInfoRec> g_creatureDisplayInfoDB;

View File

@ -0,0 +1,59 @@
// DO NOT EDIT: generated by whoa-autocode
#include "db/rec/CharSectionsRec.hpp"
#include "util/Locale.hpp"
#include "util/SFile.hpp"
const char* CharSectionsRec::GetFilename() {
return "DBFilesClient\\CharSections.dbc";
}
uint32_t CharSectionsRec::GetNumColumns() {
return 10;
}
uint32_t CharSectionsRec::GetRowSize() {
return 40;
}
bool CharSectionsRec::NeedIDAssigned() {
return false;
}
int32_t CharSectionsRec::GetID() {
return this->m_ID;
}
void CharSectionsRec::SetID(int32_t id) {
this->m_ID = id;
}
bool CharSectionsRec::Read(SFile* f, const char* stringBuffer) {
uint32_t textureNameOfs[3];
if (
!SFile::Read(f, &this->m_ID, sizeof(this->m_ID), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_raceID, sizeof(this->m_raceID), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_sexID, sizeof(this->m_sexID), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_baseSection, sizeof(this->m_baseSection), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &textureNameOfs[0], sizeof(uint32_t), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &textureNameOfs[1], sizeof(uint32_t), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &textureNameOfs[2], sizeof(uint32_t), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_flags, sizeof(this->m_flags), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_variationIndex, sizeof(this->m_variationIndex), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_colorIndex, sizeof(this->m_colorIndex), nullptr, nullptr, nullptr)
) {
return false;
}
if (stringBuffer) {
this->m_textureName[0] = &stringBuffer[textureNameOfs[0]];
this->m_textureName[1] = &stringBuffer[textureNameOfs[1]];
this->m_textureName[2] = &stringBuffer[textureNameOfs[2]];
} else {
this->m_textureName[0] = "";
this->m_textureName[1] = "";
this->m_textureName[2] = "";
}
return true;
}

View File

@ -0,0 +1,29 @@
// DO NOT EDIT: generated by whoa-autocode
#ifndef DB_REC_CHAR_SECTIONS_REC_HPP
#define DB_REC_CHAR_SECTIONS_REC_HPP
#include <cstdint>
class SFile;
class CharSectionsRec {
public:
int32_t m_ID;
int32_t m_raceID;
int32_t m_sexID;
int32_t m_baseSection;
const char* m_textureName[3];
int32_t m_flags;
int32_t m_variationIndex;
int32_t m_colorIndex;
static const char* GetFilename();
static uint32_t GetNumColumns();
static uint32_t GetRowSize();
static bool NeedIDAssigned();
int32_t GetID();
void SetID(int32_t id);
bool Read(SFile* f, const char* stringBuffer);
};
#endif