mirror of
https://github.com/mangosfour/server.git
synced 2025-12-20 07:37:02 +00:00
[8653] Implemented per map guids store.
This patch implements storing guid->object pairs on per map level, this leads to less locking in ObjectAccessor in case of further multithreaded map update. For case of cross map guid looking (auras cases) all maps are linked into ObjectAccessor and can be traversed for this lookup. Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
parent
40b0612dfc
commit
45c9c136ba
18 changed files with 272 additions and 116 deletions
|
|
@ -32,6 +32,7 @@
|
|||
#include "SharedDefines.h"
|
||||
#include "GameSystem/GridRefManager.h"
|
||||
#include "MapRefManager.h"
|
||||
#include "Utilities/TypeList.h"
|
||||
|
||||
#include <bitset>
|
||||
#include <list>
|
||||
|
|
@ -420,8 +421,13 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
|||
void RemoveFromActive(Creature* obj);
|
||||
|
||||
Creature* GetCreature(uint64 guid);
|
||||
Vehicle* GetVehicle(uint64 guid);
|
||||
Pet* GetPet(uint64 guid);
|
||||
Unit* GetCreatureOrPet(uint64 guid);
|
||||
GameObject* GetGameObject(uint64 guid);
|
||||
DynamicObject* GetDynamicObject(uint64 guid);
|
||||
|
||||
TypeUnorderedMapContainer<AllMapStoredObjectTypes>& GetObjectsStore() { return m_objectsStore; }
|
||||
private:
|
||||
void LoadMapAndVMap(int gx, int gy);
|
||||
void LoadVMap(int gx, int gy);
|
||||
|
|
@ -484,6 +490,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
|||
typedef std::set<WorldObject*> ActiveNonPlayers;
|
||||
ActiveNonPlayers m_activeNonPlayers;
|
||||
ActiveNonPlayers::iterator m_activeNonPlayersIter;
|
||||
TypeUnorderedMapContainer<AllMapStoredObjectTypes> m_objectsStore;
|
||||
private:
|
||||
time_t i_gridExpiry;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue