TrinityCore / TrinityCore/TrinityCore
Core/Movement: Movement state is not correctly carried over during mover changes
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.8k
- Forks
- 6.4k
- Avg merge
- 3d 16m
- Merged PRs (30d)
- 6
Description
Description:
When you mind control/posses a unit, this units movement state is not correctly carried over to the new moving player.
Each client should have a list of allowed active movers. When the client changes between one of his allowed active movers, the server should start a spline move to this mover units last position, and the spline contains the movement state of the (remote) unit (position, fall time, etc). The client confirms this spline by sending CMSG_MOVE_SPLINE_DONE when he is finished. From this point the client is allowed to alter this units movement state. After CMSG_MOVE_SPLINE_DONE the client is always in FALLING state. So CMSG_MOVE_SPLINE_DONE is always followed by a MOVE_FALL_LAND/SET_FLY (anything that stops falls) after.
Current behaviour:
What it does currently in TC is it just force sets the mover to this unit and ignores the CMSG_SET_ACTIVE_MOVER part including the spline moves entirely.
Expected behaviour:
When you mind control a unit this series of events should happen:
- Mind control spell effect applies
- Server sends SMSG_CLIENT_CONTROL_UPDATE to the controlling unit (this is used only as a notification that the unit can now set his active mover to this unit)
- Client sends CMSG_SET_ACTIVE_MOVER to the new unit.
- The handler for CMSG_SET_ACTIVE_MOVER should trigger a spline move to the controlled unit which carries the movement state information (fall time, position, etc.) for this unit.
- The client handles the spline move and sends CMSG_MOVE_SPLINE_DONE with this new movement state.
- The client may now move around with the new unit, but not before the CMSG_MOVE_SPLINE_DONE.
Why is this important?:
Without this it is impossible to properly implement a blizzlike movement anticheat, as the movement state between mover changes is not correctly carried over.
This series of events should apply in every case that SMSG_CLIENT_CONTROL_UPDATE is sent to the client.
Steps to reproduce the problem:
- Mind control a unit
- Observe the series of events
Branch(es): 3.3.5 & 6.x
TC hash/commit: Either
TDB version: Either
Operating system: Either
Here is a partial implementation of this system:
https://github.com/tripleslash/TrinityCore/commit/88d662f7b867f804629cbe1dbfb8fd2988de81d0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the partial implementation in commit 88d662f7b867f804629cbe1dbfb8fd2988de81d0 and trace the handlers for CMSG_SET_ACTIVE_MOVER and CMSG_MOVE_SPLINE_DONE. Verify the SMSG_CLIENT_CONTROL_UPDATE sequence during mind control and confirm that movement state is carried through the spline until the client acknowledges it; completion should match the listed event sequence on the affected branches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100