FNetworkPlatformFile

Wrapper to redirect the low level file system to a server

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

NetworkFile

Header

/Engine/Source/Runtime/NetworkFile/Public/NetworkPlatformFile.h

Include

#include "NetworkPlatformFile.h"

Syntax

class FNetworkPlatformFile :
    public IPlatformFile,
    public FSelfRegisteringExec

Remarks

Wrapper to redirect the low level file system to a server

Variables

Name Description

Protected variable

bool

 

bHasLoadedDDCDirectories

This is true after the DDC directories have been loaded from the DDC system

Protected variable

bool

 

bIsUsable

Protected variable

TSet< FString >

 

CachedLocalFiles

This keeps track of what files have been "EnsureFileIsLocal'd"

Protected variable

EConnectionFlag...

 

ConnectionFlags

The connection flags are passed to the server during GetFileList the server may cache them

Protected variable

int32

 

FileServerPort

Protected variable

float

 

HeartbeatFrequency

Frequency to send heartbeats to server in seconds set to negative number to disable.

Protected variable

IPlatformFile &...

 

InnerPlatformFile

The file interface to read/write local files with

Protected variable

TArray< FString...

 

LocalDirectories

Set of directories that should use the local filesystem

Protected variable

FCriticalSectio...

 

LocalDirectoriesCriticalSection

Protected variable

FString

 

ServerEngineDir

The server engine dir

Protected variable

FString

 

ServerEnginePlatformExtensionsDir

The server engine platform extensions dir

Protected variable

FServerTOC

 

ServerFiles

This is the "TOC" of the server

Protected variable

FString

 

ServerProjectDir

The server game dir

Protected variable

FString

 

ServerProjectPlatformExtensionsDir

The server project platform extensions dir

Protected variable

FCriticalSectio...

 

SynchronizationObject

Protected variable

int32

 

TotalFilesFoundLocally

Protected variable

int32

 

TotalFilesSynced

Protected variable

double

 

TotalNetworkSyncTime

Protected variable

double

 

TotalTimeSpentInUnsolicitedPackages

Protected variable

int32

 

TotalUnsolicitedPackages

Protected variable

double

 

TotalWaitForAsyncUnsolicitedPackages

Protected variable

double

 

TotalWriteTime

Some stats for messuring network platform file performance

Protected variable

int32

 

UnsolicitedPackagesHits

Protected variable

int32

 

UnsolicitedPackageWaits

Constructors

Name Description

Public function

FNetworkPlatformFile()

Constructor

Destructors

Name Description

Public function Virtual

~FNetworkPlatformFile()

Destructor

Functions

Name Description

Protected function Virtual

void

 

ConvertServerFilenameToClientFilename

(
    FString& FilenameToConvert
)

Convert the given filename from the server to the client version of it

Public function Static

void

 

ConvertServerFilenameToClientFilename

(
    FString& FilenameToConvert,
    const FString& InServerEngineDir,
    const FString& InServerProjectDir,
    const FString& InServerEnginePlatf...,
    const FString& InServerProjectPlat...
)

Protected function Virtual

void

 

FillGetFileList

(
    FNetworkFileArchive& Payload
)

Protected function Virtual

void

 

GetFileInfo

(
    const TCHAR* Filename,
    FFileInfo& Info
)

Public function Static

const TCHAR ...

 

GetTypeName()

Public function Virtual Const

FString

 

GetVersionInfo()

Protected function Virtual

bool

 

InitializeInternal

(
    IPlatformFile* Inner,
    const TCHAR* HostIP
)

Initialize network platform file give the specified host IP

Public function Virtual

bool

 

IsUsable()

Protected function

void

 

MakeStandardNetworkFilename

(
    FString& Filename
)

Does normal path standardization, and also any extra modifications to make string comparisons against the internal directory list work properly.

Protected function Virtual

void

 

OnFileUpdated

(
    const FString& LocalFilename
)

Protected function Virtual

void

 

PerformHeartbeat()

Send a heartbeat message to the file server.

Protected function Virtual

void

 

ProcessServerCachedFilesResponse

(
    FArrayReader& InReponse,
    const FPackageFileVersion& ServerP...,
    const int32 ServerPackageLicenseeVe...
)

Protected function Virtual

void

 

ProcessServerInitialResponse

(
    FArrayReader& InResponse,
    FPackageFileVersion& OutServerPack...,
    int32& OutServerPackageLicenseeVer...
)

Public function Virtual

bool

 

ReceiveResponse

(
    TArray< uint8 >& Out
)

Public function Virtual

bool

 

SendPayloadAndReceiveResponse

(
    TArray< uint8 >& In,
    TArray< uint8 >& Out
)

Public function

bool

 

SendReadMessage

(
    uint8* Destination,
    int64 BytesToRead
)

Public function

bool

 

SendWriteMessage

(
    const uint8* Source,
    int64 BytesToWrite
)

Overridden from IPlatformFile

Name Description

Public function Virtual

FString

 

ConvertToAbsolutePathForExternalAppForRead

(
    const TCHAR* Filename
)

Converts passed in filename to use an absolute path (for reading).

Public function Virtual

FString

 

ConvertToAbsolutePathForExternalAppForWrite

(
    const TCHAR* Filename
)

Converts passed in filename to use an absolute path (for writing)

Public function Virtual

bool

 

CopyFile

(
    const TCHAR* To,
    const TCHAR* From,
    EPlatformFileRead ReadFlags,
    EPlatformFileWrite WriteFlags
)

Copy a file. This will fail if the destination file already exists.

Public function Virtual

bool

 

CreateDirectory

(
    const TCHAR* Directory
)

Create a directory and return true if the directory was created or already existed.

Public function Virtual

bool

 

CreateDirectoryTree

(
    const TCHAR* Directory
)

Create a directory, including any parent directories and return true if the directory was created or already existed.

Public function Virtual

bool

 

DeleteDirectory

(
    const TCHAR* Directory
)

Delete a directory and return true if the directory was deleted or otherwise does not exist.

Public function Virtual

bool

 

DeleteDirectoryRecursively

(
    const TCHAR* Directory
)

Delete all files and subdirectories in a directory, then delete the directory itself

Public function Virtual

bool

 

DeleteFile

(
    const TCHAR* Filename
)

Delete a file and return true if the file exists. Will not delete read only files.

Public function Virtual

bool

 

DirectoryExists

(
    const TCHAR* Directory
)

Return true if the directory exists.

Public function Virtual

bool

 

FileExists

(
    const TCHAR* Filename
)

Return true if the file exists.

Public function Virtual

int64

 

FileSize

(
    const TCHAR* Filename
)

Return the size of the file, or -1 if it doesn't exist.

Public function Virtual

FDateTime

 

GetAccessTimeStamp

(
    const TCHAR* Filename
)

Return the last access time of a file.

Public function Virtual

FString

 

GetFilenameOnDisk

(
    const TCHAR* Filename
)

For case insensitive filesystems, returns the full path of the file with the same case as in the filesystem

Public function Virtual

IPlatformFil...

 

GetLowerLevel()

Gets the platform file wrapped by this file.

Public function Virtual Const

const TCHAR ...

 

GetName()

Gets this platform file type name.

Public function Virtual

FFileStatDat...

 

GetStatData

(
    const TCHAR* FilenameOrDirecto...
)

Return the stat data for the given file or directory.

Public function Virtual

FDateTime

 

GetTimeStamp

(
    const TCHAR* Filename
)

Return the modification time of a file.

Public function Virtual

void

 

GetTimeStampPair

(
    const TCHAR* PathA,
    const TCHAR* PathB,
    FDateTime& OutTimeStampA,
    FDateTime& OutTimeStampB
)

Public function Virtual

bool

 

Initialize

(
    IPlatformFile* Inner,
    const TCHAR* CmdLine
)

Initializes platform file.

Public function Virtual

void

 

InitializeAfterSetActive()

Performs initialization of the platform file after it has become the active (FPlatformFileManager.GetPlatformFile() will return this

Public function Virtual

bool

 

IsReadOnly

(
    const TCHAR* Filename
)

Return true if the file is read only.

Public function Virtual

bool

 

IterateDirectory

(
    const TCHAR* Directory,
    IPlatformFile::FDirectoryVisitor& ...
)

Call the Visit function of the visitor once for each file or directory in a single directory.

Public function Virtual

bool

 

IterateDirectoryRecursively

(
    const TCHAR* Directory,
    IPlatformFile::FDirectoryVisitor& ...
)

Call the Visit function of the visitor once for each file or directory in a directory tree.

Public function Virtual

bool

 

IterateDirectoryStat

(
    const TCHAR* Directory,
    IPlatformFile::FDirectoryStatVisito...
)

Call the Visit function of the visitor once for each file or directory in a single directory.

Public function Virtual

bool

 

IterateDirectoryStatRecursively

(
    const TCHAR* Directory,
    IPlatformFile::FDirectoryStatVisito...
)

Call the Visit function of the visitor once for each file or directory in a directory tree.

Public function Virtual

bool

 

MoveFile

(
    const TCHAR* To,
    const TCHAR* From
)

Attempt to move a file. Return true if successful. Will not overwrite existing files.

Public function Virtual

IFileHandle ...

 

OpenRead

(
    const TCHAR* Filename,
    bool bAllowWrite
)

Attempt to open a file for reading.

Public function Virtual

IFileHandle ...

 

OpenWrite

(
    const TCHAR* Filename,
    bool bAppend,
    bool bAllowRead
)

Attempt to open a file for writing.

Public function Virtual

bool

 

SendMessageToServer

(
    const TCHAR* Message,
    IPlatformFile::IFileServerMessageHa...
)

Sends a message to the file server, and will block until it's complete.

Public function Virtual

void

 

SetLowerLevel

(
    IPlatformFile* NewLowerLevel
)

Sets the platform file wrapped by this file.

Public function Virtual

bool

 

SetReadOnly

(
    const TCHAR* Filename,
    bool bNewReadOnlyValue
)

Attempt to change the read only status of a file. Return true if successful.

Public function Virtual

void

 

SetTimeStamp

(
    const TCHAR* Filename,
    FDateTime DateTime
)

Sets the modification time of a file

Public function Virtual Const

bool

 

ShouldBeUsed

(
    IPlatformFile* Inner,
    const TCHAR* CmdLine
)

Checks if this platform file should be used even though it was not asked to be.

Public function Virtual

void

 

Tick()

Platform file can override this to get a regular tick from the engine

Overridden from FExec

Name Description

Public function Virtual

bool

 

Exec

(
    UWorld* InWorld,
    const TCHAR* Cmd,
    FOutputDevice& Ar
)

Exec handler

Constants