Initial work on shared memory hotfixes

This commit is contained in:
KimLS
2015-06-23 17:39:06 -07:00
parent 32e880f571
commit 67143f1b8a
23 changed files with 266 additions and 185 deletions
+4 -2
View File
@@ -24,7 +24,7 @@
#include "../common/eqemu_exception.h"
#include "../common/item_struct.h"
void LoadItems(SharedDatabase *database) {
void LoadItems(SharedDatabase *database, const std::string &prefix) {
EQEmu::IPCMutex mutex("items");
mutex.Lock();
@@ -36,7 +36,9 @@ void LoadItems(SharedDatabase *database) {
}
uint32 size = static_cast<uint32>(EQEmu::FixedMemoryHashSet<Item_Struct>::estimated_size(items, max_item));
EQEmu::MemoryMappedFile mmf("shared/items", size);
std::string file_name = std::string("shared/") + prefix + std::string("items");
EQEmu::MemoryMappedFile mmf(file_name, size);
mmf.ZeroFile();
void *ptr = mmf.Get();