MCPcopy Create free account
hub / github.com/EQEmu/EQEmu / LoadItems

Method LoadItems

common/shareddb.cpp:912–931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

910}
911
912bool SharedDatabase::LoadItems(const std::string &prefix) {
913 items_mmf.reset(nullptr);
914
915 try {
916 const auto Config = EQEmuConfig::get();
917 EQ::IPCMutex mutex("items");
918 mutex.Lock();
919 std::string file_name = fmt::format("{}/{}{}", PathManager::Instance()->GetSharedMemoryPath(), prefix, std::string("items"));
920 items_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
921 items_hash = std::make_unique<EQ::FixedMemoryHashSet<EQ::ItemData>>(static_cast<uint8*>(items_mmf->Get()), items_mmf->Size());
922 mutex.Unlock();
923
924 LogInfo("Loaded [{}] items via shared memory", Strings::Commify(m_shared_items_count));
925 } catch(std::exception& ex) {
926 LogError("Error Loading Items: {}", ex.what());
927 return false;
928 }
929
930 return true;
931}
932
933void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id)
934{

Callers 3

HandleMessageMethod · 0.45
DatabaseLoadRoutinesMethod · 0.45
LoadItemsFunction · 0.45

Calls 13

stringFunction · 0.85
ClampFunction · 0.85
UnlockMethod · 0.80
strn0cpyFunction · 0.70
getFunction · 0.50
resetMethod · 0.45
LockMethod · 0.45
GetMethod · 0.45
SizeMethod · 0.45
whatMethod · 0.45
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected