UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NetworkPredictionInterface.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3//=============================================================================
4// INetworkPredictionInterface is an interface for objects that want to perform
5// network prediction of movement. See UCharacterMovementComponent for an example implementation.
6//=============================================================================
7
8#pragma once
9
10#include "CoreMinimal.h"
12#include "UObject/Interface.h"
13#include "NetworkPredictionInterface.generated.h"
14
15UINTERFACE(MinimalAPI, meta=(CannotImplementInterfaceInBlueprint))
20
22{
24
25 //--------------------------------
26 // Server hooks
27 //--------------------------------
28
29
30 virtual void SendClientAdjustment() PURE_VIRTUAL(INetworkPredictionInterface::SendClientAdjustment,);
31
33 virtual bool ForcePositionUpdate(float DeltaTime) PURE_VIRTUAL(INetworkPredictionInterface::ForcePositionUpdate, return false;);
34
35 //--------------------------------
36 // Client hooks
37 //--------------------------------
38
40 virtual void SmoothCorrection(const FVector& OldLocation, const FQuat& OldRotation, const FVector& NewLocation, const FQuat& NewRotation) PURE_VIRTUAL(INetworkPredictionInterface::SmoothCorrection,);
41
42 //--------------------------------
43 // Other
44 //--------------------------------
45
47 virtual class FNetworkPredictionData_Client* GetPredictionData_Client() const PURE_VIRTUAL(INetworkPredictionInterface::GetPredictionData_Client, return NULL;);
48
50 virtual class FNetworkPredictionData_Server* GetPredictionData_Server() const PURE_VIRTUAL(INetworkPredictionInterface::GetPredictionData_Server, return NULL;);
51
53 virtual bool HasPredictionData_Client() const PURE_VIRTUAL(INetworkPredictionInterface::HasPredictionData_Client, return false;);
54
56 virtual bool HasPredictionData_Server() const PURE_VIRTUAL(INetworkPredictionInterface::HasPredictionData_Server, return false;);
57
59 virtual void ResetPredictionData_Client() PURE_VIRTUAL(INetworkPredictionInterface::ResetPredictionData_Client,);
60
62 virtual void ResetPredictionData_Server() PURE_VIRTUAL(INetworkPredictionInterface::ResetPredictionData_Server,);
63};
64
65
66// Network data representation on the client
68{
69public:
70
74
76
78 virtual void AddStructReferencedObjects(FReferenceCollector& Collector) const {};
79};
80
81
82// Network data representation on the server
84{
85public:
86
96
98
106
108 virtual void AddStructReferencedObjects(FReferenceCollector& Collector) const {};
109
112
114 // Forced update state
115
118
121
124
127
130
152};
153
#define NULL
Definition oodle2base.h:134
#define PURE_VIRTUAL(func,...)
Definition CoreMiscDefines.h:103
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UINTERFACE(...)
Definition ObjectMacros.h:780
#define GENERATED_IINTERFACE_BODY(...)
Definition ObjectMacros.h:770
#define GENERATED_UINTERFACE_BODY(...)
Definition ObjectMacros.h:769
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Archive.h:1208
UE_FORCEINLINE_HINT constexpr bool IsMigratingRemoteObjects() const
Definition Archive.h:355
Definition NetworkPredictionInterface.h:68
virtual ~FNetworkPredictionData_Client()
Definition NetworkPredictionInterface.h:75
virtual void AddStructReferencedObjects(FReferenceCollector &Collector) const
Definition NetworkPredictionInterface.h:78
FNetworkPredictionData_Client()
Definition NetworkPredictionInterface.h:71
Definition NetworkPredictionInterface.h:84
virtual void AddStructReferencedObjects(FReferenceCollector &Collector) const
Definition NetworkPredictionInterface.h:108
virtual void ResetForcedUpdateState()
Definition NetworkPredictionInterface.h:99
virtual ~FNetworkPredictionData_Server()
Definition NetworkPredictionInterface.h:97
float ServerTimeStamp
Definition NetworkPredictionInterface.h:111
uint8 bForcedUpdateDurationExceeded
Definition NetworkPredictionInterface.h:126
FNetworkPredictionData_Server()
Definition NetworkPredictionInterface.h:87
float ServerTimeBeginningForcedUpdates
Definition NetworkPredictionInterface.h:117
virtual void Serialize(FArchive &Archive)
Definition NetworkPredictionInterface.h:131
uint8 bLastRequestNeedsForcedUpdates
Definition NetworkPredictionInterface.h:129
float ServerTimeLastForcedUpdate
Definition NetworkPredictionInterface.h:120
uint8 bTriggeringForcedUpdates
Definition NetworkPredictionInterface.h:123
Definition UObjectGlobals.h:2492
Definition NetworkPredictionInterface.h:22
Definition Interface.h:19
Definition NetworkPredictionInterface.h:17
@ false
Definition radaudio_common.h:23