Core/PacketIO: Updated packet structures to 9.2.0

This commit is contained in:
Shauren
2022-02-24 23:16:55 +01:00
parent f96c8cc39b
commit 9f30afe352
54 changed files with 1406 additions and 1067 deletions
+27 -2
View File
@@ -299,9 +299,14 @@ void Object::BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags, Playe
bool HasFallDirection = unit->HasUnitMovementFlag(MOVEMENTFLAG_FALLING);
bool HasFall = HasFallDirection || unit->m_movementInfo.jump.fallTime != 0;
bool HasSpline = unit->IsSplineEnabled();
bool HasInertia = unit->m_movementInfo.inertia.has_value();
*data << GetGUID(); // MoverGUID
*data << uint32(unit->GetUnitMovementFlags());
*data << uint32(unit->GetExtraUnitMovementFlags());
*data << uint32(unit->GetExtraUnitMovementFlags2());
*data << uint32(unit->m_movementInfo.time); // MoveTime
*data << float(unit->GetPositionX());
*data << float(unit->GetPositionY());
@@ -317,17 +322,23 @@ void Object::BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags, Playe
//for (std::size_t i = 0; i < RemoveForcesIDs.size(); ++i)
// *data << ObjectGuid(RemoveForcesIDs);
data->WriteBits(unit->GetUnitMovementFlags(), 30);
data->WriteBits(unit->GetExtraUnitMovementFlags(), 18);
data->WriteBit(!unit->m_movementInfo.transport.guid.IsEmpty()); // HasTransport
data->WriteBit(HasFall); // HasFall
data->WriteBit(HasSpline); // HasSpline - marks that the unit uses spline movement
data->WriteBit(false); // HeightChangeFailed
data->WriteBit(false); // RemoteTimeValid
data->WriteBit(HasInertia); // HasInertia
if (!unit->m_movementInfo.transport.guid.IsEmpty())
*data << unit->m_movementInfo.transport;
if (HasInertia)
{
*data << unit->m_movementInfo.inertia->guid;
*data << unit->m_movementInfo.inertia->force.PositionXYZStream();
*data << uint32(unit->m_movementInfo.inertia->lifetime);
}
if (HasFall)
{
*data << uint32(unit->m_movementInfo.jump.fallTime); // Time
@@ -454,6 +465,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags, Playe
bool hasAreaTriggerBox = shape.IsBox();
bool hasAreaTriggerPolygon = createProperties && shape.IsPolygon();
bool hasAreaTriggerCylinder = shape.IsCylinder();
bool hasDisk = shape.IsDisk();
bool hasAreaTriggerSpline = areaTrigger->HasSplines();
bool hasOrbit = areaTrigger->HasOrbit();
bool hasMovementScript = false;
@@ -473,6 +485,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags, Playe
data->WriteBit(hasAreaTriggerBox);
data->WriteBit(hasAreaTriggerPolygon);
data->WriteBit(hasAreaTriggerCylinder);
data->WriteBit(hasDisk);
data->WriteBit(hasAreaTriggerSpline);
data->WriteBit(hasOrbit);
data->WriteBit(hasMovementScript);
@@ -542,6 +555,18 @@ void Object::BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags, Playe
*data << float(shape.CylinderDatas.LocationZOffsetTarget);
}
if (hasDisk)
{
*data << float(shape.DiskDatas.InnerRadius);
*data << float(shape.DiskDatas.InnerRadiusTarget);
*data << float(shape.DiskDatas.OuterRadius);
*data << float(shape.DiskDatas.OuterRadiusTarget);
*data << float(shape.DiskDatas.Height);
*data << float(shape.DiskDatas.HeightTarget);
*data << float(shape.DiskDatas.LocationZOffset);
*data << float(shape.DiskDatas.LocationZOffsetTarget);
}
//if (hasMovementScript)
// *data << *areaTrigger->GetMovementScript(); // AreaTriggerMovementScriptInfo