FChunkDownloader

Windows
MacOS
Linux

Inheritance Hierarchy

TSharedFromThis

FChunkDownloader

References

Module

ChunkDownloader

Header

/Engine/Plugins/Runtime/ChunkDownloader/Source/Public/ChunkDownloader.h

Include

#include "ChunkDownloader.h"

Syntax

class FChunkDownloader : public TSharedFromThis< FChunkDownloader >

Variables

Name Description

Public variable

FPlatformChunkI...

 

OnChunkMounted

Called whenever a chunk mounts (success or failure). ONLY USE THIS IF YOU WANT TO PASSIVELY LISTEN FOR MOUNTS (otherwise use the proper request callback on MountChunk)

Public variable

TFunction< void...

 

OnDownloadAnalytics

Called each time a download attempt finishes (success or failure). ONLY USE THIS IF YOU WANT TO PASSIVELY LISTEN. Downloads retry until successful.

Constructors

Name Description

Protected function

FChunkDownloader()

Destructors

Name Description

Public function

~FChunkDownloader()

Functions

Name Description

Public function

void

 

BeginLoadingMode

(
    const FCallback& Callback
)

Snapshot stats and enter into loading screen mode (pauses all background downloads).

Protected function Static

bool

 

CheckFileSha1Hash

(
    const FString& FullPathOnDisk,
    const FString& Sha1HashStr
)

Public function Static

const TCHAR ...

 

ChunkStatusToString

(
    EChunkStatus Status
)

Chunk status as logable string

Public function

void

 

DownloadChunk

(
    int32 ChunkId,
    const FCallback& Callback,
    int32 Priority
)

Download all pak files in the chunk, but don't mount.

Public function

void

 

DownloadChunks

(
    const TArray< int32 >& ChunkIds,
    const FCallback& Callback,
    int32 Priority
)

Download (Cache) all pak files in these chunks then fire the callback (convenience wrapper managing multiple DownloadChunk calls)

Public function Static

void

 

DumpLoadedChunks()

Public function

void

 

Finalize()

Unmount all chunks and cancel any downloads in progress (preserving partial downloads).

Public function

int

 

FlushCache()

Flush any cached files (on disk) that are not currently being downloaded to or mounting (does not unmount the corresponding pak files).

Public function Static

TSharedPtr< ...

 

Get()

Static getters

Public function Const

void

 

GetAllChunkIds

(
    TArray< int32 >& OutChunkIds
)

Return a list of all chunk IDs in the current manifest

Public function Static

TSharedRef< ...

 

GetChecked()

Static getters

Public function Const

EChunkStatus

 

GetChunkStatus

(
    int32 ChunkId
)

Get the current status of the specified chunk

Public function Const

const FStrin...

 

GetContentBuildId()

Get the current content build ID

Public function Const

const FStrin...

 

GetDeploymentName()

Get the most recent deployment name

Public function Const

const FStats...

 

GetLoadingStats()

Get the current loading stats (generally only useful if you're in loading mode see BeginLoadingMode)

Public function Static

TSharedRef< ...

 

GetOrCreate()

Static getters

Public function

void

 

Initialize

(
    const FString& PlatformName,
    int32 TargetDownloadsInFlight
)

Initialize the download manager (populates the list of cached pak files from disk). Call only once.

Public function

bool

 

LoadCachedBuild

(
    const FString& DeploymentName
)

Try to load a cached build ID from disk (good to do before updating build so it can possibly no-op)

Public function

void

 

MountChunk

(
    int32 ChunkId,
    const FCallback& Callback
)

Download all pak files, then asynchronously mount them in order (in order among themselves, async with game thread).

Public function

void

 

MountChunks

(
    const TArray< int32 >& ChunkIds,
    const FCallback& Callback
)

Download and mount all chunks then fire the callback (convenience wrapper managing multiple MountChunk calls)

Public function Static

void

 

Shutdown()

Public function

void

 

UpdateBuild

(
    const FString& DeploymentName,
    const FString& ContentBuildId,
    const FCallback& Callback
)

Set the the content build id if the content build id has changed, we pull the new BuildManifest from CDN and load it.

Public function

int

 

ValidateCache()

Validate all fully cached files (blocking) by attempting to read them and check their Version hash.

Classes

Enums

Name

Description

Public enum

EChunkStatus

Typedefs

Name

Description

FCallback

FMountTask

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