UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LocalFileNetworkReplayStreaming.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 "Stats/Stats.h"
8#include "Tickable.h"
13#include "Async/Async.h"
15#include "HAL/ThreadSafeBool.h"
16#include "LocalFileNetworkReplayStreaming.generated.h"
17
20
22{
23 enum Type
24 {
25 // Before any version changes were made
27
35
36 // -----<new versions can be added above this line>-------------------------------------------------
39 };
40
41 // The GUID for this custom version number
43
45};
46
48{
49 Header,
52 Event,
53 Unknown = 0xFFFFFFFF
54};
55
57{
58 None = 0,
60};
61
63
65{
66 None = 0,
67 FullUpdate = 1,
68};
69
71
87
109
134
173
211
213{
214 enum Type
215 {
216 StartRecording,
217 WriteHeader,
218 WritingHeader,
219 WritingStream,
220 StopRecording,
221 StartPlayback,
222 ReadingHeader,
223 ReadingStream,
224 EnumeratingStreams,
225 WritingCheckpoint,
226 ReadingCheckpoint,
227 UpdatingEvent,
228 EnumeratingEvents,
229 RequestingEvent,
230 StopStreaming,
231 DeletingFinishedStream,
232 RefreshingLiveStream,
233 KeepReplay,
234 RenameReplay,
235 RenameReplayFriendlyName,
236 };
237
238 inline const TCHAR* ToString( EQueuedLocalFileRequestType::Type Type )
239 {
240 switch ( Type )
241 {
242 case StartRecording:
243 return TEXT( "StartRecording" );
244 case WriteHeader:
245 return TEXT( "WriteHeader" );
246 case WritingHeader:
247 return TEXT( "WritingHeader" );
248 case WritingStream:
249 return TEXT( "WritingStream" );
250 case StopRecording:
251 return TEXT( "StopRecording" );
252 case StartPlayback:
253 return TEXT( "StartPlayback" );
254 case ReadingHeader:
255 return TEXT( "ReadingHeader" );
256 case ReadingStream:
257 return TEXT( "ReadingStream" );
258 case EnumeratingStreams:
259 return TEXT( "EnumeratingStreams" );
260 case WritingCheckpoint:
261 return TEXT( "WritingCheckpoint" );
262 case ReadingCheckpoint:
263 return TEXT( "ReadingCheckpoint" );
264 case UpdatingEvent:
265 return TEXT( "UpdatingEvent" );
266 case EnumeratingEvents:
267 return TEXT( "EnumeratingEvents" );
268 case RequestingEvent:
269 return TEXT("RequestingEvent");
270 case StopStreaming:
271 return TEXT( "StopStreaming" );
272 case DeletingFinishedStream:
273 return TEXT( "DeletingFinishedStream" );
274 case RefreshingLiveStream:
275 return TEXT( "RefreshingLiveStream" );
276 case KeepReplay:
277 return TEXT( "KeepReplay" );
278 case RenameReplay:
279 return TEXT( "RenameReplay" );
280 case RenameReplayFriendlyName:
281 return TEXT( "RenameReplayFriendlyName" );
282 }
283
284 return TEXT( "Unknown EQueuedLocalFileRequestType type." );
285 }
286};
287
288UENUM()
304
306
308
310{
311public:
313 : RequestData(InRequestData)
314 , LastAccessTime(InLastAccessTime)
315 {
316 }
317
319 : RequestData(MoveTemp(InRequestData))
320 , LastAccessTime(InLastAccessTime)
321 {
322 }
323
326};
327
329{
330public:
332 : Streamer(InStreamer)
333 , RequestType(InType)
334 , bCancelled(false)
335 {
336 }
337
339
340 EQueuedLocalFileRequestType::Type GetRequestType() const { return RequestType; }
341
342 virtual bool GetCachedRequest() { return false; }
343 virtual void IssueRequest() = 0;
344 virtual void FinishRequest() = 0;
345
346 void CancelRequest();
347
348protected:
350 EQueuedLocalFileRequestType::Type RequestType;
352};
353
354class FGenericQueuedLocalFileRequest : public FQueuedLocalFileRequest, public TSharedFromThis<FGenericQueuedLocalFileRequest, ESPMode::ThreadSafe>
355{
356public:
359 , RequestFunction(MoveTemp(InFunction))
360 , CompletionCallback(MoveTemp(InCompletionCallback))
361 {
362 }
363
364 virtual void IssueRequest() override;
365 virtual void FinishRequest() override;
366
367protected:
370};
371
372template<typename ResultType>
374{
375public:
380
381public:
382
384 {
385 SetPromise(Promise, Function);
386 }
387
392
397
399 {
400 return Promise.GetFuture();
401 }
402
403private:
404 TFunction<ResultType()> Function;
405 TPromise<ResultType> Promise;
406};
407
408template <typename StorageType>
409class TGenericQueuedLocalFileRequest : public FQueuedLocalFileRequest, public TSharedFromThis<TGenericQueuedLocalFileRequest<StorageType>, ESPMode::ThreadSafe>
410{
411public:
412 TGenericQueuedLocalFileRequest(const TSharedPtr<FLocalFileNetworkReplayStreamer>& InStreamer, EQueuedLocalFileRequestType::Type InType, TFunction<void(StorageType&)>&& InFunction, TFunction<void(StorageType&)>&& InCompletionCallback)
414 , Storage()
415 , RequestFunction(MoveTemp(InFunction))
416 , CompletionCallback(MoveTemp(InCompletionCallback))
417 {
418 }
419
420 virtual void IssueRequest() override
421 {
422 auto SharedRef = this->AsShared();
423
424 TGraphTask<TLocalFileAsyncGraphTask<void>>::CreateTask().ConstructAndDispatchWhenReady(
425 [SharedRef]()
426 {
427 SharedRef->RequestFunction(SharedRef->Storage);
428 },
430 {
431 if (!SharedRef->bCancelled)
432 {
433 AsyncTask(ENamedThreads::GameThread, [SharedRef]()
434 {
435 SharedRef->FinishRequest();
436 });
437 }
438 }));
439 }
440
441 virtual void FinishRequest() override
442 {
443 if (!bCancelled && this->Streamer.IsValid())
444 {
445 if (CompletionCallback)
446 {
447 CompletionCallback(Storage);
448 }
449
450 this->Streamer->OnFileRequestComplete(this->AsShared());
451 }
452 }
453
454 StorageType Storage;
455
456protected:
459};
460
461template <typename DelegateResultType>
477
480{
481public:
486
487 virtual bool GetCachedRequest() override
488 {
489 TSharedPtr<FCachedFileRequest> CachedRequest = this->Streamer->RequestCache.FindRef(CacheKey);
490 if (CachedRequest.IsValid())
491 {
492 // If we have this response in the cache, process it now
493 CachedRequest->LastAccessTime = FPlatformTime::Seconds();
494 this->Storage.DataBuffer = CachedRequest->RequestData;
495 return true;
496 }
497
498 return false;
499 }
500
501protected:
503};
504
505DECLARE_MULTICAST_DELEGATE_TwoParams(FOnLocalFileReplayFinishedWriting, const FString& /*StreamName*/, const FString& /*FullReplayFile*/);
506
508class FLocalFileNetworkReplayStreamer : public INetworkReplayStreamer, public TSharedFromThis<FLocalFileNetworkReplayStreamer>
509{
511
512public:
516
518 LOCALFILENETWORKREPLAYSTREAMING_API virtual void StartStreaming(const FStartStreamingParameters& Params, const FStartStreamingCallback& Delegate) override;
519 LOCALFILENETWORKREPLAYSTREAMING_API virtual void StopStreaming() override;
520 LOCALFILENETWORKREPLAYSTREAMING_API virtual FArchive* GetHeaderArchive() override;
521 LOCALFILENETWORKREPLAYSTREAMING_API virtual FArchive* GetStreamingArchive() override;
522 LOCALFILENETWORKREPLAYSTREAMING_API virtual FArchive* GetCheckpointArchive() override;
523 LOCALFILENETWORKREPLAYSTREAMING_API virtual void FlushCheckpoint(const uint32 TimeInMS) override;
524 LOCALFILENETWORKREPLAYSTREAMING_API virtual void GotoCheckpointIndex(const int32 CheckpointIndex, const FGotoCallback& Delegate, EReplayCheckpointType CheckpointType) override;
525 LOCALFILENETWORKREPLAYSTREAMING_API virtual void GotoTimeInMS(const uint32 TimeInMS, const FGotoCallback& Delegate, EReplayCheckpointType CheckpointType) override;
526 LOCALFILENETWORKREPLAYSTREAMING_API virtual void UpdateTotalDemoTime(uint32 TimeInMS) override;
527 virtual void UpdatePlaybackTime(uint32 TimeInMS) override {}
528 virtual uint32 GetTotalDemoTime() const override { return CurrentReplayInfo.LengthInMS; }
529 LOCALFILENETWORKREPLAYSTREAMING_API virtual bool IsDataAvailable() const override;
530 LOCALFILENETWORKREPLAYSTREAMING_API virtual void SetHighPriorityTimeRange(const uint32 StartTimeInMS, const uint32 EndTimeInMS) override;
531 LOCALFILENETWORKREPLAYSTREAMING_API virtual bool IsDataAvailableForTimeRange(const uint32 StartTimeInMS, const uint32 EndTimeInMS) override;
532 LOCALFILENETWORKREPLAYSTREAMING_API virtual bool IsLoadingCheckpoint() const override;
533 LOCALFILENETWORKREPLAYSTREAMING_API virtual bool IsLive() const override;
534 LOCALFILENETWORKREPLAYSTREAMING_API virtual void DeleteFinishedStream(const FString& StreamName, const FDeleteFinishedStreamCallback& Delegate) override;
535 LOCALFILENETWORKREPLAYSTREAMING_API virtual void DeleteFinishedStream( const FString& StreamName, const int32 UserIndex, const FDeleteFinishedStreamCallback& Delegate ) override;
536 LOCALFILENETWORKREPLAYSTREAMING_API virtual void EnumerateStreams( const FNetworkReplayVersion& InReplayVersion, const int32 UserIndex, const FString& MetaString, const TArray< FString >& ExtraParms, const FEnumerateStreamsCallback& Delegate ) override;
537 LOCALFILENETWORKREPLAYSTREAMING_API virtual void EnumerateRecentStreams( const FNetworkReplayVersion& ReplayVersion, const int32 UserIndex, const FEnumerateStreamsCallback& Delegate ) override;
538 LOCALFILENETWORKREPLAYSTREAMING_API virtual void AddUserToReplay(const FString& UserString) override;
539 LOCALFILENETWORKREPLAYSTREAMING_API virtual void AddEvent(const uint32 TimeInMS, const FString& Group, const FString& Meta, const TArray<uint8>& Data) override;
540 LOCALFILENETWORKREPLAYSTREAMING_API virtual void AddOrUpdateEvent(const FString& Name, const uint32 TimeInMS, const FString& Group, const FString& Meta, const TArray<uint8>& Data) override;
541 LOCALFILENETWORKREPLAYSTREAMING_API virtual void EnumerateEvents(const FString& Group, const FEnumerateEventsCallback& Delegate) override;
542 LOCALFILENETWORKREPLAYSTREAMING_API virtual void EnumerateEvents(const FString& ReplayName, const FString& Group, const FEnumerateEventsCallback& Delegate) override;
543 LOCALFILENETWORKREPLAYSTREAMING_API virtual void EnumerateEvents( const FString& ReplayName, const FString& Group, const int32 UserIndex, const FEnumerateEventsCallback& Delegate ) override;
544 LOCALFILENETWORKREPLAYSTREAMING_API virtual void RequestEventData(const FString& EventID, const FRequestEventDataCallback& Delegate) override;
545 LOCALFILENETWORKREPLAYSTREAMING_API virtual void RequestEventData(const FString& ReplayName, const FString& EventID, const FRequestEventDataCallback& Delegate) override;
546 LOCALFILENETWORKREPLAYSTREAMING_API virtual void RequestEventData(const FString& ReplayName, const FString& EventId, const int32 UserIndex, const FRequestEventDataCallback& Delegate) override;
547 LOCALFILENETWORKREPLAYSTREAMING_API virtual void RequestEventGroupData(const FString& Group, const FRequestEventGroupDataCallback& Delegate) override;
548 LOCALFILENETWORKREPLAYSTREAMING_API virtual void RequestEventGroupData(const FString& ReplayName, const FString& Group, const FRequestEventGroupDataCallback& Delegate) override;
549 LOCALFILENETWORKREPLAYSTREAMING_API virtual void RequestEventGroupData(const FString& ReplayName, const FString& Group, const int32 UserIndex, const FRequestEventGroupDataCallback& Delegate) override;
550 LOCALFILENETWORKREPLAYSTREAMING_API virtual void SearchEvents(const FString& EventGroup, const FSearchEventsCallback& Delegate) override;
551 LOCALFILENETWORKREPLAYSTREAMING_API virtual void KeepReplay(const FString& ReplayName, const bool bKeep, const FKeepReplayCallback& Delegate) override;
552 LOCALFILENETWORKREPLAYSTREAMING_API virtual void KeepReplay(const FString& ReplayName, const bool bKeep, const int32 UserIndex, const FKeepReplayCallback& Delegate) override;
553 LOCALFILENETWORKREPLAYSTREAMING_API virtual void RenameReplayFriendlyName(const FString& ReplayName, const FString& NewFriendlyName, const FRenameReplayCallback& Delegate) override;
554 LOCALFILENETWORKREPLAYSTREAMING_API virtual void RenameReplayFriendlyName(const FString& ReplayName, const FString& NewFriendlyName, const int32 UserIndex, const FRenameReplayCallback& Delegate) override;
555 LOCALFILENETWORKREPLAYSTREAMING_API virtual void RenameReplay(const FString& ReplayName, const FString& NewName, const FRenameReplayCallback& Delegate) override;
556 LOCALFILENETWORKREPLAYSTREAMING_API virtual void RenameReplay(const FString& ReplayName, const FString& NewName, const int32 UserIndex, const FRenameReplayCallback& Delegate) override;
557 virtual FString GetReplayID() const override { return CurrentStreamName; }
558 virtual EReplayStreamerState GetReplayStreamerState() const override { return StreamerState; }
559 virtual void SetTimeBufferHintSeconds(const float InTimeBufferHintSeconds) override {}
560 LOCALFILENETWORKREPLAYSTREAMING_API virtual void RefreshHeader() override;
561 LOCALFILENETWORKREPLAYSTREAMING_API virtual void DownloadHeader(const FDownloadHeaderCallback& Delegate) override;
562
563 LOCALFILENETWORKREPLAYSTREAMING_API virtual bool IsCheckpointTypeSupported(EReplayCheckpointType CheckpointType) const override;
564
565 virtual bool SupportsCompression() const { return false; }
566
567 virtual bool DecompressBuffer(const TArray<uint8>& InCompressed, TArray<uint8>& OutBuffer) const { return false; }
568 virtual bool CompressBuffer(const TArray<uint8>& InBuffer, TArray<uint8>& OutCompressed) const { return false; }
569
570 virtual bool SupportsEncryption() const { return false; }
571 virtual void GenerateEncryptionKey(TArray<uint8>& EncryptionKey) {}
574
575 LOCALFILENETWORKREPLAYSTREAMING_API bool AllowEncryptedWrite() const;
576
577 LOCALFILENETWORKREPLAYSTREAMING_API void Tick(float DeltaSeconds);
578
579 LOCALFILENETWORKREPLAYSTREAMING_API virtual uint32 GetMaxFriendlyNameSize() const override;
580
581 virtual EStreamingOperationResult SetDemoPath(const FString& DemoPath) override
582 {
583 if (CurrentStreamName.IsEmpty())
584 {
585 DemoSavePath = DemoPath;
587 }
588 else
589 {
591 }
592 }
593
594 virtual EStreamingOperationResult GetDemoPath(FString& DemoPath) const override
595 {
596 DemoPath = DemoSavePath;
598 }
599
601
602 LOCALFILENETWORKREPLAYSTREAMING_API bool IsStreaming() const;
603
604 LOCALFILENETWORKREPLAYSTREAMING_API bool HasPendingFileRequests() const;
605
606 void AddSimpleRequestToQueue(EQueuedLocalFileRequestType::Type RequestType, TFunction<void()>&& InFunction, TFunction<void()>&& InCompletionCallback)
607 {
609 }
610
611 template <typename StorageType>
612 void AddGenericRequestToQueue(EQueuedLocalFileRequestType::Type RequestType, TFunction<void(StorageType&)>&& InFunction, TFunction<void(StorageType&)>&& InCompletionCallback)
613 {
615 }
616
617 template<typename DelegateResultType>
622
623 template<typename DelegateType, typename DelegateResultType>
624 void AddDelegateFileRequestToQueue(EQueuedLocalFileRequestType::Type RequestType, const DelegateType& Delegate, TFunction<void(TLocalFileRequestCommonData<DelegateResultType>&)>&& InFunction)
625 {
628 {
629 Delegate.ExecuteIfBound(Storage.DelegateResult);
630 });
631 }
632
633 template<typename DelegateResultType>
638
641
644
646
647protected:
648
649 LOCALFILENETWORKREPLAYSTREAMING_API void DeleteFinishedStream_Internal(const FString& StreamName, const int32 UserIndex, const FDeleteFinishedStreamCallback& Delegate);
650 LOCALFILENETWORKREPLAYSTREAMING_API void EnumerateEvents_Internal(const FString& ReplayName, const FString& Group, const int32 UserIndex, const FEnumerateEventsCallback& Delegate);
651 LOCALFILENETWORKREPLAYSTREAMING_API void RequestEventData_Internal(const FString& ReplayName, const FString& EventId, const int32 UserIndex, const FRequestEventDataCallback& Delegate);
652 LOCALFILENETWORKREPLAYSTREAMING_API void KeepReplay_Internal(const FString& ReplayName, const bool bKeep, const int32 UserIndex, const FKeepReplayCallback& Delegate);
653 LOCALFILENETWORKREPLAYSTREAMING_API void RenameReplayFriendlyName_Internal(const FString& ReplayName, const FString& NewFriendlyName, const int32 UserIndex, const FRenameReplayCallback& Delegate);
654 LOCALFILENETWORKREPLAYSTREAMING_API void RenameReplay_Internal(const FString& ReplayName, const FString& NewName, const int32 UserIndex, const FRenameReplayCallback& Delegate);
655
664
667
674
677
678 LOCALFILENETWORKREPLAYSTREAMING_API bool ProcessNextFileRequest();
679 LOCALFILENETWORKREPLAYSTREAMING_API bool IsFileRequestInProgress() const;
680 LOCALFILENETWORKREPLAYSTREAMING_API bool IsFileRequestPendingOrInProgress(const EQueuedLocalFileRequestType::Type RequestType) const;
681 LOCALFILENETWORKREPLAYSTREAMING_API void CancelStreamingRequests();
682
684 UE_DEPRECATED(5.1, "No longer used")
685 void SetLastError(const ENetworkReplayError::Type InLastError)
686 {
687 SetLastError(ELocalFileReplayResult::Unknown);
688 }
690
691 void SetLastError(FLocalFileReplayResult&& Result);
692
693 LOCALFILENETWORKREPLAYSTREAMING_API void ConditionallyFlushStream();
694 LOCALFILENETWORKREPLAYSTREAMING_API void ConditionallyLoadNextChunk();
695 LOCALFILENETWORKREPLAYSTREAMING_API void ConditionallyRefreshReplayInfo();
696
697 LOCALFILENETWORKREPLAYSTREAMING_API void FlushCheckpointInternal(const uint32 TimeInMS);
698
700 {
702
703 FLocalFileReplayCustomVersion::Type GetLocalFileReplayVersion() const;
704
705 UE_DEPRECATED(5.2, "Replaced by FileCustomVersions.")
706 uint32 FileVersion;
707
708 FString FileFriendlyName;
709 FCustomVersionContainer FileCustomVersions;
710 };
711
712 bool ReadReplayInfo(const FString& StreamName, FLocalFileReplayInfo& OutReplayInfo) const
713 {
714 return ReadReplayInfo(StreamName, OutReplayInfo, EReadReplayInfoFlags::None);
715 }
716
719 LOCALFILENETWORKREPLAYSTREAMING_API bool ReadReplayInfo(FArchive& Archive, FLocalFileReplayInfo& OutReplayInfo, struct FLocalFileSerializationInfo& SerializationInfo, EReadReplayInfoFlags Flags) const;
720
721 LOCALFILENETWORKREPLAYSTREAMING_API bool WriteReplayInfo(const FString& StreamName, const FLocalFileReplayInfo& ReplayInfo);
722 LOCALFILENETWORKREPLAYSTREAMING_API bool WriteReplayInfo(FArchive& Archive, const FLocalFileReplayInfo& ReplayInfo);
723 LOCALFILENETWORKREPLAYSTREAMING_API bool WriteReplayInfo(FArchive& Archive, const FLocalFileReplayInfo& InReplayInfo, struct FLocalFileSerializationInfo& SerializationInfo);
724
725 LOCALFILENETWORKREPLAYSTREAMING_API void FixupFriendlyNameLength(const FString& UnfixedName, FString& FixedName) const;
726
727 LOCALFILENETWORKREPLAYSTREAMING_API bool IsNamedStreamLive(const FString& StreamName) const;
728
729 LOCALFILENETWORKREPLAYSTREAMING_API void FlushStream(const uint32 TimeInMS);
730
731 LOCALFILENETWORKREPLAYSTREAMING_API void WriteHeader();
732
733 LOCALFILENETWORKREPLAYSTREAMING_API virtual TSharedPtr<FArchive> CreateLocalFileReader(const FString& InFilename) const;
734 LOCALFILENETWORKREPLAYSTREAMING_API virtual TSharedPtr<FArchive> CreateLocalFileWriter(const FString& InFilename) const;
735 LOCALFILENETWORKREPLAYSTREAMING_API virtual TSharedPtr<FArchive> CreateLocalFileWriterForOverwrite(const FString& InFilename) const;
736
737 LOCALFILENETWORKREPLAYSTREAMING_API FString GetDemoPath() const;
738 // Must be relative to the base demo path
740 LOCALFILENETWORKREPLAYSTREAMING_API FString GetDemoFullFilename(const FString& FileName) const;
741
742 // Returns a name formatted as "demoX", where X is between 1 and MAX_DEMOS, inclusive.
743 // Returns the first value that doesn't yet exist, or if they all exist, returns the oldest one
744 // (it will be overwritten).
746
749
752
753 /* Handle to the archive that will read/write checkpoint files */
755
758
761
763
764 LOCALFILENETWORKREPLAYSTREAMING_API void AddRequestToCache(int32 ChunkIndex, const TArray<uint8>& RequestData);
765 LOCALFILENETWORKREPLAYSTREAMING_API void AddRequestToCache(int32 ChunkIndex, TArray<uint8>&& RequestData);
766 LOCALFILENETWORKREPLAYSTREAMING_API void CleanupRequestCache();
767
770 LOCALFILENETWORKREPLAYSTREAMING_API const TArray<uint8>& GetCachedFileContents(const FString& Filename) const;
771
773
774 LOCALFILENETWORKREPLAYSTREAMING_API virtual int32 GetDecompressedSizeBackCompat(FArchive& InCompressed) const;
775
776public:
777 static LOCALFILENETWORKREPLAYSTREAMING_API const FString& GetDefaultDemoSavePath();
778 static LOCALFILENETWORKREPLAYSTREAMING_API FString GetDemoFullFilename(const FString& DemoPath, const FString& FileName);
779 static LOCALFILENETWORKREPLAYSTREAMING_API bool CleanUpOldReplays(const FString& DemoPath = GetDefaultDemoSavePath(), TArrayView<const FString> AdditionalRelativeDemoPaths = {});
780 static LOCALFILENETWORKREPLAYSTREAMING_API bool GetDemoFreeStorageSpace(uint64& DiskFreeSpace, const FString& DemoPath);
781
784
785 UE_DEPRECATED(5.2, "No longer used, replaced with custom version.")
787
788private:
790 FLocalFileReplayInfo TaskReplayInfo;
791};
792
794{
795public:
796 LOCALFILENETWORKREPLAYSTREAMING_API virtual void StartupModule() override;
797 LOCALFILENETWORKREPLAYSTREAMING_API virtual void ShutdownModule() override;
798
799 LOCALFILENETWORKREPLAYSTREAMING_API virtual TSharedPtr<INetworkReplayStreamer> CreateReplayStreamer() override;
800 LOCALFILENETWORKREPLAYSTREAMING_API virtual void Flush() override;
801
803 LOCALFILENETWORKREPLAYSTREAMING_API virtual void Tick(float DeltaTime) override;
805 LOCALFILENETWORKREPLAYSTREAMING_API virtual TStatId GetStatId() const override;
806 bool IsTickableWhenPaused() const override { return true; }
807
808protected:
809 LOCALFILENETWORKREPLAYSTREAMING_API bool HasAnyPendingRequests() const;
810
812};
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
void SetPromise(TPromise< ResultType > &Promise, CallableType &&Callable)
Definition Async.h:61
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
#define RETURN_QUICK_DECLARE_CYCLE_STAT(StatId, GroupId)
Definition Stats.h:655
TSharedRef< InObjectType, InMode > MakeShared(InArgTypes &&... Args)
Definition SharedPointer.h:2009
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
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
ELocalFileReplayResult
Definition LocalFileNetworkReplayStreaming.h:290
EReadReplayInfoFlags
Definition LocalFileNetworkReplayStreaming.h:57
ELocalFileChunkType
Definition LocalFileNetworkReplayStreaming.h:48
EUpdateReplayInfoFlags
Definition LocalFileNetworkReplayStreaming.h:65
LOCALFILENETWORKREPLAYSTREAMING_API const TCHAR * LexToString(ELocalFileReplayResult Enum)
Definition LocalFileNetworkReplayStreaming.cpp:3720
#define DECLARE_NETRESULT_ENUM(EnumType)
Definition NetResult.h:469
EStreamingOperationResult
Definition NetworkReplayStreaming.h:197
@ Unspecified
The operation failed due to reaching a predefined replay limit.
EReplayCheckpointType
Definition NetworkReplayStreaming.h:482
EReplayStreamerState
Definition NetworkReplayStreaming.h:498
FString GetAutomaticDemoName()
Definition NullNetworkReplayStreaming.cpp:146
#define UENUM(...)
Definition ObjectMacros.h:749
ETickableTickType
Definition Tickable.h:20
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition Async.h:77
Definition LocalFileNetworkReplayStreaming.h:310
TArray< uint8 > RequestData
Definition LocalFileNetworkReplayStreaming.h:324
FCachedFileRequest(TArray< uint8 > &&InRequestData, const double InLastAccessTime)
Definition LocalFileNetworkReplayStreaming.h:318
double LastAccessTime
Definition LocalFileNetworkReplayStreaming.h:325
FCachedFileRequest(const TArray< uint8 > &InRequestData, const double InLastAccessTime)
Definition LocalFileNetworkReplayStreaming.h:312
Definition CustomVersion.h:111
Definition LocalFileNetworkReplayStreaming.h:355
FGenericQueuedLocalFileRequest(const TSharedPtr< FLocalFileNetworkReplayStreamer > &InStreamer, EQueuedLocalFileRequestType::Type InType, TFunction< void()> &&InFunction, TFunction< void()> &&InCompletionCallback)
Definition LocalFileNetworkReplayStreaming.h:357
TFunction< void()> RequestFunction
Definition LocalFileNetworkReplayStreaming.h:368
TFunction< void()> CompletionCallback
Definition LocalFileNetworkReplayStreaming.h:369
Definition LocalFileNetworkReplayStreaming.h:509
double LastRefreshTime
Definition LocalFileNetworkReplayStreaming.h:670
FString CurrentStreamName
Definition LocalFileNetworkReplayStreaming.h:760
TArray< TSharedPtr< FQueuedLocalFileRequest, ESPMode::ThreadSafe > > QueuedRequests
Definition LocalFileNetworkReplayStreaming.h:675
static LOCALFILENETWORKREPLAYSTREAMING_API FOnLocalFileReplayFinishedWriting OnReplayFinishedWriting
Definition LocalFileNetworkReplayStreaming.h:645
virtual uint32 GetTotalDemoTime() const override
Definition LocalFileNetworkReplayStreaming.h:528
virtual bool SupportsCompression() const
Definition LocalFileNetworkReplayStreaming.h:565
virtual EStreamingOperationResult GetDemoPath(FString &DemoPath) const override
Definition LocalFileNetworkReplayStreaming.h:594
virtual FString GetReplayID() const override
Definition LocalFileNetworkReplayStreaming.h:557
virtual TArrayView< const FString > GetAdditionalRelativeDemoPaths() const
Definition LocalFileNetworkReplayStreaming.h:739
uint32 HighPriorityEndTime
Definition LocalFileNetworkReplayStreaming.h:672
virtual bool SupportsEncryption() const
Definition LocalFileNetworkReplayStreaming.h:570
FLocalFileStreamFArchive HeaderAr
Definition LocalFileNetworkReplayStreaming.h:748
void AddSimpleRequestToQueue(EQueuedLocalFileRequestType::Type RequestType, TFunction< void()> &&InFunction, TFunction< void()> &&InCompletionCallback)
Definition LocalFileNetworkReplayStreaming.h:606
virtual bool EncryptBuffer(TArrayView< const uint8 > Plaintext, TArray< uint8 > &Ciphertext, TArrayView< const uint8 > EncryptionKey) const
Definition LocalFileNetworkReplayStreaming.h:572
TMap< int32, TSharedPtr< FCachedFileRequest > > RequestCache
Definition LocalFileNetworkReplayStreaming.h:640
virtual EStreamingOperationResult SetDemoPath(const FString &DemoPath) override
Definition LocalFileNetworkReplayStreaming.h:581
virtual bool CompressBuffer(const TArray< uint8 > &InBuffer, TArray< uint8 > &OutCompressed) const
Definition LocalFileNetworkReplayStreaming.h:568
bool bStopStreamingCalled
Definition LocalFileNetworkReplayStreaming.h:671
static LOCALFILENETWORKREPLAYSTREAMING_API const uint32 MaxFriendlyNameLen
Definition LocalFileNetworkReplayStreaming.h:783
int64 StreamDataOffset
Definition LocalFileNetworkReplayStreaming.h:666
virtual void SetTimeBufferHintSeconds(const float InTimeBufferHintSeconds) override
Definition LocalFileNetworkReplayStreaming.h:559
void AddCachedFileRequestToQueue(EQueuedLocalFileRequestType::Type RequestType, int32 InCacheKey, TFunction< void(TLocalFileRequestCommonData< DelegateResultType > &)> &&InFunction, TFunction< void(TLocalFileRequestCommonData< DelegateResultType > &)> &&InCompletionCallback)
Definition LocalFileNetworkReplayStreaming.h:634
double LastChunkTime
Definition LocalFileNetworkReplayStreaming.h:669
virtual void GenerateEncryptionKey(TArray< uint8 > &EncryptionKey)
Definition LocalFileNetworkReplayStreaming.h:571
virtual EReplayStreamerState GetReplayStreamerState() const override
Definition LocalFileNetworkReplayStreaming.h:558
EReplayStreamerState StreamerState
Definition LocalFileNetworkReplayStreaming.h:757
virtual bool DecryptBuffer(TArrayView< const uint8 > Ciphertext, TArray< uint8 > &Plaintext, TArrayView< const uint8 > EncryptionKey) const
Definition LocalFileNetworkReplayStreaming.h:573
TMap< FString, TArray< uint8 > > FileContentsCache
Definition LocalFileNetworkReplayStreaming.h:769
FLocalFileStreamFArchive StreamAr
Definition LocalFileNetworkReplayStreaming.h:751
FLocalFileReplayInfo CurrentReplayInfo
Definition LocalFileNetworkReplayStreaming.h:663
int64 LastGotoTimeInMS
Definition LocalFileNetworkReplayStreaming.h:673
static LOCALFILENETWORKREPLAYSTREAMING_API const uint32 FileMagic
Definition LocalFileNetworkReplayStreaming.h:782
void AddDelegateFileRequestToQueue(EQueuedLocalFileRequestType::Type RequestType, TFunction< void(TLocalFileRequestCommonData< DelegateResultType > &)> &&InFunction, TFunction< void(TLocalFileRequestCommonData< DelegateResultType > &)> &&InCompletionCallback)
Definition LocalFileNetworkReplayStreaming.h:618
void AddGenericRequestToQueue(EQueuedLocalFileRequestType::Type RequestType, TFunction< void(StorageType &)> &&InFunction, TFunction< void(StorageType &)> &&InCompletionCallback)
Definition LocalFileNetworkReplayStreaming.h:612
TInterval< uint32 > StreamTimeRange
Definition LocalFileNetworkReplayStreaming.h:665
TMap< int32, TSharedPtr< FCachedFileRequest > > DeltaCheckpointCache
Definition LocalFileNetworkReplayStreaming.h:643
FString DemoSavePath
Definition LocalFileNetworkReplayStreaming.h:762
TSharedPtr< FQueuedLocalFileRequest, ESPMode::ThreadSafe > ActiveRequest
Definition LocalFileNetworkReplayStreaming.h:676
FLocalFileStreamFArchive CheckpointAr
Definition LocalFileNetworkReplayStreaming.h:754
virtual void UpdatePlaybackTime(uint32 TimeInMS) override
Definition LocalFileNetworkReplayStreaming.h:527
virtual bool DecompressBuffer(const TArray< uint8 > &InCompressed, TArray< uint8 > &OutBuffer) const
Definition LocalFileNetworkReplayStreaming.h:567
int32 StreamChunkIndex
Definition LocalFileNetworkReplayStreaming.h:668
bool bCacheFileReadsInMemory
Definition LocalFileNetworkReplayStreaming.h:768
void AddDelegateFileRequestToQueue(EQueuedLocalFileRequestType::Type RequestType, const DelegateType &Delegate, TFunction< void(TLocalFileRequestCommonData< DelegateResultType > &)> &&InFunction)
Definition LocalFileNetworkReplayStreaming.h:624
Definition LocalFileNetworkReplayStreaming.h:794
bool IsTickableWhenPaused() const override
Definition LocalFileNetworkReplayStreaming.h:806
TArray< TSharedPtr< FLocalFileNetworkReplayStreamer > > LocalFileStreamers
Definition LocalFileNetworkReplayStreaming.h:811
virtual ETickableTickType GetTickableTickType() const override
Definition LocalFileNetworkReplayStreaming.h:804
Definition LocalFileNetworkReplayStreaming.h:176
FLocalFileStreamFArchive(const FLocalFileStreamFArchive &)=default
TArray< uint8 > Buffer
Definition LocalFileNetworkReplayStreaming.h:203
virtual LOCALFILENETWORKREPLAYSTREAMING_API int64 TotalSize() override
Definition LocalFileNetworkReplayStreaming.cpp:179
int32 Pos
Definition LocalFileNetworkReplayStreaming.h:205
bool bAtEndOfReplay
Definition LocalFileNetworkReplayStreaming.h:206
void Reset()
Definition LocalFileNetworkReplayStreaming.h:193
FLocalFileStreamFArchive & operator=(const FLocalFileStreamFArchive &)=default
virtual LOCALFILENETWORKREPLAYSTREAMING_API bool AtEnd() override
Definition LocalFileNetworkReplayStreaming.cpp:191
PRAGMA_DISABLE_DEPRECATION_WARNINGS FLocalFileStreamFArchive()
Definition LocalFileNetworkReplayStreaming.h:179
virtual LOCALFILENETWORKREPLAYSTREAMING_API int64 Tell() override
Definition LocalFileNetworkReplayStreaming.cpp:168
Definition NetworkVersion.h:20
Definition LocalFileNetworkReplayStreaming.h:329
virtual void IssueRequest()=0
virtual bool GetCachedRequest()
Definition LocalFileNetworkReplayStreaming.h:342
EQueuedLocalFileRequestType::Type GetRequestType() const
Definition LocalFileNetworkReplayStreaming.h:340
virtual void FinishRequest()=0
FQueuedLocalFileRequest(const TSharedPtr< FLocalFileNetworkReplayStreamer > &InStreamer, EQueuedLocalFileRequestType::Type InType)
Definition LocalFileNetworkReplayStreaming.h:331
FThreadSafeBool bCancelled
Definition LocalFileNetworkReplayStreaming.h:351
EQueuedLocalFileRequestType::Type RequestType
Definition LocalFileNetworkReplayStreaming.h:350
virtual ~FQueuedLocalFileRequest()
Definition LocalFileNetworkReplayStreaming.h:338
TSharedPtr< FLocalFileNetworkReplayStreamer > Streamer
Definition LocalFileNetworkReplayStreaming.h:349
Definition ThreadSafeBool.h:17
Definition Tickable.h:135
Definition NetworkReplayStreaming.h:516
Definition NetworkReplayStreaming.h:684
Definition ArrayView.h:139
Definition Array.h:670
void Reset(SizeType NewSize=0)
Definition Array.h:2246
Definition AndroidPlatformMisc.h:14
Definition Future.h:393
Definition LocalFileNetworkReplayStreaming.h:480
virtual bool GetCachedRequest() override
Definition LocalFileNetworkReplayStreaming.h:487
TGenericCachedLocalFileRequest(int32 InCacheKey, const TSharedPtr< FLocalFileNetworkReplayStreamer > &InStreamer, EQueuedLocalFileRequestType::Type InType, TFunction< void(TLocalFileRequestCommonData< DelegateResultType > &)> &&InFunction, TFunction< void(TLocalFileRequestCommonData< DelegateResultType > &)> &&InCompletionCallback)
Definition LocalFileNetworkReplayStreaming.h:482
int32 CacheKey
Definition LocalFileNetworkReplayStreaming.h:502
Definition LocalFileNetworkReplayStreaming.h:410
TGenericQueuedLocalFileRequest(const TSharedPtr< FLocalFileNetworkReplayStreamer > &InStreamer, EQueuedLocalFileRequestType::Type InType, TFunction< void(StorageType &)> &&InFunction, TFunction< void(StorageType &)> &&InCompletionCallback)
Definition LocalFileNetworkReplayStreaming.h:412
virtual void IssueRequest() override
Definition LocalFileNetworkReplayStreaming.h:420
StorageType Storage
Definition LocalFileNetworkReplayStreaming.h:454
virtual void FinishRequest() override
Definition LocalFileNetworkReplayStreaming.h:441
TFunction< void(StorageType &)> RequestFunction
Definition LocalFileNetworkReplayStreaming.h:457
TFunction< void(StorageType &)> CompletionCallback
Definition LocalFileNetworkReplayStreaming.h:458
Definition TaskGraphInterfaces.h:598
Definition LocalFileNetworkReplayStreaming.h:374
TLocalFileAsyncGraphTask(TFunction< ResultType()> &&InFunction, TPromise< ResultType > &&InPromise)
Definition LocalFileNetworkReplayStreaming.h:376
TStatId GetStatId() const
Definition LocalFileNetworkReplayStreaming.h:393
ENamedThreads::Type GetDesiredThread()
Definition LocalFileNetworkReplayStreaming.h:388
void DoTask(ENamedThreads::Type CurrentThread, const FGraphEventRef &MyCompletionGraphEvent)
Definition LocalFileNetworkReplayStreaming.h:383
TFuture< ResultType > GetFuture()
Definition LocalFileNetworkReplayStreaming.h:398
Definition LocalFileNetworkReplayStreaming.h:463
TArray< uint8 > DataBuffer
Definition LocalFileNetworkReplayStreaming.h:470
ELocalFileReplayResult AsyncError
Definition LocalFileNetworkReplayStreaming.h:475
bool bAsyncError
Definition LocalFileNetworkReplayStreaming.h:473
DelegateResultType DelegateResult
Definition LocalFileNetworkReplayStreaming.h:465
FLocalFileReplayInfo ReplayInfo
Definition LocalFileNetworkReplayStreaming.h:468
Definition UnrealString.h.inl:34
Definition Future.h:541
Definition SharedPointer.h:1640
Definition SharedPointer.h:692
UpdateFlags
Definition DetourCrowd.h:208
Type
Definition TaskGraphInterfaces.h:57
@ AnyBackgroundThreadNormalTask
Definition TaskGraphInterfaces.h:106
Definition NetworkReplayStreaming.h:103
Definition LocalFileNetworkReplayStreaming.h:213
@ false
Definition radaudio_common.h:23
static double Seconds()
Definition AndroidPlatformTime.h:20
Definition DateTime.h:76
Definition Guid.h:109
Definition LocalFileNetworkReplayStreaming.h:74
FLocalFileChunkInfo()
Definition LocalFileNetworkReplayStreaming.h:75
int32 SizeInBytes
Definition LocalFileNetworkReplayStreaming.h:83
ELocalFileChunkType ChunkType
Definition LocalFileNetworkReplayStreaming.h:82
int64 DataOffset
Definition LocalFileNetworkReplayStreaming.h:85
int64 TypeOffset
Definition LocalFileNetworkReplayStreaming.h:84
Definition LocalFileNetworkReplayStreaming.h:112
FString Metadata
Definition LocalFileNetworkReplayStreaming.h:125
int64 EventDataOffset
Definition LocalFileNetworkReplayStreaming.h:130
uint32 Time1
Definition LocalFileNetworkReplayStreaming.h:126
FLocalFileEventInfo()
Definition LocalFileNetworkReplayStreaming.h:113
FString Group
Definition LocalFileNetworkReplayStreaming.h:124
FString Id
Definition LocalFileNetworkReplayStreaming.h:123
int32 ChunkIndex
Definition LocalFileNetworkReplayStreaming.h:121
int32 SizeInBytes
Definition LocalFileNetworkReplayStreaming.h:129
void CountBytes(FArchive &Ar) const
Definition LocalFileNetworkReplayStreaming.cpp:100
uint32 Time2
Definition LocalFileNetworkReplayStreaming.h:127
Definition LocalFileNetworkReplayStreaming.h:700
Definition LocalFileNetworkReplayStreaming.h:22
Type
Definition LocalFileNetworkReplayStreaming.h:24
@ EncryptionSupport
Definition LocalFileNetworkReplayStreaming.h:33
@ CustomVersions
Definition LocalFileNetworkReplayStreaming.h:34
@ CompressionSupport
Definition LocalFileNetworkReplayStreaming.h:29
@ FixedSizeFriendlyName
Definition LocalFileNetworkReplayStreaming.h:28
@ BeforeCustomVersionWasAdded
Definition LocalFileNetworkReplayStreaming.h:26
@ RecordingTimestamp
Definition LocalFileNetworkReplayStreaming.h:30
@ LatestVersion
Definition LocalFileNetworkReplayStreaming.h:38
@ FriendlyNameCharEncoding
Definition LocalFileNetworkReplayStreaming.h:32
@ StreamChunkTimes
Definition LocalFileNetworkReplayStreaming.h:31
@ VersionPlusOne
Definition LocalFileNetworkReplayStreaming.h:37
LOCALFILENETWORKREPLAYSTREAMING_API static const FGuid Guid
Definition LocalFileNetworkReplayStreaming.h:42
Definition LocalFileNetworkReplayStreaming.h:90
int32 SizeInBytes
Definition LocalFileNetworkReplayStreaming.h:104
int64 ReplayDataOffset
Definition LocalFileNetworkReplayStreaming.h:106
int32 ChunkIndex
Definition LocalFileNetworkReplayStreaming.h:101
int64 StreamOffset
Definition LocalFileNetworkReplayStreaming.h:107
uint32 Time1
Definition LocalFileNetworkReplayStreaming.h:102
int32 MemorySizeInBytes
Definition LocalFileNetworkReplayStreaming.h:105
FLocalFileReplayDataInfo()
Definition LocalFileNetworkReplayStreaming.h:91
uint32 Time2
Definition LocalFileNetworkReplayStreaming.h:103
Definition LocalFileNetworkReplayStreaming.h:137
int32 LengthInMS
Definition LocalFileNetworkReplayStreaming.h:151
bool bIsLive
Definition LocalFileNetworkReplayStreaming.h:157
FString FriendlyName
Definition LocalFileNetworkReplayStreaming.h:154
bool bCompressed
Definition LocalFileNetworkReplayStreaming.h:159
TArray< FLocalFileReplayDataInfo > DataChunks
Definition LocalFileNetworkReplayStreaming.h:169
bool bIsValid
Definition LocalFileNetworkReplayStreaming.h:158
TArray< uint8 > EncryptionKey
Definition LocalFileNetworkReplayStreaming.h:162
TArray< FLocalFileChunkInfo > Chunks
Definition LocalFileNetworkReplayStreaming.h:166
void CountBytes(FArchive &Ar) const
Definition LocalFileNetworkReplayStreaming.cpp:107
FLocalFileReplayInfo()
Definition LocalFileNetworkReplayStreaming.h:138
TArray< FLocalFileEventInfo > Checkpoints
Definition LocalFileNetworkReplayStreaming.h:167
uint32 Changelist
Definition LocalFileNetworkReplayStreaming.h:153
int64 TotalDataSizeInBytes
Definition LocalFileNetworkReplayStreaming.h:156
bool bEncrypted
Definition LocalFileNetworkReplayStreaming.h:161
FDateTime Timestamp
Definition LocalFileNetworkReplayStreaming.h:155
uint32 NetworkVersion
Definition LocalFileNetworkReplayStreaming.h:152
int32 HeaderChunkIndex
Definition LocalFileNetworkReplayStreaming.h:164
TArray< FLocalFileEventInfo > Events
Definition LocalFileNetworkReplayStreaming.h:168
Definition NetworkReplayStreaming.h:488
Definition Interval.h:33
Definition LightweightStats.h:416
Definition NetResult.h:330