Skip to content

Commit

Permalink
Player: Implement SMSG_MULTIPLE_MOVES
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Jan 7, 2025
1 parent 9cc13a1 commit 305517b
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 4 deletions.
66 changes: 63 additions & 3 deletions src/game/Entities/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21461,11 +21461,71 @@ void Player::SendInitialPacketsAfterAddToMap()
auraList.front()->ApplyModifier(true, true);
}

if (IsImmobilizedState()) // TODO: Figure out if this protocol is correct
SendMoveRoot(true);
WorldPacket setCompoundState(SMSG_MULTIPLE_MOVES, 100);
setCompoundState << uint32(0); // size placeholder

// manual send package (have code in HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); that must not be re-applied.
if (IsImmobilizedState())
{
auto const counter = GetSession()->GetOrderCounter();
setCompoundState << uint8(2 + GetPackGUID().size() + 4);
setCompoundState << uint16(SMSG_FORCE_MOVE_ROOT);
setCompoundState << GetPackGUID();
setCompoundState << uint32(counter);
GetSession()->GetAnticheat()->OrderSent(SMSG_FORCE_MOVE_ROOT, counter);
GetSession()->IncrementOrderCounter();
}

if (HasAuraType(SPELL_AURA_FEATHER_FALL))
{
auto const counter = GetSession()->GetOrderCounter();
setCompoundState << uint8(2 + GetPackGUID().size() + 4);
setCompoundState << uint16(SMSG_MOVE_FEATHER_FALL);
setCompoundState << GetPackGUID();
setCompoundState << uint32(counter);
GetSession()->GetAnticheat()->OrderSent(SMSG_MOVE_FEATHER_FALL, counter);
GetSession()->IncrementOrderCounter();
}

if (HasAuraType(SPELL_AURA_WATER_WALK))
{
auto const counter = GetSession()->GetOrderCounter();
setCompoundState << uint8(2 + GetPackGUID().size() + 4);
setCompoundState << uint16(SMSG_MOVE_WATER_WALK);
setCompoundState << GetPackGUID();
setCompoundState << uint32(counter);
GetSession()->GetAnticheat()->OrderSent(SMSG_MOVE_WATER_WALK, counter);
GetSession()->IncrementOrderCounter();
}

if (HasAuraType(SPELL_AURA_HOVER))
{
auto const counter = GetSession()->GetOrderCounter();
setCompoundState << uint8(2 + GetPackGUID().size() + 4);
setCompoundState << uint16(SMSG_MOVE_SET_HOVER);
setCompoundState << GetPackGUID();
setCompoundState << uint32(counter);
GetSession()->GetAnticheat()->OrderSent(SMSG_MOVE_SET_HOVER, counter);
GetSession()->IncrementOrderCounter();
}

if (m_pendingMountId)
SendCollisionHeightUpdate(CalculateCollisionHeight(m_pendingMountId));
{
auto const counter = GetSession()->GetOrderCounter();
setCompoundState << uint8(2 + GetPackGUID().size() + 4 + 4);
setCompoundState << uint16(SMSG_MOVE_SET_COLLISION_HGT);
setCompoundState << GetPackGUID();
setCompoundState << uint32(counter);
setCompoundState << float(CalculateCollisionHeight(m_pendingMountId));
GetSession()->GetAnticheat()->OrderSent(SMSG_MOVE_SET_COLLISION_HGT, counter);
GetSession()->IncrementOrderCounter();
}

if (setCompoundState.size() > 4)
{
setCompoundState.put<uint32>(0, setCompoundState.size() - 4);
SendDirectMessage(setCompoundState);
}

SendAurasForTarget(this);

Expand Down
2 changes: 1 addition & 1 deletion src/game/Server/Opcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ enum Opcodes
CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x51B,// lua: CommentatorSetSkirmishMatchmakingMode/CommentatorRequestSkirmishQueueData/CommentatorRequestSkirmishMode/CommentatorStartSkirmishMatch
SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1 = 0x51C,// event EVENT_COMMENTATOR_SKIRMISH_QUEUE_REQUEST, CGCommentator::QueueNode
SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2 = 0x51D,// event EVENT_COMMENTATOR_SKIRMISH_QUEUE_REQUEST
SMSG_MULTIPLE_MOVES = 0x51E,// TODO: Implement from TC
SMSG_MULTIPLE_MOVES = 0x51E,
NUM_MSG_TYPES = 0x51F
};

Expand Down

0 comments on commit 305517b

Please sign in to comment.