[8678] Move objects updates store and proccessing for send to client in per map way.

This commit is contained in:
VladimirMangos 2009-10-19 23:24:41 +04:00
parent abb77cfdbf
commit 8bf52f7c63
10 changed files with 80 additions and 61 deletions

View file

@ -152,27 +152,10 @@ class MANGOS_DLL_DECL ObjectAccessor : public MaNGOS::Singleton<ObjectAccessor,
void RemoveObject(Player *pl)
{
HashMapHolder<Player>::Remove(pl);
Guard guard(i_updateGuard);
i_objects.erase((Object *)pl);
}
void SaveAllPlayers();
void AddUpdateObject(Object *obj)
{
Guard guard(i_updateGuard);
i_objects.insert(obj);
}
void RemoveUpdateObject(Object *obj)
{
Guard guard(i_updateGuard);
i_objects.erase( obj );
}
void Update(uint32 diff);
Corpse* GetCorpseForPlayerGUID(uint64 guid);
void RemoveCorpse(Corpse *corpse);
void AddCorpse(Corpse* corpse);
@ -206,9 +189,7 @@ class MANGOS_DLL_DECL ObjectAccessor : public MaNGOS::Singleton<ObjectAccessor,
typedef ACE_Thread_Mutex LockType;
typedef MaNGOS::GeneralLock<LockType > Guard;
std::set<Object *> i_objects;
LockType i_playerGuard;
LockType i_updateGuard;
LockType i_corpseGuard;
};