UCharacterMovementComponent::ServerMove_HandleMoveData
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtualENGINE_API
Description
Handles move data on the server after it has been unpacked from the client's RPC. The default implementation forwards to ServerMove_PerformMovement(), potentially multiple times for dual or old moves.
Caveats & Gotchas
- • A single call can represent up to three logical moves (an old important move, a dual pending move, and the current move) depending on what the client packed.
- • This is the main override point for custom server-side move handling — most projects that need to inspect or reject moves before they're simulated override this instead of ServerMove_PerformMovement().
- • Runs on the server only; calling it on a client build is meaningless since there's no authority to act on the data.
Signature
virtual void ServerMove_HandleMoveData(const FCharacterNetworkMoveDataContainer& MoveDataContainer) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MoveDataContainer | const FCharacterNetworkMoveDataContainer& | The unpacked container of one or more client moves received from ServerMovePacked_ServerReceive(). | — |
Return Type
void Example
Override to validate before processing C++
void UMyCharacterMovementComponent::ServerMove_HandleMoveData(const FCharacterNetworkMoveDataContainer& MoveDataContainer)
{
if (IsMoveDataSuspicious(MoveDataContainer))
{
return; // Drop the move entirely
}
Super::ServerMove_HandleMoveData(MoveDataContainer);
} See Also
Version History
Introduced in: 4.26
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?