mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 04:59:41 -04:00
Core/PacketIO: Use ByteBuffer from UpdateData instead of copying to it after (#28347)
This commit is contained in:
@@ -166,14 +166,14 @@ void Object::RemoveFromWorld()
|
||||
|
||||
void Object::BuildMovementUpdateBlock(UpdateData* data, uint32 flags) const
|
||||
{
|
||||
ByteBuffer buf(500);
|
||||
ByteBuffer& buf = data->GetBuffer();
|
||||
|
||||
buf << uint8(UPDATETYPE_MOVEMENT);
|
||||
buf << GetPackGUID();
|
||||
|
||||
BuildMovementUpdate(&buf, flags);
|
||||
|
||||
data->AddUpdateBlock(buf);
|
||||
data->AddUpdateBlock();
|
||||
}
|
||||
|
||||
void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const
|
||||
@@ -196,14 +196,14 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
||||
|
||||
//TC_LOG_DEBUG("BuildCreateUpdate: update-type: %u, object-type: %u got flags: %X, flags2: %X", updateType, m_objectTypeId, flags, flags2);
|
||||
|
||||
ByteBuffer buf(500);
|
||||
ByteBuffer& buf = data->GetBuffer();
|
||||
buf << uint8(updateType);
|
||||
buf << GetPackGUID();
|
||||
buf << uint8(m_objectTypeId);
|
||||
|
||||
BuildMovementUpdate(&buf, flags);
|
||||
BuildValuesUpdate(updateType, &buf, target);
|
||||
data->AddUpdateBlock(buf);
|
||||
data->AddUpdateBlock();
|
||||
}
|
||||
|
||||
void Object::SendUpdateToPlayer(Player* player)
|
||||
@@ -222,14 +222,14 @@ void Object::SendUpdateToPlayer(Player* player)
|
||||
|
||||
void Object::BuildValuesUpdateBlockForPlayer(UpdateData* data, Player const* target) const
|
||||
{
|
||||
ByteBuffer buf(500);
|
||||
ByteBuffer& buf = data->GetBuffer();
|
||||
|
||||
buf << uint8(UPDATETYPE_VALUES);
|
||||
buf << GetPackGUID();
|
||||
|
||||
BuildValuesUpdate(UPDATETYPE_VALUES, &buf, target);
|
||||
|
||||
data->AddUpdateBlock(buf);
|
||||
data->AddUpdateBlock();
|
||||
}
|
||||
|
||||
void Object::BuildOutOfRangeUpdateBlock(UpdateData* data) const
|
||||
|
||||
Reference in New Issue
Block a user