Core/Misc: Reduce the scope of ReadMovementInfo (Unit -> Player)
This commit is contained in:
@@ -27042,3 +27042,288 @@ bool Player::CanUseMastery() const
|
||||
{
|
||||
return HasSpell(MasterySpells[getClass()]);
|
||||
}
|
||||
|
||||
void Player::ReadMovementInfo(WorldPacket& data, MovementInfo* mi, Movement::ExtraMovementStatusElement* extras /*= NULL*/)
|
||||
{
|
||||
MovementStatusElements const* sequence = GetMovementStatusElementsSequence(data.GetOpcode());
|
||||
if (!sequence)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "Player::ReadMovementInfo: No movement sequence found for opcode %s", GetOpcodeNameForLogging(data.GetOpcode()).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
bool hasMovementFlags = false;
|
||||
bool hasMovementFlags2 = false;
|
||||
bool hasTimestamp = false;
|
||||
bool hasOrientation = false;
|
||||
bool hasTransportData = false;
|
||||
|
||||
ObjectGuid guid;
|
||||
ObjectGuid tguid;
|
||||
|
||||
for (; *sequence != MSEEnd; ++sequence)
|
||||
{
|
||||
MovementStatusElements const& element = *sequence;
|
||||
|
||||
switch (element)
|
||||
{
|
||||
case MSEHasGuidByte0:
|
||||
case MSEHasGuidByte1:
|
||||
case MSEHasGuidByte2:
|
||||
case MSEHasGuidByte3:
|
||||
case MSEHasGuidByte4:
|
||||
case MSEHasGuidByte5:
|
||||
case MSEHasGuidByte6:
|
||||
case MSEHasGuidByte7:
|
||||
guid[element - MSEHasGuidByte0] = data.ReadBit();
|
||||
break;
|
||||
case MSEHasTransportGuidByte0:
|
||||
case MSEHasTransportGuidByte1:
|
||||
case MSEHasTransportGuidByte2:
|
||||
case MSEHasTransportGuidByte3:
|
||||
case MSEHasTransportGuidByte4:
|
||||
case MSEHasTransportGuidByte5:
|
||||
case MSEHasTransportGuidByte6:
|
||||
case MSEHasTransportGuidByte7:
|
||||
if (hasTransportData)
|
||||
tguid[element - MSEHasTransportGuidByte0] = data.ReadBit();
|
||||
break;
|
||||
case MSEGuidByte0:
|
||||
case MSEGuidByte1:
|
||||
case MSEGuidByte2:
|
||||
case MSEGuidByte3:
|
||||
case MSEGuidByte4:
|
||||
case MSEGuidByte5:
|
||||
case MSEGuidByte6:
|
||||
case MSEGuidByte7:
|
||||
data.ReadByteSeq(guid[element - MSEGuidByte0]);
|
||||
break;
|
||||
case MSETransportGuidByte0:
|
||||
case MSETransportGuidByte1:
|
||||
case MSETransportGuidByte2:
|
||||
case MSETransportGuidByte3:
|
||||
case MSETransportGuidByte4:
|
||||
case MSETransportGuidByte5:
|
||||
case MSETransportGuidByte6:
|
||||
case MSETransportGuidByte7:
|
||||
if (hasTransportData)
|
||||
data.ReadByteSeq(tguid[element - MSETransportGuidByte0]);
|
||||
break;
|
||||
case MSEHasMovementFlags:
|
||||
hasMovementFlags = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasMovementFlags2:
|
||||
hasMovementFlags2 = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasTimestamp:
|
||||
hasTimestamp = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasOrientation:
|
||||
hasOrientation = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasTransportData:
|
||||
hasTransportData = data.ReadBit();
|
||||
break;
|
||||
case MSEHasTransportTime2:
|
||||
if (hasTransportData)
|
||||
mi->bits.hasTransportTime2 = data.ReadBit();
|
||||
break;
|
||||
case MSEHasTransportTime3:
|
||||
if (hasTransportData)
|
||||
mi->bits.hasTransportTime3 = data.ReadBit();
|
||||
break;
|
||||
case MSEHasPitch:
|
||||
mi->bits.hasPitch = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasFallData:
|
||||
mi->bits.hasFallData = data.ReadBit();
|
||||
break;
|
||||
case MSEHasFallDirection:
|
||||
if (mi->bits.hasFallData)
|
||||
mi->bits.hasFallDirection = data.ReadBit();
|
||||
break;
|
||||
case MSEHasSplineElevation:
|
||||
mi->bits.hasSplineElevation = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasSpline:
|
||||
data.ReadBit();
|
||||
break;
|
||||
case MSEMovementFlags:
|
||||
if (hasMovementFlags)
|
||||
mi->flags = data.ReadBits(30);
|
||||
break;
|
||||
case MSEMovementFlags2:
|
||||
if (hasMovementFlags2)
|
||||
mi->flags2 = data.ReadBits(12);
|
||||
break;
|
||||
case MSETimestamp:
|
||||
if (hasTimestamp)
|
||||
data >> mi->time;
|
||||
break;
|
||||
case MSEPositionX:
|
||||
data >> mi->pos.m_positionX;
|
||||
break;
|
||||
case MSEPositionY:
|
||||
data >> mi->pos.m_positionY;
|
||||
break;
|
||||
case MSEPositionZ:
|
||||
data >> mi->pos.m_positionZ;
|
||||
break;
|
||||
case MSEOrientation:
|
||||
if (hasOrientation)
|
||||
mi->pos.SetOrientation(data.read<float>());
|
||||
break;
|
||||
case MSETransportPositionX:
|
||||
if (hasTransportData)
|
||||
data >> mi->t_pos.m_positionX;
|
||||
break;
|
||||
case MSETransportPositionY:
|
||||
if (hasTransportData)
|
||||
data >> mi->t_pos.m_positionY;
|
||||
break;
|
||||
case MSETransportPositionZ:
|
||||
if (hasTransportData)
|
||||
data >> mi->t_pos.m_positionZ;
|
||||
break;
|
||||
case MSETransportOrientation:
|
||||
if (hasTransportData)
|
||||
mi->t_pos.SetOrientation(data.read<float>());
|
||||
break;
|
||||
case MSETransportSeat:
|
||||
if (hasTransportData)
|
||||
data >> mi->t_seat;
|
||||
break;
|
||||
case MSETransportTime:
|
||||
if (hasTransportData)
|
||||
data >> mi->t_time;
|
||||
break;
|
||||
case MSETransportTime2:
|
||||
if (hasTransportData && mi->bits.hasTransportTime2)
|
||||
data >> mi->t_time2;
|
||||
break;
|
||||
case MSETransportTime3:
|
||||
if (hasTransportData && mi->bits.hasTransportTime3)
|
||||
data >> mi->t_time3;
|
||||
break;
|
||||
case MSEPitch:
|
||||
if (mi->bits.hasPitch)
|
||||
data >> mi->pitch;
|
||||
break;
|
||||
case MSEFallTime:
|
||||
if (mi->bits.hasFallData)
|
||||
data >> mi->fallTime;
|
||||
break;
|
||||
case MSEFallVerticalSpeed:
|
||||
if (mi->bits.hasFallData)
|
||||
data >> mi->j_zspeed;
|
||||
break;
|
||||
case MSEFallCosAngle:
|
||||
if (mi->bits.hasFallData && mi->bits.hasFallDirection)
|
||||
data >> mi->j_cosAngle;
|
||||
break;
|
||||
case MSEFallSinAngle:
|
||||
if (mi->bits.hasFallData && mi->bits.hasFallDirection)
|
||||
data >> mi->j_sinAngle;
|
||||
break;
|
||||
case MSEFallHorizontalSpeed:
|
||||
if (mi->bits.hasFallData && mi->bits.hasFallDirection)
|
||||
data >> mi->j_xyspeed;
|
||||
break;
|
||||
case MSESplineElevation:
|
||||
if (mi->bits.hasSplineElevation)
|
||||
data >> mi->splineElevation;
|
||||
break;
|
||||
case MSECounter:
|
||||
data.read_skip<uint32>(); /// @TODO: Maybe compare it with m_movementCounter to verify that packets are sent & received in order?
|
||||
break;
|
||||
case MSEZeroBit:
|
||||
case MSEOneBit:
|
||||
data.ReadBit();
|
||||
break;
|
||||
case MSEExtraElement:
|
||||
extras->ReadNextElement(data);
|
||||
break;
|
||||
default:
|
||||
ASSERT(Movement::PrintInvalidSequenceElement(element, __FUNCTION__));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mi->guid = guid;
|
||||
mi->t_guid = tguid;
|
||||
|
||||
if (hasTransportData && mi->pos.m_positionX != mi->t_pos.m_positionX)
|
||||
if (GetTransport())
|
||||
GetTransport()->UpdatePosition(mi);
|
||||
|
||||
//! Anti-cheat checks. Please keep them in seperate if () blocks to maintain a clear overview.
|
||||
//! Might be subject to latency, so just remove improper flags.
|
||||
#ifdef TRINITY_DEBUG
|
||||
#define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \
|
||||
{ \
|
||||
if (check) \
|
||||
{ \
|
||||
sLog->outDebug(LOG_FILTER_UNITS, "Player::ReadMovementInfo: Violation of MovementFlags found (%s). " \
|
||||
"MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Mask %u will be removed.", \
|
||||
STRINGIZE(check), mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetGUIDLow(), maskToRemove); \
|
||||
mi->RemoveMovementFlag((maskToRemove)); \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \
|
||||
if (check) \
|
||||
mi->RemoveMovementFlag((maskToRemove));
|
||||
#endif
|
||||
|
||||
/*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid
|
||||
in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD.
|
||||
It will freeze clients that receive this player's movement info.
|
||||
*/
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT),
|
||||
MOVEMENTFLAG_ROOT);
|
||||
|
||||
//! Cannot hover without SPELL_AURA_HOVER
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !HasAuraType(SPELL_AURA_HOVER),
|
||||
MOVEMENTFLAG_HOVER);
|
||||
|
||||
//! Cannot ascend and descend at the same time
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ASCENDING) && mi->HasMovementFlag(MOVEMENTFLAG_DESCENDING),
|
||||
MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING);
|
||||
|
||||
//! Cannot move left and right at the same time
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_RIGHT),
|
||||
MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT);
|
||||
|
||||
//! Cannot strafe left and right at the same time
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT),
|
||||
MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT);
|
||||
|
||||
//! Cannot pitch up and down at the same time
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_PITCH_UP) && mi->HasMovementFlag(MOVEMENTFLAG_PITCH_DOWN),
|
||||
MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN);
|
||||
|
||||
//! Cannot move forwards and backwards at the same time
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FORWARD) && mi->HasMovementFlag(MOVEMENTFLAG_BACKWARD),
|
||||
MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD);
|
||||
|
||||
//! Cannot walk on water without SPELL_AURA_WATER_WALK
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !HasAuraType(SPELL_AURA_WATER_WALK),
|
||||
MOVEMENTFLAG_WATERWALKING);
|
||||
|
||||
//! Cannot feather fall without SPELL_AURA_FEATHER_FALL
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FALLING_SLOW) && !HasAuraType(SPELL_AURA_FEATHER_FALL),
|
||||
MOVEMENTFLAG_FALLING_SLOW);
|
||||
|
||||
/*! Cannot fly if no fly auras present. Exception is being a GM.
|
||||
Note that we check for account level instead of Player::IsGameMaster() because in some
|
||||
situations it may be feasable to use .gm fly on as a GM without having .gm on,
|
||||
e.g. aerial combat.
|
||||
*/
|
||||
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && ToPlayer()->GetSession()->GetSecurity() == SEC_PLAYER &&
|
||||
!ToPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) &&
|
||||
!ToPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED),
|
||||
MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY);
|
||||
|
||||
#undef REMOVE_VIOLATING_FLAGS
|
||||
}
|
||||
|
||||
@@ -2136,7 +2136,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void UpdateCorpseReclaimDelay();
|
||||
void SendCorpseReclaimDelay(bool load = false);
|
||||
|
||||
uint32 GetBlockPercent() { return GetUInt32Value(PLAYER_SHIELD_BLOCK); }
|
||||
uint32 GetBlockPercent() const { return GetUInt32Value(PLAYER_SHIELD_BLOCK); }
|
||||
bool CanParry() const { return m_canParry; }
|
||||
void SetCanParry(bool value);
|
||||
bool CanBlock() const { return m_canBlock; }
|
||||
@@ -2490,6 +2490,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool IsInWhisperWhiteList(uint64 guid);
|
||||
void RemoveFromWhisperWhiteList(uint64 guid) { WhisperList.remove(guid); }
|
||||
|
||||
void ReadMovementInfo(WorldPacket& data, MovementInfo* mi, Movement::ExtraMovementStatusElement* extras = NULL);
|
||||
|
||||
/*! These methods send different packets to the client in apply and unapply case.
|
||||
These methods are only sent to the current unit.
|
||||
*/
|
||||
|
||||
@@ -431,11 +431,11 @@ void Unit::UpdateSplinePosition()
|
||||
loc.orientation = vehicle->GetOrientation();
|
||||
}
|
||||
else if (TransportBase* transport = GetDirectTransport())
|
||||
transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation);
|
||||
transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation);
|
||||
}
|
||||
|
||||
if (HasUnitState(UNIT_STATE_CANNOT_TURN))
|
||||
loc.orientation = GetOrientation();
|
||||
if (HasUnitState(UNIT_STATE_CANNOT_TURN))
|
||||
loc.orientation = GetOrientation();
|
||||
|
||||
UpdatePosition(loc.x, loc.y, loc.z, loc.orientation);
|
||||
}
|
||||
@@ -16050,292 +16050,17 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::ReadMovementInfo(WorldPacket& data, MovementInfo* mi, Movement::ExtraMovementStatusElement* extras /*= NULL*/)
|
||||
{
|
||||
if (GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
bool hasMovementFlags = false;
|
||||
bool hasMovementFlags2 = false;
|
||||
bool hasTimestamp = false;
|
||||
bool hasOrientation = false;
|
||||
bool hasTransportData = false;
|
||||
|
||||
MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode());
|
||||
if (sequence == NULL)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "Unit::ReadMovementInfo: No movement sequence found for opcode %s", GetOpcodeNameForLogging(data.GetOpcode()).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
ObjectGuid guid;
|
||||
ObjectGuid tguid;
|
||||
|
||||
for (uint32 i = 0; i < MSE_COUNT; ++i)
|
||||
{
|
||||
MovementStatusElements element = sequence[i];
|
||||
if (element == MSEEnd)
|
||||
break;
|
||||
|
||||
if (element >= MSEHasGuidByte0 && element <= MSEHasGuidByte7)
|
||||
{
|
||||
guid[element - MSEHasGuidByte0] = data.ReadBit();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (element >= MSEHasTransportGuidByte0 &&
|
||||
element <= MSEHasTransportGuidByte7)
|
||||
{
|
||||
if (hasTransportData)
|
||||
tguid[element - MSEHasTransportGuidByte0] = data.ReadBit();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (element >= MSEGuidByte0 && element <= MSEGuidByte7)
|
||||
{
|
||||
data.ReadByteSeq(guid[element - MSEGuidByte0]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (element >= MSETransportGuidByte0 &&
|
||||
element <= MSETransportGuidByte7)
|
||||
{
|
||||
if (hasTransportData)
|
||||
data.ReadByteSeq(tguid[element - MSETransportGuidByte0]);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (element)
|
||||
{
|
||||
case MSEHasMovementFlags:
|
||||
hasMovementFlags = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasMovementFlags2:
|
||||
hasMovementFlags2 = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasTimestamp:
|
||||
hasTimestamp = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasOrientation:
|
||||
hasOrientation = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasTransportData:
|
||||
hasTransportData = data.ReadBit();
|
||||
break;
|
||||
case MSEHasTransportTime2:
|
||||
if (hasTransportData)
|
||||
mi->bits.hasTransportTime2 = data.ReadBit();
|
||||
break;
|
||||
case MSEHasTransportTime3:
|
||||
if (hasTransportData)
|
||||
mi->bits.hasTransportTime3 = data.ReadBit();
|
||||
break;
|
||||
case MSEHasPitch:
|
||||
mi->bits.hasPitch = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasFallData:
|
||||
mi->bits.hasFallData = data.ReadBit();
|
||||
break;
|
||||
case MSEHasFallDirection:
|
||||
if (mi->bits.hasFallData)
|
||||
mi->bits.hasFallDirection = data.ReadBit();
|
||||
break;
|
||||
case MSEHasSplineElevation:
|
||||
mi->bits.hasSplineElevation = !data.ReadBit();
|
||||
break;
|
||||
case MSEHasSpline:
|
||||
data.ReadBit();
|
||||
break;
|
||||
case MSEMovementFlags:
|
||||
if (hasMovementFlags)
|
||||
mi->flags = data.ReadBits(30);
|
||||
break;
|
||||
case MSEMovementFlags2:
|
||||
if (hasMovementFlags2)
|
||||
mi->flags2 = data.ReadBits(12);
|
||||
break;
|
||||
case MSETimestamp:
|
||||
if (hasTimestamp)
|
||||
data >> mi->time;
|
||||
break;
|
||||
case MSEPositionX:
|
||||
data >> mi->pos.m_positionX;
|
||||
break;
|
||||
case MSEPositionY:
|
||||
data >> mi->pos.m_positionY;
|
||||
break;
|
||||
case MSEPositionZ:
|
||||
data >> mi->pos.m_positionZ;
|
||||
break;
|
||||
case MSEOrientation:
|
||||
if (hasOrientation)
|
||||
mi->pos.SetOrientation(data.read<float>());
|
||||
break;
|
||||
case MSETransportPositionX:
|
||||
if (hasTransportData)
|
||||
data >> mi->t_pos.m_positionX;
|
||||
break;
|
||||
case MSETransportPositionY:
|
||||
if (hasTransportData)
|
||||
data >> mi->t_pos.m_positionY;
|
||||
break;
|
||||
case MSETransportPositionZ:
|
||||
if (hasTransportData)
|
||||
data >> mi->t_pos.m_positionZ;
|
||||
break;
|
||||
case MSETransportOrientation:
|
||||
if (hasTransportData)
|
||||
mi->t_pos.SetOrientation(data.read<float>());
|
||||
break;
|
||||
case MSETransportSeat:
|
||||
if (hasTransportData)
|
||||
data >> mi->t_seat;
|
||||
break;
|
||||
case MSETransportTime:
|
||||
if (hasTransportData)
|
||||
data >> mi->t_time;
|
||||
break;
|
||||
case MSETransportTime2:
|
||||
if (hasTransportData && mi->bits.hasTransportTime2)
|
||||
data >> mi->t_time2;
|
||||
break;
|
||||
case MSETransportTime3:
|
||||
if (hasTransportData && mi->bits.hasTransportTime3)
|
||||
data >> mi->t_time3;
|
||||
break;
|
||||
case MSEPitch:
|
||||
if (mi->bits.hasPitch)
|
||||
data >> mi->pitch;
|
||||
break;
|
||||
case MSEFallTime:
|
||||
if (mi->bits.hasFallData)
|
||||
data >> mi->fallTime;
|
||||
break;
|
||||
case MSEFallVerticalSpeed:
|
||||
if (mi->bits.hasFallData)
|
||||
data >> mi->j_zspeed;
|
||||
break;
|
||||
case MSEFallCosAngle:
|
||||
if (mi->bits.hasFallData && mi->bits.hasFallDirection)
|
||||
data >> mi->j_cosAngle;
|
||||
break;
|
||||
case MSEFallSinAngle:
|
||||
if (mi->bits.hasFallData && mi->bits.hasFallDirection)
|
||||
data >> mi->j_sinAngle;
|
||||
break;
|
||||
case MSEFallHorizontalSpeed:
|
||||
if (mi->bits.hasFallData && mi->bits.hasFallDirection)
|
||||
data >> mi->j_xyspeed;
|
||||
break;
|
||||
case MSESplineElevation:
|
||||
if (mi->bits.hasSplineElevation)
|
||||
data >> mi->splineElevation;
|
||||
break;
|
||||
case MSECounter:
|
||||
data.read_skip<uint32>(); /// @TODO: Maybe compare it with m_movementCounter to verify that packets are sent & received in order?
|
||||
break;
|
||||
case MSEZeroBit:
|
||||
case MSEOneBit:
|
||||
data.ReadBit();
|
||||
break;
|
||||
case MSEExtraElement:
|
||||
extras->ReadNextElement(data);
|
||||
break;
|
||||
default:
|
||||
ASSERT(Movement::PrintInvalidSequenceElement(element, __FUNCTION__));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mi->guid = guid;
|
||||
mi->t_guid = tguid;
|
||||
|
||||
if (hasTransportData && mi->pos.m_positionX != mi->t_pos.m_positionX)
|
||||
if (GetTransport())
|
||||
GetTransport()->UpdatePosition(mi);
|
||||
|
||||
//! Anti-cheat checks. Please keep them in seperate if () blocks to maintain a clear overview.
|
||||
//! Might be subject to latency, so just remove improper flags.
|
||||
#ifdef TRINITY_DEBUG
|
||||
#define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \
|
||||
{ \
|
||||
if (check) \
|
||||
{ \
|
||||
sLog->outDebug(LOG_FILTER_UNITS, "Unit::ReadMovementInfo: Violation of MovementFlags found (%s). " \
|
||||
"MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Mask %u will be removed.", \
|
||||
STRINGIZE(check), mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetGUIDLow(), maskToRemove); \
|
||||
mi->RemoveMovementFlag((maskToRemove)); \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \
|
||||
if (check) \
|
||||
mi->RemoveMovementFlag((maskToRemove));
|
||||
#endif
|
||||
|
||||
|
||||
/*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid
|
||||
in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD.
|
||||
It will freeze clients that receive this player's movement info.
|
||||
*/
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT),
|
||||
MOVEMENTFLAG_ROOT);
|
||||
|
||||
//! Cannot hover without SPELL_AURA_HOVER
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !HasAuraType(SPELL_AURA_HOVER),
|
||||
MOVEMENTFLAG_HOVER);
|
||||
|
||||
//! Cannot ascend and descend at the same time
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ASCENDING) && mi->HasMovementFlag(MOVEMENTFLAG_DESCENDING),
|
||||
MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING);
|
||||
|
||||
//! Cannot move left and right at the same time
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_RIGHT),
|
||||
MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT);
|
||||
|
||||
//! Cannot strafe left and right at the same time
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT),
|
||||
MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT);
|
||||
|
||||
//! Cannot pitch up and down at the same time
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_PITCH_UP) && mi->HasMovementFlag(MOVEMENTFLAG_PITCH_DOWN),
|
||||
MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN);
|
||||
|
||||
//! Cannot move forwards and backwards at the same time
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FORWARD) && mi->HasMovementFlag(MOVEMENTFLAG_BACKWARD),
|
||||
MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD);
|
||||
|
||||
//! Cannot walk on water without SPELL_AURA_WATER_WALK
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !HasAuraType(SPELL_AURA_WATER_WALK),
|
||||
MOVEMENTFLAG_WATERWALKING);
|
||||
|
||||
//! Cannot feather fall without SPELL_AURA_FEATHER_FALL
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FALLING_SLOW) && !HasAuraType(SPELL_AURA_FEATHER_FALL),
|
||||
MOVEMENTFLAG_FALLING_SLOW);
|
||||
|
||||
/*! Cannot fly if no fly auras present. Exception is being a GM.
|
||||
Note that we check for account level instead of Player::IsGameMaster() because in some
|
||||
situations it may be feasable to use .gm fly on as a GM without having .gm on,
|
||||
e.g. aerial combat.
|
||||
*/
|
||||
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && ToPlayer()->GetSession()->GetSecurity() == SEC_PLAYER &&
|
||||
!ToPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) &&
|
||||
!ToPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED),
|
||||
MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY);
|
||||
|
||||
#undef REMOVE_VIOLATING_FLAGS
|
||||
}
|
||||
|
||||
void Unit::WriteMovementInfo(WorldPacket& data, Movement::ExtraMovementStatusElement* extras /*= NULL*/)
|
||||
{
|
||||
Unit const* mover = GetCharmerGUID() ? GetCharmer() : this;
|
||||
if (Player const* player = ToPlayer())
|
||||
mover = player->m_mover;
|
||||
|
||||
MovementInfo const& mi = mover->m_movementInfo;
|
||||
|
||||
bool hasMovementFlags = mover->GetUnitMovementFlags() != 0;
|
||||
bool hasMovementFlags2 = mover->GetExtraUnitMovementFlags() != 0;
|
||||
bool hasTimestamp = GetTypeId() == TYPEID_PLAYER ? (mover->m_movementInfo.time != 0) : true;
|
||||
bool hasTimestamp = true;
|
||||
bool hasOrientation = !G3D::fuzzyEq(mover->GetOrientation(), 0.0f);
|
||||
bool hasTransportData = GetTransGUID() != 0;
|
||||
bool hasSpline = mover->IsSplineEnabled();
|
||||
@@ -16349,6 +16074,7 @@ void Unit::WriteMovementInfo(WorldPacket& data, Movement::ExtraMovementStatusEle
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
hasTimestamp = mover->m_movementInfo.time != 0;
|
||||
hasTransportTime2 = mover->m_movementInfo.bits.hasTransportTime2;
|
||||
hasTransportTime3 = mover->m_movementInfo.bits.hasTransportTime3;
|
||||
hasPitch = mover->m_movementInfo.bits.hasPitch;
|
||||
@@ -16368,7 +16094,7 @@ void Unit::WriteMovementInfo(WorldPacket& data, Movement::ExtraMovementStatusEle
|
||||
hasSplineElevation = mover->HasUnitMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION);
|
||||
}
|
||||
|
||||
MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode());
|
||||
MovementStatusElements const* sequence = GetMovementStatusElementsSequence(data.GetOpcode());
|
||||
if (!sequence)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "Unit::WriteMovementInfo: No movement sequence found for opcode %s", GetOpcodeNameForLogging(data.GetOpcode()).c_str());
|
||||
@@ -16378,181 +16104,193 @@ void Unit::WriteMovementInfo(WorldPacket& data, Movement::ExtraMovementStatusEle
|
||||
ObjectGuid guid = mover->GetGUID();
|
||||
ObjectGuid tguid = hasTransportData ? GetTransGUID() : 0;
|
||||
|
||||
for (uint32 i = 0; i < MSE_COUNT; ++i)
|
||||
for (; *sequence != MSEEnd; ++sequence)
|
||||
{
|
||||
MovementStatusElements element = sequence[i];
|
||||
if (element == MSEEnd)
|
||||
break;
|
||||
|
||||
if (element >= MSEHasGuidByte0 && element <= MSEHasGuidByte7)
|
||||
{
|
||||
data.WriteBit(guid[element - MSEHasGuidByte0]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (element >= MSEHasTransportGuidByte0 &&
|
||||
element <= MSEHasTransportGuidByte7)
|
||||
{
|
||||
if (hasTransportData)
|
||||
data.WriteBit(tguid[element - MSEHasTransportGuidByte0]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (element >= MSEGuidByte0 && element <= MSEGuidByte7)
|
||||
{
|
||||
data.WriteByteSeq(guid[element - MSEGuidByte0]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (element >= MSETransportGuidByte0 &&
|
||||
element <= MSETransportGuidByte7)
|
||||
{
|
||||
if (hasTransportData)
|
||||
data.WriteByteSeq(tguid[element - MSETransportGuidByte0]);
|
||||
continue;
|
||||
}
|
||||
MovementStatusElements const& element = *sequence;
|
||||
|
||||
switch (element)
|
||||
{
|
||||
case MSEHasMovementFlags:
|
||||
data.WriteBit(!hasMovementFlags);
|
||||
break;
|
||||
case MSEHasMovementFlags2:
|
||||
data.WriteBit(!hasMovementFlags2);
|
||||
break;
|
||||
case MSEHasTimestamp:
|
||||
data.WriteBit(!hasTimestamp);
|
||||
break;
|
||||
case MSEHasOrientation:
|
||||
data.WriteBit(!hasOrientation);
|
||||
break;
|
||||
case MSEHasTransportData:
|
||||
data.WriteBit(hasTransportData);
|
||||
break;
|
||||
case MSEHasTransportTime2:
|
||||
if (hasTransportData)
|
||||
data.WriteBit(hasTransportTime2);
|
||||
break;
|
||||
case MSEHasTransportTime3:
|
||||
if (hasTransportData)
|
||||
data.WriteBit(hasTransportTime3);
|
||||
break;
|
||||
case MSEHasPitch:
|
||||
data.WriteBit(!hasPitch);
|
||||
break;
|
||||
case MSEHasFallData:
|
||||
data.WriteBit(hasFallData);
|
||||
break;
|
||||
case MSEHasFallDirection:
|
||||
if (hasFallData)
|
||||
data.WriteBit(hasFallDirection);
|
||||
break;
|
||||
case MSEHasSplineElevation:
|
||||
data.WriteBit(!hasSplineElevation);
|
||||
break;
|
||||
case MSEHasSpline:
|
||||
data.WriteBit(hasSpline);
|
||||
break;
|
||||
case MSEMovementFlags:
|
||||
if (hasMovementFlags)
|
||||
data.WriteBits(mover->GetUnitMovementFlags(), 30);
|
||||
break;
|
||||
case MSEMovementFlags2:
|
||||
if (hasMovementFlags2)
|
||||
data.WriteBits(mover->GetExtraUnitMovementFlags(), 12);
|
||||
break;
|
||||
case MSETimestamp:
|
||||
if (hasTimestamp)
|
||||
data << getMSTime();
|
||||
break;
|
||||
case MSEPositionX:
|
||||
data << mover->GetPositionX();
|
||||
break;
|
||||
case MSEPositionY:
|
||||
data << mover->GetPositionY();
|
||||
break;
|
||||
case MSEPositionZ:
|
||||
data << mover->GetPositionZ();
|
||||
break;
|
||||
case MSEOrientation:
|
||||
if (hasOrientation)
|
||||
data << mover->GetOrientation();
|
||||
break;
|
||||
case MSETransportPositionX:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransOffsetX();
|
||||
break;
|
||||
case MSETransportPositionY:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransOffsetY();
|
||||
break;
|
||||
case MSETransportPositionZ:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransOffsetZ();
|
||||
break;
|
||||
case MSETransportOrientation:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransOffsetO();
|
||||
break;
|
||||
case MSETransportSeat:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransSeat();
|
||||
break;
|
||||
case MSETransportTime:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransTime();
|
||||
break;
|
||||
case MSETransportTime2:
|
||||
if (hasTransportData && hasTransportTime2)
|
||||
data << mover->m_movementInfo.t_time2;
|
||||
break;
|
||||
case MSETransportTime3:
|
||||
if (hasTransportData && hasTransportTime3)
|
||||
data << mover->m_movementInfo.t_time3;
|
||||
break;
|
||||
case MSEPitch:
|
||||
if (hasPitch)
|
||||
data << mover->m_movementInfo.pitch;
|
||||
break;
|
||||
case MSEFallTime:
|
||||
if (hasFallData)
|
||||
data << mover->m_movementInfo.fallTime;
|
||||
break;
|
||||
case MSEFallVerticalSpeed:
|
||||
if (hasFallData)
|
||||
data << mover->m_movementInfo.j_zspeed;
|
||||
break;
|
||||
case MSEFallCosAngle:
|
||||
if (hasFallData && hasFallDirection)
|
||||
data << mover->m_movementInfo.j_cosAngle;
|
||||
break;
|
||||
case MSEFallSinAngle:
|
||||
if (hasFallData && hasFallDirection)
|
||||
data << mover->m_movementInfo.j_sinAngle;
|
||||
break;
|
||||
case MSEFallHorizontalSpeed:
|
||||
if (hasFallData && hasFallDirection)
|
||||
data << mover->m_movementInfo.j_xyspeed;
|
||||
break;
|
||||
case MSESplineElevation:
|
||||
if (hasSplineElevation)
|
||||
data << mover->m_movementInfo.splineElevation;
|
||||
break;
|
||||
case MSECounter:
|
||||
data << m_movementCounter++;
|
||||
break;
|
||||
case MSEZeroBit:
|
||||
data.WriteBit(0);
|
||||
break;
|
||||
case MSEOneBit:
|
||||
data.WriteBit(1);
|
||||
break;
|
||||
case MSEExtraElement:
|
||||
extras->WriteNextElement(data);
|
||||
break;
|
||||
default:
|
||||
ASSERT(Movement::PrintInvalidSequenceElement(element, __FUNCTION__));
|
||||
break;
|
||||
case MSEHasGuidByte0:
|
||||
case MSEHasGuidByte1:
|
||||
case MSEHasGuidByte2:
|
||||
case MSEHasGuidByte3:
|
||||
case MSEHasGuidByte4:
|
||||
case MSEHasGuidByte5:
|
||||
case MSEHasGuidByte6:
|
||||
case MSEHasGuidByte7:
|
||||
data.WriteBit(guid[element - MSEHasGuidByte0]);
|
||||
break;
|
||||
case MSEHasTransportGuidByte0:
|
||||
case MSEHasTransportGuidByte1:
|
||||
case MSEHasTransportGuidByte2:
|
||||
case MSEHasTransportGuidByte3:
|
||||
case MSEHasTransportGuidByte4:
|
||||
case MSEHasTransportGuidByte5:
|
||||
case MSEHasTransportGuidByte6:
|
||||
case MSEHasTransportGuidByte7:
|
||||
if (hasTransportData)
|
||||
data.WriteBit(tguid[element - MSEHasTransportGuidByte0]);
|
||||
break;
|
||||
case MSEGuidByte0:
|
||||
case MSEGuidByte1:
|
||||
case MSEGuidByte2:
|
||||
case MSEGuidByte3:
|
||||
case MSEGuidByte4:
|
||||
case MSEGuidByte5:
|
||||
case MSEGuidByte6:
|
||||
case MSEGuidByte7:
|
||||
data.WriteByteSeq(guid[element - MSEGuidByte0]);
|
||||
break;
|
||||
case MSETransportGuidByte0:
|
||||
case MSETransportGuidByte1:
|
||||
case MSETransportGuidByte2:
|
||||
case MSETransportGuidByte3:
|
||||
case MSETransportGuidByte4:
|
||||
case MSETransportGuidByte5:
|
||||
case MSETransportGuidByte6:
|
||||
case MSETransportGuidByte7:
|
||||
if (hasTransportData)
|
||||
data.WriteByteSeq(tguid[element - MSETransportGuidByte0]);
|
||||
break;
|
||||
case MSEHasMovementFlags:
|
||||
data.WriteBit(!hasMovementFlags);
|
||||
break;
|
||||
case MSEHasMovementFlags2:
|
||||
data.WriteBit(!hasMovementFlags2);
|
||||
break;
|
||||
case MSEHasTimestamp:
|
||||
data.WriteBit(!hasTimestamp);
|
||||
break;
|
||||
case MSEHasOrientation:
|
||||
data.WriteBit(!hasOrientation);
|
||||
break;
|
||||
case MSEHasTransportData:
|
||||
data.WriteBit(hasTransportData);
|
||||
break;
|
||||
case MSEHasTransportTime2:
|
||||
if (hasTransportData)
|
||||
data.WriteBit(hasTransportTime2);
|
||||
break;
|
||||
case MSEHasTransportTime3:
|
||||
if (hasTransportData)
|
||||
data.WriteBit(hasTransportTime3);
|
||||
break;
|
||||
case MSEHasPitch:
|
||||
data.WriteBit(!hasPitch);
|
||||
break;
|
||||
case MSEHasFallData:
|
||||
data.WriteBit(hasFallData);
|
||||
break;
|
||||
case MSEHasFallDirection:
|
||||
if (hasFallData)
|
||||
data.WriteBit(hasFallDirection);
|
||||
break;
|
||||
case MSEHasSplineElevation:
|
||||
data.WriteBit(!hasSplineElevation);
|
||||
break;
|
||||
case MSEHasSpline:
|
||||
data.WriteBit(hasSpline);
|
||||
break;
|
||||
case MSEMovementFlags:
|
||||
if (hasMovementFlags)
|
||||
data.WriteBits(mover->GetUnitMovementFlags(), 30);
|
||||
break;
|
||||
case MSEMovementFlags2:
|
||||
if (hasMovementFlags2)
|
||||
data.WriteBits(mover->GetExtraUnitMovementFlags(), 12);
|
||||
break;
|
||||
case MSETimestamp:
|
||||
if (hasTimestamp)
|
||||
data << getMSTime();
|
||||
break;
|
||||
case MSEPositionX:
|
||||
data << mover->GetPositionX();
|
||||
break;
|
||||
case MSEPositionY:
|
||||
data << mover->GetPositionY();
|
||||
break;
|
||||
case MSEPositionZ:
|
||||
data << mover->GetPositionZ();
|
||||
break;
|
||||
case MSEOrientation:
|
||||
if (hasOrientation)
|
||||
data << mover->GetOrientation();
|
||||
break;
|
||||
case MSETransportPositionX:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransOffsetX();
|
||||
break;
|
||||
case MSETransportPositionY:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransOffsetY();
|
||||
break;
|
||||
case MSETransportPositionZ:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransOffsetZ();
|
||||
break;
|
||||
case MSETransportOrientation:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransOffsetO();
|
||||
break;
|
||||
case MSETransportSeat:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransSeat();
|
||||
break;
|
||||
case MSETransportTime:
|
||||
if (hasTransportData)
|
||||
data << mover->GetTransTime();
|
||||
break;
|
||||
case MSETransportTime2:
|
||||
if (hasTransportData && hasTransportTime2)
|
||||
data << mi.t_time2;
|
||||
break;
|
||||
case MSETransportTime3:
|
||||
if (hasTransportData && hasTransportTime3)
|
||||
data << mi.t_time3;
|
||||
break;
|
||||
case MSEPitch:
|
||||
if (hasPitch)
|
||||
data << mi.pitch;
|
||||
break;
|
||||
case MSEFallTime:
|
||||
if (hasFallData)
|
||||
data << mi.fallTime;
|
||||
break;
|
||||
case MSEFallVerticalSpeed:
|
||||
if (hasFallData)
|
||||
data << mi.j_zspeed;
|
||||
break;
|
||||
case MSEFallCosAngle:
|
||||
if (hasFallData && hasFallDirection)
|
||||
data << mi.j_cosAngle;
|
||||
break;
|
||||
case MSEFallSinAngle:
|
||||
if (hasFallData && hasFallDirection)
|
||||
data << mi.j_sinAngle;
|
||||
break;
|
||||
case MSEFallHorizontalSpeed:
|
||||
if (hasFallData && hasFallDirection)
|
||||
data << mi.j_xyspeed;
|
||||
break;
|
||||
case MSESplineElevation:
|
||||
if (hasSplineElevation)
|
||||
data << mi.splineElevation;
|
||||
break;
|
||||
case MSECounter:
|
||||
data << m_movementCounter++;
|
||||
break;
|
||||
case MSEZeroBit:
|
||||
data.WriteBit(0);
|
||||
break;
|
||||
case MSEOneBit:
|
||||
data.WriteBit(1);
|
||||
break;
|
||||
case MSEExtraElement:
|
||||
extras->WriteNextElement(data);
|
||||
break;
|
||||
default:
|
||||
ASSERT(Movement::PrintInvalidSequenceElement(element, __FUNCTION__));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1489,7 +1489,7 @@ class Unit : public WorldObject
|
||||
int32 GetMechanicResistChance(const SpellInfo* spell);
|
||||
bool CanUseAttackType(uint8 attacktype) const;
|
||||
|
||||
virtual uint32 GetBlockPercent() { return 30; }
|
||||
virtual uint32 GetBlockPercent() const { return 30; }
|
||||
|
||||
uint32 GetUnitMeleeSkill(Unit const* target = NULL) const;
|
||||
|
||||
@@ -2113,7 +2113,6 @@ class Unit : public WorldObject
|
||||
void _ExitVehicle(Position const* exitPosition = NULL);
|
||||
void _EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp = NULL);
|
||||
|
||||
void ReadMovementInfo(WorldPacket& data, MovementInfo* mi, Movement::ExtraMovementStatusElement* extras = NULL);
|
||||
void WriteMovementInfo(WorldPacket& data, Movement::ExtraMovementStatusElement* extras = NULL);
|
||||
|
||||
bool isMoving() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_MOVING); }
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
#include "MovementStructures.h"
|
||||
#include "Player.h"
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements PlayerMoveSequence[] =
|
||||
MovementStatusElements const PlayerMove[] =
|
||||
{
|
||||
MSEHasFallData,
|
||||
MSEHasGuidByte3,
|
||||
@@ -92,8 +91,7 @@ MovementStatusElements PlayerMoveSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementFallLandSequence[] =
|
||||
MovementStatusElements const MovementFallLand[] =
|
||||
{
|
||||
MSEPositionX,
|
||||
MSEPositionY,
|
||||
@@ -165,8 +163,7 @@ MovementStatusElements MovementFallLandSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementHeartBeatSequence[] =
|
||||
MovementStatusElements const MovementHeartBeat[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionX,
|
||||
@@ -238,8 +235,7 @@ MovementStatusElements MovementHeartBeatSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementJumpSequence[] =
|
||||
MovementStatusElements const MovementJump[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionX,
|
||||
@@ -311,8 +307,7 @@ MovementStatusElements MovementJumpSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementSetFacingSequence[] =
|
||||
MovementStatusElements const MovementSetFacing[] =
|
||||
{
|
||||
MSEPositionX,
|
||||
MSEPositionY,
|
||||
@@ -384,8 +379,7 @@ MovementStatusElements MovementSetFacingSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementSetPitchSequence[] =
|
||||
MovementStatusElements const MovementSetPitch[] =
|
||||
{
|
||||
MSEPositionX,
|
||||
MSEPositionZ,
|
||||
@@ -457,8 +451,7 @@ MovementStatusElements MovementSetPitchSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStartBackwardSequence[] =
|
||||
MovementStatusElements const MovementStartBackward[] =
|
||||
{
|
||||
MSEPositionX,
|
||||
MSEPositionZ,
|
||||
@@ -530,8 +523,7 @@ MovementStatusElements MovementStartBackwardSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStartForwardSequence[] =
|
||||
MovementStatusElements const MovementStartForward[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionZ,
|
||||
@@ -604,8 +596,7 @@ MovementStatusElements MovementStartForwardSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStartStrafeLeftSequence[] =
|
||||
MovementStatusElements const MovementStartStrafeLeft[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionX,
|
||||
@@ -677,8 +668,7 @@ MovementStatusElements MovementStartStrafeLeftSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStartStrafeRightSequence[] =
|
||||
MovementStatusElements const MovementStartStrafeRight[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionX,
|
||||
@@ -750,8 +740,7 @@ MovementStatusElements MovementStartStrafeRightSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStartTurnLeftSequence[] =
|
||||
MovementStatusElements const MovementStartTurnLeft[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionX,
|
||||
@@ -823,8 +812,7 @@ MovementStatusElements MovementStartTurnLeftSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStartTurnRightSequence[] =
|
||||
MovementStatusElements const MovementStartTurnRight[] =
|
||||
{
|
||||
MSEPositionX,
|
||||
MSEPositionZ,
|
||||
@@ -896,8 +884,7 @@ MovementStatusElements MovementStartTurnRightSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStopSequence[] =
|
||||
MovementStatusElements const MovementStop[] =
|
||||
{
|
||||
MSEPositionX,
|
||||
MSEPositionY,
|
||||
@@ -969,8 +956,7 @@ MovementStatusElements MovementStopSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStopStrafeSequence[] =
|
||||
MovementStatusElements const MovementStopStrafe[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionZ,
|
||||
@@ -1042,8 +1028,7 @@ MovementStatusElements MovementStopStrafeSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStopTurnSequence[] =
|
||||
MovementStatusElements const MovementStopTurn[] =
|
||||
{
|
||||
MSEPositionX,
|
||||
MSEPositionZ,
|
||||
@@ -1115,8 +1100,7 @@ MovementStatusElements MovementStopTurnSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStartAscendSequence[] =
|
||||
MovementStatusElements const MovementStartAscend[] =
|
||||
{
|
||||
MSEPositionX,
|
||||
MSEPositionY,
|
||||
@@ -1188,8 +1172,7 @@ MovementStatusElements MovementStartAscendSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStartDescendSequence[] =
|
||||
MovementStatusElements const MovementStartDescend[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionZ,
|
||||
@@ -1261,8 +1244,7 @@ MovementStatusElements MovementStartDescendSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStartSwimSequence[] =
|
||||
MovementStatusElements const MovementStartSwim[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionX,
|
||||
@@ -1334,8 +1316,7 @@ MovementStatusElements MovementStartSwimSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStopSwimSequence[] =
|
||||
MovementStatusElements const MovementStopSwim[] =
|
||||
{
|
||||
MSEPositionX,
|
||||
MSEPositionY,
|
||||
@@ -1407,8 +1388,7 @@ MovementStatusElements MovementStopSwimSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStopAscendSequence[] =
|
||||
MovementStatusElements const MovementStopAscend[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionY,
|
||||
@@ -1480,8 +1460,7 @@ MovementStatusElements MovementStopAscendSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStopPitchSequence[] =
|
||||
MovementStatusElements const MovementStopPitch[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionX,
|
||||
@@ -1553,8 +1532,7 @@ MovementStatusElements MovementStopPitchSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStartPitchDownSequence[] =
|
||||
MovementStatusElements const MovementStartPitchDown[] =
|
||||
{
|
||||
MSEPositionX,
|
||||
MSEPositionZ,
|
||||
@@ -1626,8 +1604,7 @@ MovementStatusElements MovementStartPitchDownSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementStartPitchUpSequence[] =
|
||||
MovementStatusElements const MovementStartPitchUp[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionY,
|
||||
@@ -1699,7 +1676,7 @@ MovementStatusElements MovementStartPitchUpSequence[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveChngTransport[]=
|
||||
MovementStatusElements const MoveChngTransport[]=
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionX,
|
||||
@@ -1777,8 +1754,7 @@ MovementStatusElements MoveChngTransport[]=
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
// 4.3.4
|
||||
MovementStatusElements MoveSplineDone[] =
|
||||
MovementStatusElements const MoveSplineDone[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionX,
|
||||
@@ -1857,8 +1833,7 @@ MovementStatusElements MoveSplineDone[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
// 4.3.4
|
||||
MovementStatusElements MoveNotActiveMover[] =
|
||||
MovementStatusElements const MoveNotActiveMover[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionX,
|
||||
@@ -1937,8 +1912,7 @@ MovementStatusElements MoveNotActiveMover[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
// 4.3.4
|
||||
MovementStatusElements DismissControlledVehicle[] =
|
||||
MovementStatusElements const DismissControlledVehicle[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionZ,
|
||||
@@ -2017,8 +1991,7 @@ MovementStatusElements DismissControlledVehicle[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
// 4.3.4
|
||||
MovementStatusElements MoveUpdateTeleport[] =
|
||||
MovementStatusElements const MoveUpdateTeleport[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionY,
|
||||
@@ -2100,8 +2073,7 @@ MovementStatusElements MoveUpdateTeleport[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementSetRunMode[] =
|
||||
MovementStatusElements const MovementSetRunMode[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionX,
|
||||
@@ -2173,8 +2145,7 @@ MovementStatusElements MovementSetRunMode[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementSetWalkMode[] =
|
||||
MovementStatusElements const MovementSetWalkMode[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionX,
|
||||
@@ -2246,8 +2217,7 @@ MovementStatusElements MovementSetWalkMode[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementSetCanFly[] =
|
||||
MovementStatusElements const MovementSetCanFly[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionX,
|
||||
@@ -2319,8 +2289,7 @@ MovementStatusElements MovementSetCanFly[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementSetCanTransitionBetweenSwimAndFlyAck[] =
|
||||
MovementStatusElements const MovementSetCanTransitionBetweenSwimAndFlyAck[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionY,
|
||||
@@ -2393,8 +2362,7 @@ MovementStatusElements MovementSetCanTransitionBetweenSwimAndFlyAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementUpdateSwimSpeed[] =
|
||||
MovementStatusElements const MovementUpdateSwimSpeed[] =
|
||||
{
|
||||
MSEHasMovementFlags,
|
||||
MSEHasGuidByte2,
|
||||
@@ -2454,8 +2422,7 @@ MovementStatusElements MovementUpdateSwimSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementUpdateRunSpeed[] =
|
||||
MovementStatusElements const MovementUpdateRunSpeed[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionX,
|
||||
@@ -2528,8 +2495,7 @@ MovementStatusElements MovementUpdateRunSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementUpdateFlightSpeed[] =
|
||||
MovementStatusElements const MovementUpdateFlightSpeed[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEExtraElement,
|
||||
@@ -2589,8 +2555,7 @@ MovementStatusElements MovementUpdateFlightSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementUpdateCollisionHeight[] =
|
||||
MovementStatusElements const MovementUpdateCollisionHeight[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEExtraElement,
|
||||
@@ -2650,8 +2615,7 @@ MovementStatusElements MovementUpdateCollisionHeight[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementForceRunSpeedChangeAck[] =
|
||||
MovementStatusElements const MovementForceRunSpeedChangeAck[] =
|
||||
{
|
||||
MSECounter,
|
||||
MSEPositionX,
|
||||
@@ -2725,8 +2689,7 @@ MovementStatusElements MovementForceRunSpeedChangeAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementSetCollisionHeightAck[] =
|
||||
MovementStatusElements const MovementSetCollisionHeightAck[] =
|
||||
{
|
||||
MSEExtraElement,
|
||||
MSEPositionX,
|
||||
@@ -2802,8 +2765,7 @@ MovementStatusElements MovementSetCollisionHeightAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementForceFlightSpeedChangeAck[] =
|
||||
MovementStatusElements const MovementForceFlightSpeedChangeAck[] =
|
||||
{
|
||||
MSECounter,
|
||||
MSEPositionZ,
|
||||
@@ -2877,8 +2839,7 @@ MovementStatusElements MovementForceFlightSpeedChangeAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementSetCanFlyAck[] =
|
||||
MovementStatusElements const MovementSetCanFlyAck[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSECounter,
|
||||
@@ -2951,8 +2912,7 @@ MovementStatusElements MovementSetCanFlyAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementForceSwimSpeedChangeAck[] =
|
||||
MovementStatusElements const MovementForceSwimSpeedChangeAck[] =
|
||||
{
|
||||
MSEPositionX,
|
||||
MSECounter,
|
||||
@@ -3026,8 +2986,7 @@ MovementStatusElements MovementForceSwimSpeedChangeAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementForceWalkSpeedChangeAck[] =
|
||||
MovementStatusElements const MovementForceWalkSpeedChangeAck[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionY,
|
||||
@@ -3101,8 +3060,7 @@ MovementStatusElements MovementForceWalkSpeedChangeAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementForceRunBackSpeedChangeAck[] =
|
||||
MovementStatusElements const MovementForceRunBackSpeedChangeAck[] =
|
||||
{
|
||||
MSEExtraElement,
|
||||
MSECounter,
|
||||
@@ -3176,8 +3134,7 @@ MovementStatusElements MovementForceRunBackSpeedChangeAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementUpdateRunBackSpeed[] =
|
||||
MovementStatusElements const MovementUpdateRunBackSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte1,
|
||||
MSEHasGuidByte2,
|
||||
@@ -3237,8 +3194,7 @@ MovementStatusElements MovementUpdateRunBackSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementUpdateWalkSpeed[] =
|
||||
MovementStatusElements const MovementUpdateWalkSpeed[] =
|
||||
{
|
||||
MSEHasOrientation,
|
||||
MSEZeroBit,
|
||||
@@ -3298,8 +3254,7 @@ MovementStatusElements MovementUpdateWalkSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements ForceMoveRootAck[] =
|
||||
MovementStatusElements const ForceMoveRootAck[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionZ,
|
||||
@@ -3372,8 +3327,7 @@ MovementStatusElements ForceMoveRootAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements ForceMoveUnrootAck[] =
|
||||
MovementStatusElements const ForceMoveUnrootAck[] =
|
||||
{
|
||||
MSECounter,
|
||||
MSEPositionZ,
|
||||
@@ -3446,8 +3400,7 @@ MovementStatusElements ForceMoveUnrootAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementFallReset[] =
|
||||
MovementStatusElements const MovementFallReset[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionX,
|
||||
@@ -3519,8 +3472,7 @@ MovementStatusElements MovementFallReset[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementFeatherFallAck[] =
|
||||
MovementStatusElements const MovementFeatherFallAck[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSECounter,
|
||||
@@ -3593,8 +3545,7 @@ MovementStatusElements MovementFeatherFallAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementGravityDisableAck[] =
|
||||
MovementStatusElements const MovementGravityDisableAck[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionY,
|
||||
@@ -3667,8 +3618,7 @@ MovementStatusElements MovementGravityDisableAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementGravityEnableAck[] =
|
||||
MovementStatusElements const MovementGravityEnableAck[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionX,
|
||||
@@ -3741,8 +3691,7 @@ MovementStatusElements MovementGravityEnableAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementHoverAck[] =
|
||||
MovementStatusElements const MovementHoverAck[] =
|
||||
{
|
||||
MSECounter,
|
||||
MSEPositionZ,
|
||||
@@ -3815,8 +3764,7 @@ MovementStatusElements MovementHoverAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementKnockBackAck[] =
|
||||
MovementStatusElements const MovementKnockBackAck[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionZ,
|
||||
@@ -3889,8 +3837,7 @@ MovementStatusElements MovementKnockBackAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementWaterWalkAck[] =
|
||||
MovementStatusElements const MovementWaterWalkAck[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionZ,
|
||||
@@ -3963,8 +3910,7 @@ MovementStatusElements MovementWaterWalkAck[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
//4.3.4
|
||||
MovementStatusElements MovementUpdateKnockBack[] =
|
||||
MovementStatusElements const MovementUpdateKnockBack[] =
|
||||
{
|
||||
MSEZeroBit,
|
||||
MSEHasGuidByte4,
|
||||
@@ -4023,7 +3969,7 @@ MovementStatusElements MovementUpdateKnockBack[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetWalkSpeed[] =
|
||||
MovementStatusElements const SplineMoveSetWalkSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte0,
|
||||
MSEHasGuidByte6,
|
||||
@@ -4045,7 +3991,7 @@ MovementStatusElements SplineMoveSetWalkSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetRunSpeed[] =
|
||||
MovementStatusElements const SplineMoveSetRunSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte4,
|
||||
MSEHasGuidByte0,
|
||||
@@ -4067,7 +4013,7 @@ MovementStatusElements SplineMoveSetRunSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetRunBackSpeed[] =
|
||||
MovementStatusElements const SplineMoveSetRunBackSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte1,
|
||||
MSEHasGuidByte2,
|
||||
@@ -4089,7 +4035,7 @@ MovementStatusElements SplineMoveSetRunBackSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetSwimSpeed[] =
|
||||
MovementStatusElements const SplineMoveSetSwimSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte4,
|
||||
MSEHasGuidByte2,
|
||||
@@ -4111,7 +4057,7 @@ MovementStatusElements SplineMoveSetSwimSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetSwimBackSpeed[] =
|
||||
MovementStatusElements const SplineMoveSetSwimBackSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte0,
|
||||
MSEHasGuidByte1,
|
||||
@@ -4133,7 +4079,7 @@ MovementStatusElements SplineMoveSetSwimBackSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetTurnRate[] =
|
||||
MovementStatusElements const SplineMoveSetTurnRate[] =
|
||||
{
|
||||
MSEHasGuidByte2,
|
||||
MSEHasGuidByte4,
|
||||
@@ -4155,7 +4101,7 @@ MovementStatusElements SplineMoveSetTurnRate[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetFlightSpeed[] =
|
||||
MovementStatusElements const SplineMoveSetFlightSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte7,
|
||||
MSEHasGuidByte4,
|
||||
@@ -4177,7 +4123,7 @@ MovementStatusElements SplineMoveSetFlightSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetFlightBackSpeed[] =
|
||||
MovementStatusElements const SplineMoveSetFlightBackSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte2,
|
||||
MSEHasGuidByte1,
|
||||
@@ -4199,7 +4145,7 @@ MovementStatusElements SplineMoveSetFlightBackSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetPitchRate[] =
|
||||
MovementStatusElements const SplineMoveSetPitchRate[] =
|
||||
{
|
||||
MSEHasGuidByte3,
|
||||
MSEHasGuidByte5,
|
||||
@@ -4221,7 +4167,7 @@ MovementStatusElements SplineMoveSetPitchRate[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetWalkSpeed[] =
|
||||
MovementStatusElements const MoveSetWalkSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte0,
|
||||
MSEHasGuidByte4,
|
||||
@@ -4244,7 +4190,7 @@ MovementStatusElements MoveSetWalkSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetRunSpeed[] =
|
||||
MovementStatusElements const MoveSetRunSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte6,
|
||||
MSEHasGuidByte1,
|
||||
@@ -4267,7 +4213,7 @@ MovementStatusElements MoveSetRunSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetRunBackSpeed[] =
|
||||
MovementStatusElements const MoveSetRunBackSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte0,
|
||||
MSEHasGuidByte6,
|
||||
@@ -4290,7 +4236,7 @@ MovementStatusElements MoveSetRunBackSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetSwimSpeed[] =
|
||||
MovementStatusElements const MoveSetSwimSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte5,
|
||||
MSEHasGuidByte4,
|
||||
@@ -4313,7 +4259,7 @@ MovementStatusElements MoveSetSwimSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetSwimBackSpeed[] =
|
||||
MovementStatusElements const MoveSetSwimBackSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte4,
|
||||
MSEHasGuidByte2,
|
||||
@@ -4336,7 +4282,7 @@ MovementStatusElements MoveSetSwimBackSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetTurnRate[] =
|
||||
MovementStatusElements const MoveSetTurnRate[] =
|
||||
{
|
||||
MSEHasGuidByte7,
|
||||
MSEHasGuidByte2,
|
||||
@@ -4359,7 +4305,7 @@ MovementStatusElements MoveSetTurnRate[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetFlightSpeed[] =
|
||||
MovementStatusElements const MoveSetFlightSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte0,
|
||||
MSEHasGuidByte5,
|
||||
@@ -4382,7 +4328,7 @@ MovementStatusElements MoveSetFlightSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetFlightBackSpeed[] =
|
||||
MovementStatusElements const MoveSetFlightBackSpeed[] =
|
||||
{
|
||||
MSEHasGuidByte1,
|
||||
MSEHasGuidByte2,
|
||||
@@ -4405,7 +4351,7 @@ MovementStatusElements MoveSetFlightBackSpeed[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetPitchRate[] =
|
||||
MovementStatusElements const MoveSetPitchRate[] =
|
||||
{
|
||||
MSEHasGuidByte1,
|
||||
MSEHasGuidByte2,
|
||||
@@ -4428,7 +4374,7 @@ MovementStatusElements MoveSetPitchRate[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetCollisionHeight[] =
|
||||
MovementStatusElements const MoveSetCollisionHeight[] =
|
||||
{
|
||||
MSEZeroBit,
|
||||
MSEZeroBit,
|
||||
@@ -4453,7 +4399,7 @@ MovementStatusElements MoveSetCollisionHeight[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetWalkMode[] =
|
||||
MovementStatusElements const SplineMoveSetWalkMode[] =
|
||||
{
|
||||
MSEHasGuidByte7,
|
||||
MSEHasGuidByte6,
|
||||
@@ -4474,7 +4420,7 @@ MovementStatusElements SplineMoveSetWalkMode[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetRunMode[] =
|
||||
MovementStatusElements const SplineMoveSetRunMode[] =
|
||||
{
|
||||
MSEHasGuidByte5,
|
||||
MSEHasGuidByte6,
|
||||
@@ -4495,7 +4441,7 @@ MovementStatusElements SplineMoveSetRunMode[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveGravityDisable[] =
|
||||
MovementStatusElements const SplineMoveGravityDisable[] =
|
||||
{
|
||||
MSEHasGuidByte7,
|
||||
MSEHasGuidByte3,
|
||||
@@ -4516,7 +4462,7 @@ MovementStatusElements SplineMoveGravityDisable[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveGravityEnable[] =
|
||||
MovementStatusElements const SplineMoveGravityEnable[] =
|
||||
{
|
||||
MSEHasGuidByte5,
|
||||
MSEHasGuidByte4,
|
||||
@@ -4537,7 +4483,7 @@ MovementStatusElements SplineMoveGravityEnable[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveSetHover[] =
|
||||
MovementStatusElements const SplineMoveSetHover[] =
|
||||
{
|
||||
MSEHasGuidByte3,
|
||||
MSEHasGuidByte7,
|
||||
@@ -4558,7 +4504,7 @@ MovementStatusElements SplineMoveSetHover[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements SplineMoveUnsetHover[] =
|
||||
MovementStatusElements const SplineMoveUnsetHover[] =
|
||||
{
|
||||
MSEHasGuidByte6,
|
||||
MSEHasGuidByte7,
|
||||
@@ -4579,7 +4525,7 @@ MovementStatusElements SplineMoveUnsetHover[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetCanFly[] =
|
||||
MovementStatusElements const MoveSetCanFly[] =
|
||||
{
|
||||
MSEHasGuidByte1,
|
||||
MSEHasGuidByte6,
|
||||
@@ -4601,7 +4547,7 @@ MovementStatusElements MoveSetCanFly[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveUnsetCanFly[] =
|
||||
MovementStatusElements const MoveUnsetCanFly[] =
|
||||
{
|
||||
MSEHasGuidByte1,
|
||||
MSEHasGuidByte4,
|
||||
@@ -4623,7 +4569,7 @@ MovementStatusElements MoveUnsetCanFly[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveSetHover[] =
|
||||
MovementStatusElements const MoveSetHover[] =
|
||||
{
|
||||
MSEHasGuidByte1,
|
||||
MSEHasGuidByte4,
|
||||
@@ -4645,7 +4591,7 @@ MovementStatusElements MoveSetHover[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveUnsetHover[] =
|
||||
MovementStatusElements const MoveUnsetHover[] =
|
||||
{
|
||||
MSEHasGuidByte4,
|
||||
MSEHasGuidByte6,
|
||||
@@ -4667,7 +4613,7 @@ MovementStatusElements MoveUnsetHover[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveWaterWalk[] =
|
||||
MovementStatusElements const MoveWaterWalk[] =
|
||||
{
|
||||
MSEHasGuidByte4,
|
||||
MSEHasGuidByte7,
|
||||
@@ -4689,7 +4635,7 @@ MovementStatusElements MoveWaterWalk[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveLandWalk[] =
|
||||
MovementStatusElements const MoveLandWalk[] =
|
||||
{
|
||||
MSEHasGuidByte5,
|
||||
MSEHasGuidByte1,
|
||||
@@ -4711,7 +4657,7 @@ MovementStatusElements MoveLandWalk[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveFeatherFall[] =
|
||||
MovementStatusElements const MoveFeatherFall[] =
|
||||
{
|
||||
MSEHasGuidByte3,
|
||||
MSEHasGuidByte1,
|
||||
@@ -4733,7 +4679,7 @@ MovementStatusElements MoveFeatherFall[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements MoveNormalFall[] =
|
||||
MovementStatusElements const MoveNormalFall[] =
|
||||
{
|
||||
MSECounter,
|
||||
MSEHasGuidByte3,
|
||||
@@ -4755,7 +4701,7 @@ MovementStatusElements MoveNormalFall[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements ChangeSeatsOnControlledVehicle[] =
|
||||
MovementStatusElements const ChangeSeatsOnControlledVehicle[] =
|
||||
{
|
||||
MSEPositionY,
|
||||
MSEPositionX,
|
||||
@@ -4844,7 +4790,7 @@ MovementStatusElements ChangeSeatsOnControlledVehicle[] =
|
||||
MSEEnd,
|
||||
};
|
||||
|
||||
MovementStatusElements CastSpellEmbeddedMovement[] =
|
||||
MovementStatusElements const CastSpellEmbeddedMovement[] =
|
||||
{
|
||||
MSEPositionZ,
|
||||
MSEPositionY,
|
||||
@@ -4918,22 +4864,30 @@ MovementStatusElements CastSpellEmbeddedMovement[] =
|
||||
|
||||
void Movement::ExtraMovementStatusElement::ReadNextElement(ByteBuffer& packet)
|
||||
{
|
||||
MovementStatusElements element = _elements[_index++];
|
||||
|
||||
if (element >= MSEHasGuidByte0 && element <= MSEHasGuidByte7)
|
||||
{
|
||||
Data.guid[element - MSEHasGuidByte0] = packet.ReadBit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (element >= MSEGuidByte0 && element <= MSEGuidByte7)
|
||||
{
|
||||
packet.ReadByteSeq(Data.guid[element - MSEGuidByte0]);
|
||||
return;
|
||||
}
|
||||
MovementStatusElements const element = _elements[_index++];
|
||||
|
||||
switch (element)
|
||||
{
|
||||
case MSEHasGuidByte0:
|
||||
case MSEHasGuidByte1:
|
||||
case MSEHasGuidByte2:
|
||||
case MSEHasGuidByte3:
|
||||
case MSEHasGuidByte4:
|
||||
case MSEHasGuidByte5:
|
||||
case MSEHasGuidByte6:
|
||||
case MSEHasGuidByte7:
|
||||
Data.guid[element - MSEHasGuidByte0] = packet.ReadBit();
|
||||
break;
|
||||
case MSEGuidByte0:
|
||||
case MSEGuidByte1:
|
||||
case MSEGuidByte2:
|
||||
case MSEGuidByte3:
|
||||
case MSEGuidByte4:
|
||||
case MSEGuidByte5:
|
||||
case MSEGuidByte6:
|
||||
case MSEGuidByte7:
|
||||
packet.ReadByteSeq(Data.guid[element - MSEGuidByte0]);
|
||||
break;
|
||||
case MSEExtraFloat:
|
||||
packet >> Data.floatData;
|
||||
break;
|
||||
@@ -4948,22 +4902,30 @@ void Movement::ExtraMovementStatusElement::ReadNextElement(ByteBuffer& packet)
|
||||
|
||||
void Movement::ExtraMovementStatusElement::WriteNextElement(ByteBuffer& packet)
|
||||
{
|
||||
MovementStatusElements element = _elements[_index++];
|
||||
|
||||
if (element >= MSEHasGuidByte0 && element <= MSEHasGuidByte7)
|
||||
{
|
||||
packet.WriteBit(Data.guid[element - MSEHasGuidByte0]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (element >= MSEGuidByte0 && element <= MSEGuidByte7)
|
||||
{
|
||||
packet.WriteByteSeq(Data.guid[element - MSEGuidByte0]);
|
||||
return;
|
||||
}
|
||||
MovementStatusElements const element = _elements[_index++];
|
||||
|
||||
switch (element)
|
||||
{
|
||||
case MSEHasGuidByte0:
|
||||
case MSEHasGuidByte1:
|
||||
case MSEHasGuidByte2:
|
||||
case MSEHasGuidByte3:
|
||||
case MSEHasGuidByte4:
|
||||
case MSEHasGuidByte5:
|
||||
case MSEHasGuidByte6:
|
||||
case MSEHasGuidByte7:
|
||||
packet.WriteBit(Data.guid[element - MSEHasGuidByte0]);
|
||||
break;
|
||||
case MSEGuidByte0:
|
||||
case MSEGuidByte1:
|
||||
case MSEGuidByte2:
|
||||
case MSEGuidByte3:
|
||||
case MSEGuidByte4:
|
||||
case MSEGuidByte5:
|
||||
case MSEGuidByte6:
|
||||
case MSEGuidByte7:
|
||||
packet.WriteByteSeq(Data.guid[element - MSEGuidByte0]);
|
||||
break;
|
||||
case MSEExtraFloat:
|
||||
packet << Data.floatData;
|
||||
break;
|
||||
@@ -4976,14 +4938,14 @@ void Movement::ExtraMovementStatusElement::WriteNextElement(ByteBuffer& packet)
|
||||
}
|
||||
}
|
||||
|
||||
bool Movement::PrintInvalidSequenceElement(MovementStatusElements element, char const* function)
|
||||
bool Movement::PrintInvalidSequenceElement(MovementStatusElements const element, char const* function)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_UNITS, "Incorrect sequence element %d detected at %s", element, function);
|
||||
return false;
|
||||
}
|
||||
|
||||
Movement::PacketSender::PacketSender(Unit* unit, Opcodes serverControl, Opcodes playerControl, Opcodes broadcast /*= SMSG_PLAYER_MOVE*/, ExtraMovementStatusElement* extras /*= NULL*/)
|
||||
: _unit(unit), _extraElements(extras)
|
||||
: _extraElements(extras), _unit(unit)
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER && unit->ToPlayer()->m_mover->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
@@ -4999,12 +4961,16 @@ Movement::PacketSender::PacketSender(Unit* unit, Opcodes serverControl, Opcodes
|
||||
|
||||
void Movement::PacketSender::Send() const
|
||||
{
|
||||
bool isPlayerMovement = _unit->GetTypeId() == TYPEID_PLAYER && _unit->ToPlayer()->m_mover->GetTypeId() == TYPEID_PLAYER;
|
||||
if (isPlayerMovement && _selfOpcode != NULL_OPCODE)
|
||||
bool isPlayerMovement = false;
|
||||
if (Player* player = _unit->ToPlayer())
|
||||
{
|
||||
WorldPacket data(_selfOpcode);
|
||||
_unit->WriteMovementInfo(data, _extraElements);
|
||||
_unit->ToPlayer()->SendDirectMessage(&data);
|
||||
isPlayerMovement = player->m_mover->GetTypeId() == TYPEID_PLAYER;
|
||||
if (isPlayerMovement && _selfOpcode != NULL_OPCODE)
|
||||
{
|
||||
WorldPacket data(_selfOpcode);
|
||||
_unit->WriteMovementInfo(data, _extraElements);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
if (_broadcast != NULL_OPCODE)
|
||||
@@ -5019,56 +4985,56 @@ void Movement::PacketSender::Send() const
|
||||
}
|
||||
}
|
||||
|
||||
MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode)
|
||||
MovementStatusElements const* GetMovementStatusElementsSequence(Opcodes opcode)
|
||||
{
|
||||
switch (opcode)
|
||||
{
|
||||
case MSG_MOVE_FALL_LAND:
|
||||
return MovementFallLandSequence;
|
||||
return MovementFallLand;
|
||||
case MSG_MOVE_HEARTBEAT:
|
||||
return MovementHeartBeatSequence;
|
||||
return MovementHeartBeat;
|
||||
case MSG_MOVE_JUMP:
|
||||
return MovementJumpSequence;
|
||||
return MovementJump;
|
||||
case MSG_MOVE_SET_FACING:
|
||||
return MovementSetFacingSequence;
|
||||
return MovementSetFacing;
|
||||
case MSG_MOVE_SET_PITCH:
|
||||
return MovementSetPitchSequence;
|
||||
return MovementSetPitch;
|
||||
case MSG_MOVE_START_ASCEND:
|
||||
return MovementStartAscendSequence;
|
||||
return MovementStartAscend;
|
||||
case MSG_MOVE_START_BACKWARD:
|
||||
return MovementStartBackwardSequence;
|
||||
return MovementStartBackward;
|
||||
case MSG_MOVE_START_DESCEND:
|
||||
return MovementStartDescendSequence;
|
||||
return MovementStartDescend;
|
||||
case MSG_MOVE_START_FORWARD:
|
||||
return MovementStartForwardSequence;
|
||||
return MovementStartForward;
|
||||
case MSG_MOVE_START_PITCH_DOWN:
|
||||
return MovementStartPitchDownSequence;
|
||||
return MovementStartPitchDown;
|
||||
case MSG_MOVE_START_PITCH_UP:
|
||||
return MovementStartPitchUpSequence;
|
||||
return MovementStartPitchUp;
|
||||
case MSG_MOVE_START_STRAFE_LEFT:
|
||||
return MovementStartStrafeLeftSequence;
|
||||
return MovementStartStrafeLeft;
|
||||
case MSG_MOVE_START_STRAFE_RIGHT:
|
||||
return MovementStartStrafeRightSequence;
|
||||
return MovementStartStrafeRight;
|
||||
case MSG_MOVE_START_SWIM:
|
||||
return MovementStartSwimSequence;
|
||||
return MovementStartSwim;
|
||||
case MSG_MOVE_START_TURN_LEFT:
|
||||
return MovementStartTurnLeftSequence;
|
||||
return MovementStartTurnLeft;
|
||||
case MSG_MOVE_START_TURN_RIGHT:
|
||||
return MovementStartTurnRightSequence;
|
||||
return MovementStartTurnRight;
|
||||
case MSG_MOVE_STOP:
|
||||
return MovementStopSequence;
|
||||
return MovementStop;
|
||||
case MSG_MOVE_STOP_ASCEND:
|
||||
return MovementStopAscendSequence;
|
||||
return MovementStopAscend;
|
||||
case MSG_MOVE_STOP_PITCH:
|
||||
return MovementStopPitchSequence;
|
||||
return MovementStopPitch;
|
||||
case MSG_MOVE_STOP_STRAFE:
|
||||
return MovementStopStrafeSequence;
|
||||
return MovementStopStrafe;
|
||||
case MSG_MOVE_STOP_SWIM:
|
||||
return MovementStopSwimSequence;
|
||||
return MovementStopSwim;
|
||||
case MSG_MOVE_STOP_TURN:
|
||||
return MovementStopTurnSequence;
|
||||
return MovementStopTurn;
|
||||
case SMSG_PLAYER_MOVE:
|
||||
return PlayerMoveSequence;
|
||||
return PlayerMove;
|
||||
case CMSG_MOVE_CHNG_TRANSPORT:
|
||||
return MoveChngTransport;
|
||||
case CMSG_MOVE_SPLINE_DONE:
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
#ifndef _MOVEMENT_STRUCTURES_H
|
||||
#define _MOVEMENT_STRUCTURES_H
|
||||
|
||||
#include "ByteBuffer.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Unit.h"
|
||||
#include "Object.h"
|
||||
|
||||
class ByteBuffer;
|
||||
class Unit;
|
||||
|
||||
enum MovementStatusElements
|
||||
{
|
||||
@@ -103,7 +105,6 @@ enum MovementStatusElements
|
||||
// Allowed internal elements are: GUID markers (not transport), MSEExtraFloat, MSEExtraInt8
|
||||
MSEExtraFloat,
|
||||
MSEExtraInt8,
|
||||
MSE_COUNT
|
||||
};
|
||||
|
||||
namespace Movement
|
||||
@@ -152,6 +153,6 @@ namespace Movement
|
||||
bool PrintInvalidSequenceElement(MovementStatusElements element, char const* function);
|
||||
}
|
||||
|
||||
MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode);
|
||||
MovementStatusElements const* GetMovementStatusElementsSequence(Opcodes opcode);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user