[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:
ApoC 2009-10-16 20:11:00 +02:00
parent 40b0612dfc
commit 45c9c136ba
18 changed files with 272 additions and 116 deletions

View file

@ -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();
}