[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

@ -428,6 +428,16 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
DynamicObject* GetDynamicObject(uint64 guid);
TypeUnorderedMapContainer<AllMapStoredObjectTypes>& GetObjectsStore() { return m_objectsStore; }
void AddUpdateObject(Object *obj)
{
i_objectsToClientUpdate.insert(obj);
}
void RemoveUpdateObject(Object *obj)
{
i_objectsToClientUpdate.erase( obj );
}
private:
void LoadMapAndVMap(int gx, int gy);
void LoadVMap(int gx, int gy);
@ -472,6 +482,8 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
void setNGrid(NGridType* grid, uint32 x, uint32 y);
void ScriptsProcess();
void SendObjectUpdates();
std::set<Object *> i_objectsToClientUpdate;
protected:
void SetUnloadReferenceLock(const GridPair &p, bool on) { getNGrid(p.x_coord, p.y_coord)->setUnloadReferenceLock(on); }