[Base Data] Remove from shared memory and simplify (#4045)

* [Base Data] Remove from shared memory and simplify

- Removes Base Data loading from shared memory and puts it into zone.
- Changes type of `level` and `class` to `uint8_t` from `uint32_t` for consistency since we're renaming fields here anyway.
- Renames `unk1` to `hp_regen` in `base_data` table.
- Renames `unk2` to `end_regen` in `base_data` table.
- These changed fields were already mapped, we just hadn't renamed them for whatever reason.
- Regenerates Base Data repository.
- Adds `#reload base_data` to reload base data in real time.

* Cleanup

* Update shareddb.h

* Cleanup.

* Update shareddb.cpp

* Update main.cpp
This commit is contained in:
Alex King
2024-02-05 18:11:20 -05:00
committed by GitHub
parent b6b779723e
commit 8edf7a07e3
24 changed files with 213 additions and 381 deletions
+10
View File
@@ -45,6 +45,7 @@
#include "../common/repositories/loottable_entries_repository.h"
#include "../common/repositories/lootdrop_repository.h"
#include "../common/repositories/lootdrop_entries_repository.h"
#include "../common/repositories/base_data_repository.h"
struct EXPModifier
{
@@ -439,6 +440,12 @@ public:
LootdropRepository::Lootdrop GetLootdrop(const uint32 lootdrop_id) const;
std::vector<LootdropEntriesRepository::LootdropEntries> GetLootdropEntries(const uint32 lootdrop_id) const;
// Base Data
inline void ClearBaseData() { m_base_data.clear(); };
BaseDataRepository::BaseData GetBaseData(uint8 level, uint8 class_id);
void LoadBaseData();
void ReloadBaseData();
private:
bool allow_mercs;
bool can_bind;
@@ -499,6 +506,9 @@ private:
std::vector<LoottableEntriesRepository::LoottableEntries> m_loottable_entries = {};
std::vector<LootdropRepository::Lootdrop> m_lootdrops = {};
std::vector<LootdropEntriesRepository::LootdropEntries> m_lootdrop_entries = {};
// Base Data
std::vector<BaseDataRepository::BaseData> m_base_data = { };
};
#endif