mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8678] Move objects updates store and proccessing for send to client in per map way.
This commit is contained in:
parent
abb77cfdbf
commit
8bf52f7c63
10 changed files with 80 additions and 61 deletions
|
|
@ -80,9 +80,6 @@ Object::Object( ) : m_PackGUID(sizeof(uint64)+1)
|
|||
|
||||
Object::~Object( )
|
||||
{
|
||||
if(m_objectUpdated)
|
||||
ObjectAccessor::Instance().RemoveUpdateObject(this);
|
||||
|
||||
if(m_uint32Values)
|
||||
{
|
||||
if(IsInWorld())
|
||||
|
|
@ -744,10 +741,11 @@ void Object::ClearUpdateMask(bool remove)
|
|||
if(m_uint32Values_mirror[index]!= m_uint32Values[index])
|
||||
m_uint32Values_mirror[index] = m_uint32Values[index];
|
||||
}
|
||||
|
||||
if(m_objectUpdated)
|
||||
{
|
||||
if(remove)
|
||||
ObjectAccessor::Instance().RemoveUpdateObject(this);
|
||||
RemoveFromClientUpdateList();
|
||||
m_objectUpdated = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -801,7 +799,7 @@ void Object::SetInt32Value( uint16 index, int32 value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -820,7 +818,7 @@ void Object::SetUInt32Value( uint16 index, uint32 value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -839,7 +837,7 @@ void Object::SetUInt64Value( uint16 index, const uint64 &value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -858,7 +856,7 @@ void Object::SetFloatValue( uint16 index, float value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -884,7 +882,7 @@ void Object::SetByteValue( uint16 index, uint8 offset, uint8 value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -910,7 +908,7 @@ void Object::SetUInt16Value( uint16 index, uint8 offset, uint16 value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -979,7 +977,7 @@ void Object::SetFlag( uint16 index, uint32 newFlag )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1000,7 +998,7 @@ void Object::RemoveFlag( uint16 index, uint32 oldFlag )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1025,7 +1023,7 @@ void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1050,7 +1048,7 @@ void Object::RemoveByteFlag( uint16 index, uint8 offset, uint8 oldFlag )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1871,6 +1869,16 @@ void WorldObject::UpdateObjectVisibility()
|
|||
GetMap()->UpdateObjectVisibility(this, cell, p);
|
||||
}
|
||||
|
||||
void WorldObject::AddToClientUpdateList()
|
||||
{
|
||||
GetMap()->AddUpdateObject(this);
|
||||
}
|
||||
|
||||
void WorldObject::RemoveFromClientUpdateList()
|
||||
{
|
||||
GetMap()->RemoveUpdateObject(this);
|
||||
}
|
||||
|
||||
struct WorldObjectChangeAccumulator
|
||||
{
|
||||
UpdateDataMapType &i_updateDatas;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue