mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +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
|
|
@ -41,7 +41,7 @@ void DynamicObject::AddToWorld()
|
|||
{
|
||||
///- Register the dynamicObject for guid lookup
|
||||
if(!IsInWorld())
|
||||
ObjectAccessor::Instance().AddObject(this);
|
||||
GetMap()->GetObjectsStore().insert<DynamicObject>(GetGUID(), (DynamicObject*)this);
|
||||
|
||||
Object::AddToWorld();
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@ void DynamicObject::RemoveFromWorld()
|
|||
{
|
||||
///- Remove the dynamicObject from the accessor
|
||||
if(IsInWorld())
|
||||
ObjectAccessor::Instance().RemoveObject(this);
|
||||
GetMap()->GetObjectsStore().erase<DynamicObject>(GetGUID(), (DynamicObject*)NULL);
|
||||
|
||||
Object::RemoveFromWorld();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue