FLocalFileNetworkReplayStreamer

Local file streamer that supports playback/recording to a single file on disk

Windows
MacOS
Linux

Inheritance Hierarchy

INetworkReplayStreamer

TSharedFromThis

FLocalFileNetworkReplayStreamer

References

Module

LocalFileNetworkReplayStreaming

Header

/Engine/Source/Runtime/NetworkReplayStreaming/LocalFileNetworkReplayStreaming/Public/LocalFileNetworkReplayStreaming.h

Include

#include "LocalFileNetworkReplayStreaming.h"

Syntax

class FLocalFileNetworkReplayStreamer :
    public INetworkReplayStreamer,
    public TSharedFromThis< FLocalFileNetworkReplayStreamer >

Remarks

Local file streamer that supports playback/recording to a single file on disk

Variables

Name Description

Protected variable

TSharedPtr< FQu...

 

ActiveRequest

Protected variable

bool

 

bCacheFileReadsInMemory

Protected variable

bool

 

bStopStreamingCalled

Protected variable

FLocalFileStrea...

 

CheckpointAr

Handle to the archive that will read/write checkpoint files

Protected variable

FLocalFileRepla...

 

CurrentReplayInfo

Currently playing or recording replay metadata

Protected variable

FString

 

CurrentStreamName

Remember the name of the current stream, if any.

Public variable

TMap< int32, TS...

 

DeltaCheckpointCache

Map of checkpoint index to cached value

Protected variable

FString

 

DemoSavePath

Protected variable

TMap< FString, ...

 

FileContentsCache

Protected variable

FLocalFileStrea...

 

HeaderAr

Handle to the archive that will read/write the demo header

Protected variable

uint32

 

HighPriorityEndTime

Protected variable

double

 

LastChunkTime

Protected variable

int64

 

LastGotoTimeInMS

Protected variable

double

 

LastRefreshTime

Protected variable

TArray< TShared...

 

QueuedRequests

Public variable

TMap< int32, TS...

 

RequestCache

Map of chunk index to cached value

Protected variable

FLocalFileStrea...

 

StreamAr

Handle to the archive that will read/write network packets

Protected variable

int32

 

StreamChunkIndex

Protected variable

int64

 

StreamDataOffset

Protected variable

ENetworkReplayE...

 

StreamerLastError

Protected variable

EStreamerState

 

StreamerState

Overall state of the streamer

Protected variable

TInterval< uint...

 

StreamTimeRange

Constructors

Name Description

Public function

FLocalFileNetworkReplayStreamer()

Public function

FLocalFileNetworkReplayStreamer

(
    const FString& InDemoSavePath
)

Destructors

Functions

Name Description

Public function

void

 

AddCachedFileRequestToQueue

(
    EQueuedLocalFileRequestType::Type R...,
    int32 InCacheKey,
    TFunction< void...,
    TFunction< void...
)

Public function

void

 

AddDelegateFileRequestToQueue

(
    EQueuedLocalFileRequestType::Type R...,
    const DelegateType& Delegate,
    TFunction< void...
)

Public function

void

 

AddDelegateFileRequestToQueue

(
    EQueuedLocalFileRequestType::Type R...,
    TFunction< void...,
    TFunction< void...
)

Public function

void

 

AddGenericRequestToQueue

(
    EQueuedLocalFileRequestType::Type R...,
    TFunction< void>&& ...,
    TFunction< void>&& ...
)

Protected function

void

 

AddRequestToCache

(
    int32 ChunkIndex,
    const TArray< uint8 >& RequestData
)

Public function

void

 

AddSimpleRequestToQueue

(
    EQueuedLocalFileRequestType::Type R...,
    TFunction< void()>&& InFunction,
    TFunction< void()>&& InCompletionC...
)

Public function Const

bool

 

AllowEncryptedWrite()

Protected function

void

 

CancelStreamingRequests()

Protected function

void

 

CleanupRequestCache()

Public function Virtual Const

bool

 

CompressBuffer

(
    const TArray< uint8 >& InBuffer,
    TArray< uint8 >& OutCompressed
)

Protected function

void

 

ConditionallyFlushStream()

Protected function

void

 

ConditionallyLoadNextChunk()

Protected function

void

 

ConditionallyRefreshReplayInfo()

Protected function Virtual Const

TSharedPtr< ...

 

CreateLocalFileReader

(
    const FString& InFilename
)

Protected function Virtual Const

TSharedPtr< ...

 

CreateLocalFileWriter

(
    const FString& InFilename
)

Protected function Virtual Const

TSharedPtr< ...

 

CreateLocalFileWriterForOverwrite

(
    const FString& InFilename
)

Public function Virtual Const

bool

 

DecompressBuffer

(
    const TArray< uint8 >& InCompresse...,
    TArray< uint8 >& OutBuffer
)

Public function Virtual Const

bool

 

DecryptBuffer

(
    TArrayView< const uint8 > Ciphertex...,
    TArray< uint8 >& Plaintext,
    TArrayView< const uint8 > Encryptio...
)

Protected function

void

 

DeleteFinishedStream_Internal

(
    const FString& StreamName,
    const int32 UserIndex,
    const FDeleteFinishedStreamCallback...
)

Public function Virtual Const

bool

 

EncryptBuffer

(
    TArrayView< const uint8 > Plaintext,
    TArray< uint8 >& Ciphertext,
    TArrayView< const uint8 > Encryptio...
)

Protected function

void

 

EnumerateEvents_Internal

(
    const FString& ReplayName,
    const FString& Group,
    const int32 UserIndex,
    const FEnumerateEventsCallback& De...
)

Protected function Const

void

 

FixupFriendlyNameLength

(
    const FString& UnfixedName,
    FString& FixedName
)

Protected function

void

 

FlushCheckpointInternal

(
    const uint32 TimeInMS
)

Protected function

void

 

FlushStream

(
    const uint32 TimeInMS
)

Public function Virtual

void

 

GenerateEncryptionKey

(
    TArray< uint8 >& EncryptionKey
)

Protected function Const

FString

 

GetAutomaticDemoName()

Returns a name formatted as "demoX", where X is between 1 and MAX_DEMOS, inclusive.

Protected function Const

const TArray...

 

GetCachedFileContents

(
    const FString& Filename
)

Public function Static

const FStrin...

 

GetDefaultDemoSavePath()

Protected function Const

FString

 

GetDemoFullFilename

(
    const FString& FileName
)

Protected function Const

FString

 

GetDemoPath()

Public function Const

bool

 

HasPendingFileRequests()

Protected function Const

bool

 

IsFileRequestInProgress()

Protected function Const

bool

 

IsFileRequestPendingOrInProgress

(
    const EQueuedLocalFileRequestType::...
)

Protected function Const

bool

 

IsNamedStreamLive

(
    const FString& StreamName
)

Public function Const

bool

 

IsStreaming()

Protected function

void

 

KeepReplay_Internal

(
    const FString& ReplayName,
    const bool bKeep,
    const int32 UserIndex,
    const FKeepReplayCallback& Delegat...
)

Public function

void

 

OnFileRequestComplete

(
    const TSharedPtr< FQueuedLocalFileR...
)

Protected function

bool

 

ProcessNextFileRequest()

Protected function Const

bool

 

ReadReplayInfo

(
    FArchive& Archive,
    FLocalFileReplayInfo& OutReplayInf...,
    EReadReplayInfoFlags Flags
)

Protected function Const

bool

 

ReadReplayInfo

(
    FArchive& Archive,
    FLocalFileReplayInfo& OutReplayInf...,
    FLocalFileSerializationInfo& Seria...,
    EReadReplayInfoFlags Flags
)

Protected function Const

bool

 

ReadReplayInfo

(
    const FString& StreamName,
    FLocalFileReplayInfo& OutReplayInf...
)

Protected function Const

bool

 

ReadReplayInfo

(
    const FString& StreamName,
    FLocalFileReplayInfo& OutReplayInf...,
    EReadReplayInfoFlags Flags
)

Protected function

void

 

RenameReplay_Internal

(
    const FString& ReplayName,
    const FString& NewName,
    const int32 UserIndex,
    const FRenameReplayCallback& Deleg...
)

Protected function

void

 

RenameReplayFriendlyName_Internal

(
    const FString& ReplayName,
    const FString& NewFriendlyName,
    const int32 UserIndex,
    const FRenameReplayCallback& Deleg...
)

Protected function

void

 

RequestEventData_Internal

(
    const FString& ReplayName,
    const FString& EventId,
    const int32 UserIndex,
    const FRequestEventDataCallback& D...
)

Protected function

void

 

SetLastError

(
    const ENetworkReplayError::Type InL...
)

Public function Virtual Const

bool

 

SupportsCompression()

Public function Virtual Const

bool

 

SupportsEncryption()

Public function

void

 

Tick

(
    float DeltaSeconds
)

Protected function

void

 

UpdateCurrentReplayInfo

(
    FLocalFileReplayInfo& ReplayInfo
)

Protected function

void

 

WriteHeader()

Protected function

bool

 

WriteReplayInfo

(
    FArchive& Archive,
    const FLocalFileReplayInfo& Replay...
)

Protected function

bool

 

WriteReplayInfo

(
    const FString& StreamName,
    const FLocalFileReplayInfo& Replay...
)

Protected function

bool

 

WriteReplayInfo

(
    FArchive& Archive,
    const FLocalFileReplayInfo& InRepl...,
    FLocalFileSerializationInfo& Seria...
)

Overridden from INetworkReplayStreamer

Name Description

Public function Virtual

void

 

AddEvent

(
    const uint32 TimeInMS,
    const FString& Group,
    const FString& Meta,
    const TArray< uint8 >& Data
)

Public function Virtual

void

 

AddOrUpdateEvent

(
    const FString& Name,
    const uint32 TimeInMS,
    const FString& Group,
    const FString& Meta,
    const TArray< uint8 >& Data
)

Public function Virtual

void

 

AddUserToReplay

(
    const FString& UserString
)

Adds a join-in-progress user to the set of users associated with the currently recording replay (if any)

Public function Virtual

void

 

DeleteFinishedStream

(
    const FString& StreamName,
    const int32 UserIndex,
    const FDeleteFinishedStreamCallback...
)

Public function Virtual

void

 

DeleteFinishedStream

(
    const FString& StreamName,
    const FDeleteFinishedStreamCallback...
)

Attempts to delete the stream with the specified name. May execute asynchronously.

Public function Virtual

void

 

DownloadHeader

(
    const FDownloadHeaderCallback& Del...
)

Public function Virtual

void

 

EnumerateEvents

(
    const FString& Group,
    const FEnumerateEventsCallback& De...
)

Public function Virtual

void

 

EnumerateEvents

(
    const FString& ReplayName,
    const FString& Group,
    const FEnumerateEventsCallback& De...
)

Public function Virtual

void

 

EnumerateEvents

(
    const FString& ReplayName,
    const FString& Group,
    const int32 UserIndex,
    const FEnumerateEventsCallback& De...
)

Public function Virtual

void

 

EnumerateRecentStreams

(
    const FNetworkReplayVersion& Repla...,
    const int32 UserIndex,
    const FEnumerateStreamsCallback& D...
)

Retrieves the streams that have been recently viewed. May execute asynchronously.

Public function Virtual

void

 

EnumerateStreams

(
    const FNetworkReplayVersion& Repla...,
    const int32 UserIndex,
    const FString& MetaString,
    const TArray< FString >& ExtraParm...,
    const FEnumerateStreamsCallback& D...
)

Retrieves the streams that are available for viewing.

Public function Virtual

void

 

FlushCheckpoint

(
    const uint32 TimeInMS
)

Public function Virtual

FArchive ...

 

GetCheckpointArchive()

Public function Virtual Const

EStreamingOp...

 

GetDemoPath

(
    FString& DemoPath
)

Gets the current base directory where Demos are stored.

Public function Virtual

FArchive ...

 

GetHeaderArchive()

Public function Virtual Const

ENetworkRepl...

 

GetLastError()

Returns the last error that occurred while streaming replays

Public function Virtual Const

uint32

 

GetMaxFriendlyNameSize()

Returns the maximum size of the friendly name text for this streamer, or 0 for unlimited.

Public function Virtual Const

FString

 

GetReplayID()

Returns the active replay name

Public function Virtual

FArchive ...

 

GetStreamingArchive()

Public function Virtual Const

uint32

 

GetTotalDemoTime()

Public function Virtual

void

 

GotoCheckpointIndex

(
    const int32 CheckpointIndex,
    const FGotoCallback& Delegate,
    EReplayCheckpointType CheckpointTyp...
)

Public function Virtual

void

 

GotoTimeInMS

(
    const uint32 TimeInMS,
    const FGotoCallback& Delegate,
    EReplayCheckpointType CheckpointTyp...
)

Public function Virtual Const

bool

 

IsCheckpointTypeSupported

(
    EReplayCheckpointType CheckpointTyp...
)

Public function Virtual Const

bool

 

IsDataAvailable()

Public function Virtual

bool

 

IsDataAvailableForTimeRange

(
    const uint32 StartTimeInMS,
    const uint32 EndTimeInMS
)

Public function Virtual Const

bool

 

IsLive()

Returns true if the playing stream is currently in progress

Public function Virtual Const

bool

 

IsLoadingCheckpoint()

Public function Virtual

void

 

KeepReplay

(
    const FString& ReplayName,
    const bool bKeep,
    const int32 UserIndex,
    const FKeepReplayCallback& Delegat...
)

Public function Virtual

void

 

KeepReplay

(
    const FString& ReplayName,
    const bool bKeep,
    const FKeepReplayCallback& Delegat...
)

Used to commit a replay to permanent storage.

Public function Virtual

void

 

RefreshHeader()

Public function Virtual

void

 

RenameReplay

(
    const FString& ReplayName,
    const FString& NewName,
    const int32 UserIndex,
    const FRenameReplayCallback& Deleg...
)

Public function Virtual

void

 

RenameReplay

(
    const FString& ReplayName,
    const FString& NewName,
    const FRenameReplayCallback& Deleg...
)

Used to change the name of a replay.

Public function Virtual

void

 

RenameReplayFriendlyName

(
    const FString& ReplayName,
    const FString& NewFriendlyName,
    const int32 UserIndex,
    const FRenameReplayCallback& Deleg...
)

Public function Virtual

void

 

RenameReplayFriendlyName

(
    const FString& ReplayName,
    const FString& NewFriendlyName,
    const FRenameReplayCallback& Deleg...
)

Used to change the friendly name of a replay.

Public function Virtual

void

 

RequestEventData

(
    const FString& EventID,
    const FRequestEventDataCallback& D...
)

Public function Virtual

void

 

RequestEventData

(
    const FString& ReplayName,
    const FString& EventId,
    const int32 UserIndex,
    const FRequestEventDataCallback& D...
)

Public function Virtual

void

 

RequestEventData

(
    const FString& ReplayName,
    const FString& EventID,
    const FRequestEventDataCallback& D...
)

Public function Virtual

void

 

RequestEventGroupData

(
    const FString& Group,
    const FRequestEventGroupDataCallbac...
)

Public function Virtual

void

 

RequestEventGroupData

(
    const FString& ReplayName,
    const FString& Group,
    const int32 UserIndex,
    const FRequestEventGroupDataCallbac...
)

Public function Virtual

void

 

RequestEventGroupData

(
    const FString& ReplayName,
    const FString& Group,
    const FRequestEventGroupDataCallbac...
)

Public function Virtual

void

 

SearchEvents

(
    const FString& EventGroup,
    const FSearchEventsCallback& Deleg...
)

Public function Virtual

EStreamingOp...

 

SetDemoPath

(
    const FString& DemoPath
)

Changes the base directory where Demos are stored.

Public function Virtual

void

 

SetHighPriorityTimeRange

(
    const uint32 StartTimeInMS,
    const uint32 EndTimeInMS
)

Public function Virtual

void

 

SetTimeBufferHintSeconds

(
    const float InTimeBufferHintSeconds
)

Sets a hint for how much data needs to be kept in memory.

Public function Virtual

void

 

StartStreaming

(
    const FStartStreamingParameters& P...,
    const FStartStreamingCallback& Del...
)

INetworkReplayStreamer implementation

Public function Virtual

void

 

StopStreaming()

Public function Virtual

void

 

UpdatePlaybackTime

(
    uint32 TimeInMS
)

Public function Virtual

void

 

UpdateTotalDemoTime

(
    uint32 TimeInMS
)

Classes

Name

Description

Protected struct

FLocalFileSerializationInfo

Enums

Name

Description

Protected enum

EStreamerState

EStreamerState - Overall state of the streamer

Constants

Deprecated Functions

Name Description

Public function Virtual Const

int32

 

GetDecompressedSize

(
    FArchive& InCompressed
)

No longer used

Protected function Const

bool

 

ReadReplayInfo

(
    FArchive& Archive,
    FLocalFileReplayInfo& OutReplayInf...,
    FLocalFileSerializationInfo& Seria...
)

Now takes a set of read flags

Protected function Const

bool

 

ReadReplayInfo

(
    FArchive& Archive,
    FLocalFileReplayInfo& OutReplayInf...
)

Now takes a set of read flags

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss