[Hotfix] Shared Memory Protection Fixes

This commit is contained in:
Akkadius 2022-07-27 17:37:20 -05:00
parent 5331f4d841
commit 4002d6a083
3 changed files with 19 additions and 5 deletions

View File

@ -932,8 +932,6 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
return false;
}
m_shared_items_count = GetItemsCount();
return true;
}
@ -1784,8 +1782,6 @@ bool SharedDatabase::LoadSpells(const std::string &prefix, int32 *records, const
LogError("Error Loading Spells: {}", ex.what());
return false;
}
m_shared_spells_count = GetSpellsCount();
return true;
}
@ -2403,4 +2399,14 @@ uint32 SharedDatabase::GetItemsCount()
}
return 0;
}
}
void SharedDatabase::SetSharedItemsCount(uint32 shared_items_count)
{
SharedDatabase::m_shared_items_count = shared_items_count;
}
void SharedDatabase::SetSharedSpellsCount(uint32 shared_spells_count)
{
SharedDatabase::m_shared_spells_count = shared_spells_count;
}

View File

@ -217,6 +217,10 @@ protected:
std::unique_ptr<EQ::MemoryMappedFile> base_data_mmf;
std::unique_ptr<EQ::MemoryMappedFile> spells_mmf;
public:
void SetSharedItemsCount(uint32 shared_items_count);
void SetSharedSpellsCount(uint32 shared_spells_count);
protected:
uint32 m_shared_items_count = 0;
uint32 m_shared_spells_count = 0;
};

View File

@ -333,6 +333,10 @@ int main(int argc, char** argv) {
return 1;
}
// load these here for now until spells and items can be truly repointed to "content_db"
database.SetSharedItemsCount(content_db.GetItemsCount());
database.SetSharedSpellsCount(content_db.GetSpellsCount());
LogInfo("Loading base data");
if (!database.LoadBaseData(hotfix_name)) {
LogError("Loading base data failed!");