UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GameplayDebuggerCategoryReplicator.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "UObject/Class.h"
10#include "GameplayDebuggerCategoryReplicator.generated.h"
11
17
18// Struct used to send the DataPackPackets as RPC`s instead of using the CustomDeltaNetSerializer.
19USTRUCT()
36
37USTRUCT()
39{
41
42 UPROPERTY()
43 FName CategoryName;
44
45 UPROPERTY()
46 TArray<FString> TextLines;
47
48 UPROPERTY()
50
51 // Either replicated using the NetDeltaSerialize or alternatively as regular RPC`s
52 UPROPERTY(NotReplicated)
54
55 UPROPERTY()
56 bool bIsEnabled = false;
57};
58
59USTRUCT()
61{
63
64 UPROPERTY(NotReplicated)
66
68
69 bool NetDeltaSerialize(FNetDeltaSerializeInfo & DeltaParms);
70 void OnCategoriesChanged();
71
72 // When using Iris we cannot use the same appoach as the current NetSerializeDelta as it does polling of data and also modifies data outside of the replicated state during serialization which is not allowed when using iris.
73 // Therefore we need explicit methods to populate the state from the owner and to apply it to the owner which can be invoked before and after serialization as needed.
74 void PopulateFromOwner();
75 void ApplyToOwner();
76
77private:
78 UPROPERTY()
80};
81
90
91USTRUCT()
105
106USTRUCT()
108{
110
111 UPROPERTY()
112 FString DeviceIDs;
113};
114
116
117UCLASS(NotBlueprintable, NotBlueprintType, notplaceable, noteditinlinenew, hidedropdown, Transient, MinimalAPI)
119{
121
122 GAMEPLAYDEBUGGER_API virtual class UNetConnection* GetNetConnection() const override;
123 GAMEPLAYDEBUGGER_API virtual bool IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const override;
124
125protected:
126 GAMEPLAYDEBUGGER_API virtual void BeginPlay() override;
127
128 GAMEPLAYDEBUGGER_API virtual void OnReplicationStartedForIris(const FOnReplicationStartedParams&) override;
129
130 GAMEPLAYDEBUGGER_API virtual const AActor* GetNetOwner() const override;
131
132public:
133 GAMEPLAYDEBUGGER_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
134 GAMEPLAYDEBUGGER_API virtual void TickActor(float DeltaTime, enum ELevelTick TickType, FActorTickFunction& ThisTickFunction) override;
135 GAMEPLAYDEBUGGER_API virtual void PostNetReceive() override;
136
137 GAMEPLAYDEBUGGER_API virtual void PreReplication(IRepChangedPropertyTracker& ChangedPropertyTracker) override;
138
140 GAMEPLAYDEBUGGER_API void SetReplicatorOwner(APlayerController* InOwnerPC);
142
144 GAMEPLAYDEBUGGER_API void SetEnabled(bool bEnable);
145
147 GAMEPLAYDEBUGGER_API void SetCategoryEnabled(int32 CategoryId, bool bEnable);
148
150 GAMEPLAYDEBUGGER_API void SetDebugActor(AActor* Actor, bool bSelectInEditor = false);
151
153 GAMEPLAYDEBUGGER_API void SetViewPoint(const FVector& InViewLocation, const FVector& InViewDirection);
154
156 bool IsViewPointSet() const { return ViewLocation.IsSet() && ViewDirection.IsSet(); }
157
159 GAMEPLAYDEBUGGER_API void ResetViewPoint();
160
162 GAMEPLAYDEBUGGER_API void SendCategoryInputEvent(int32 CategoryId, int32 HandlerId);
163
165 GAMEPLAYDEBUGGER_API void SendExtensionInputEvent(int32 ExtensionId, int32 HandlerId);
166
168 GAMEPLAYDEBUGGER_API void CollectCategoryData(bool bForce = false);
169
171 AActor* GetDebugActor() const { return DebugActor.Actor.IsStale() ? nullptr : DebugActor.Actor.Get(); }
172
174 FName GetDebugActorName() const { return DebugActor.ActorName; }
175
177 int16 GetDebugActorCounter() const { return DebugActor.SyncCounter; }
178
181
182 const FGameplayDebuggerVisLogSync& GetVisLogSyncData() const { return VisLogSync; }
183
186
188 bool IsEnabled() const { return bIsEnabled; }
189
191 bool IsEditorWorldReplicator() const { return bIsEditorWorldReplicator; }
192
194 GAMEPLAYDEBUGGER_API bool IsCategoryEnabled(int32 CategoryId) const;
195
197 bool HasDebugActor() const { return DebugActor.ActorName != NAME_None; }
198
200 int32 GetNumCategories() const { return Categories.Num(); }
201
203 int32 GetNumExtensions() const { return Extensions.Num(); }
204
206 TSharedRef<FGameplayDebuggerCategory> GetCategory(int32 CategoryId) const { return Categories[CategoryId]; }
207
209 TSharedRef<FGameplayDebuggerExtension> GetExtension(int32 ExtensionId) const { return Extensions[ExtensionId]; }
210
212 bool IsLocal() const { return bIsLocal; }
213
214#if WITH_EDITOR
216#endif // WITH_EDITOR
217
218protected:
219 UFUNCTION()
220 GAMEPLAYDEBUGGER_API void OnRep_ReplicatedData();
221
222
224
227
229 bool bIsEnabled;
230
231 UPROPERTY(Replicated, ReplicatedUsing=OnRep_ReplicatedData)
233
236
239
241 UPROPERTY()
243
246
249
250 TOptional<FVector> ViewLocation;
251 TOptional<FVector> ViewDirection;
252
253 uint32 bIsEnabledLocal : 1;
254 uint32 bHasAuthority : 1;
255 uint32 bIsLocal : 1;
256 uint32 bIsEditorWorldReplicator : 1;
257 uint32 bSendDataPacksUsingRPC : 1;
258
260 GAMEPLAYDEBUGGER_API void OnCategoriesChanged();
261
263 GAMEPLAYDEBUGGER_API void OnExtensionsChanged();
264
266 GAMEPLAYDEBUGGER_API void NotifyCategoriesToolState(bool bIsActive);
267
269 GAMEPLAYDEBUGGER_API void NotifyExtensionsToolState(bool bIsActive);
270
271 UFUNCTION(Server, Reliable, WithValidation, meta = (CallInEditor = "true"))
272 GAMEPLAYDEBUGGER_API void ServerSetEnabled(bool bEnable);
273
274 UFUNCTION(Server, Reliable, WithValidation, meta = (CallInEditor = "true"))
275 GAMEPLAYDEBUGGER_API void ServerSetDebugActor(AActor* Actor, bool bSelectInEditor);
276
277 UFUNCTION(Server, Reliable, WithValidation, meta = (CallInEditor = "true"))
278 GAMEPLAYDEBUGGER_API void ServerSetViewPoint(const FVector& InViewLocation, const FVector& InViewDirection);
279
280 UFUNCTION(Server, Reliable, WithValidation, meta = (CallInEditor = "true"))
281 GAMEPLAYDEBUGGER_API void ServerResetViewPoint();
282
283 UFUNCTION(Server, Reliable, WithValidation, meta = (CallInEditor = "true"))
284 GAMEPLAYDEBUGGER_API void ServerSetCategoryEnabled(int32 CategoryId, bool bEnable);
285
287 UFUNCTION(Server, Reliable, WithValidation, meta = (CallInEditor = "true"))
288 GAMEPLAYDEBUGGER_API void ServerSendCategoryInputEvent(int32 CategoryId, int32 HandlerId);
289
291 UFUNCTION(Server, Reliable, WithValidation, meta = (CallInEditor = "true"))
292 GAMEPLAYDEBUGGER_API void ServerSendExtensionInputEvent(int32 ExtensionId, int32 HandlerId);
293
296 GAMEPLAYDEBUGGER_API void ClientDataPackPacket(const FGameplayDebuggerDataPackRPCParams& Params);
297
299 GAMEPLAYDEBUGGER_API void OnReceivedDataPackPacket(int32 CategoryId, int32 DataPackId, const FGameplayDebuggerDataPack& DataPacket);
300
303
304private:
305 GAMEPLAYDEBUGGER_API void SendDataPackPacket(FName CategoryName, int32 DataPackIdx, FGameplayDebuggerDataPack& DataPack);
306};
FPlatformTypes::int16 int16
A 16-bit signed integer.
Definition Platform.h:1123
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_MULTICAST_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:58
ELevelTick
Definition EngineBaseTypes.h:70
return true
Definition ExternalRpcRegistry.cpp:601
void Init()
Definition LockFreeList.h:4
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Actor.h:257
Definition GameplayDebuggerCategoryReplicator.h:119
AActor * GetDebugActor() const
Definition GameplayDebuggerCategoryReplicator.h:171
bool IsEnabled() const
Definition GameplayDebuggerCategoryReplicator.h:188
static GAMEPLAYDEBUGGER_API FNotifyGameplayDebuggerOwnerChange NotifyDebuggerOwnerChange
Definition GameplayDebuggerCategoryReplicator.h:141
int32 GetNumExtensions() const
Definition GameplayDebuggerCategoryReplicator.h:203
int32 GetNumCategories() const
Definition GameplayDebuggerCategoryReplicator.h:200
bool IsViewPointSet() const
Definition GameplayDebuggerCategoryReplicator.h:156
FName GetDebugActorName() const
Definition GameplayDebuggerCategoryReplicator.h:174
int16 GetDebugActorCounter() const
Definition GameplayDebuggerCategoryReplicator.h:177
bool HasDebugActor() const
Definition GameplayDebuggerCategoryReplicator.h:197
TObjectPtr< APlayerController > GetReplicationOwner() const
Definition GameplayDebuggerCategoryReplicator.h:185
const FGameplayDebuggerVisLogSync & GetVisLogSyncData() const
Definition GameplayDebuggerCategoryReplicator.h:182
TSharedRef< FGameplayDebuggerExtension > GetExtension(int32 ExtensionId) const
Definition GameplayDebuggerCategoryReplicator.h:209
bool IsLocal() const
Definition GameplayDebuggerCategoryReplicator.h:212
TSharedRef< FGameplayDebuggerCategory > GetCategory(int32 CategoryId) const
Definition GameplayDebuggerCategoryReplicator.h:206
bool IsEditorWorldReplicator() const
Definition GameplayDebuggerCategoryReplicator.h:191
Definition PlayerController.h:261
Definition GameplayDebuggerCategory.h:49
Definition GameplayDebuggerExtension.h:26
Definition NameTypes.h:617
Definition CoreNet.h:570
Definition Array.h:670
Definition SharedPointer.h:153
Definition GameplayDebuggerRenderingComponent.h:37
Definition NetConnection.h:284
TObjectPtr< class AActor > ViewTarget
Definition NetConnection.h:317
virtual COREUOBJECT_API void PostNetReceive()
Definition Obj.cpp:5896
Type
Definition EngineTypes.h:3431
@ false
Definition radaudio_common.h:23
Definition EngineBaseTypes.h:526
Definition GameplayDebuggerCategoryReplicator.h:39
Definition GameplayDebuggerTypes.h:245
Definition GameplayDebuggerCategoryReplicator.h:21
Definition GameplayDebuggerTypes.h:287
Definition GameplayDebuggerCategoryReplicator.h:93
Definition GameplayDebuggerCategoryReplicator.h:61
Definition GameplayDebuggerTypes.h:181
Definition GameplayDebuggerCategoryReplicator.h:108
Definition CoreNet.h:643
Definition ObjectPtr.h:488
Definition Optional.h:131
Definition StructOpsTypeTraits.h:11
Definition StructOpsTypeTraits.h:46
Definition WeakObjectPtrTemplates.h:25