Navigation
API > API/Plugins > API/Plugins/ChunkDownloader
| Name | FChunkDownloader |
| Type | class |
| Header File | /Engine/Plugins/Runtime/ChunkDownloader/Source/Public/ChunkDownloader.h |
| Include Path | #include "ChunkDownloader.h" |
Syntax
class FChunkDownloader : public TSharedFromThis< FChunkDownloader >
Inheritance Hierarchy
- TSharedFromThis< FChunkDownloader > → FChunkDownloader
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FChunkDownloader() |
ChunkDownloader.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FChunkDownloader() |
ChunkDownloader.h |
Classes
| Name | Remarks |
|---|---|
| FMultiCallback | |
| FPakMountWork |
Structs
Enums
Public
| Name | Remarks |
|---|---|
| EChunkStatus |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FCallback | TFunction< void(bool bSuccess)> | ChunkDownloader.h | |
| FMountTask | FAsyncTask< FPakMountWork > | ChunkDownloader.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OnChunkMounted | FPlatformChunkInstallMultiDelegate | 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) | ChunkDownloader.h | |
| OnDownloadAnalytics | TFunction< void(const FString &FileName, const FString &Url, uint64 SizeBytes, const FTimespan &DownloadTime, int32 HttpStatus)> | Called each time a download attempt finishes (success or failure). ONLY USE THIS IF YOU WANT TO PASSIVELY LISTEN. Downloads retry until successful. | ChunkDownloader.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bNeedsManifestSave | bool | Do we need to save the manifest (done whenever new downloads have started) | ChunkDownloader.h | |
| BuildBaseUrls | TArray< FString > | ChunkDownloader.h | ||
| CacheFolder | FString | Folders to save pak files into on disk | ChunkDownloader.h | |
| Chunks | TMap< int32, TSharedRef< FChunk > > | Chunk id to chunk record | ChunkDownloader.h | |
| ContentBuildId | FString | ChunkDownloader.h | ||
| DownloadRequests | TArray< TSharedRef< FPakFile > > | List of pak files that have been requested | ChunkDownloader.h | |
| EmbeddedFolder | FString | Content folder where we can find some chunks shipped with the build | ChunkDownloader.h | |
| EmbeddedPaks | TMap< FString, FPakFileEntry > | Pak files embedded in the build (immutable, compressed) | ChunkDownloader.h | |
| LastDeploymentName | FString | Build specific ID and URL paths | ChunkDownloader.h | |
| LoadingCompleteLatch | int32 | ChunkDownloader.h | ||
| LoadingModeStats | FStats | Cumulative stats for loading screen mode | ChunkDownloader.h | |
| ManifestRequest | TSharedPtr< IHttpRequest, ESPMode::ThreadSafe > | Manifest download request | ChunkDownloader.h | |
| MountTicker | FTSTicker::FDelegateHandle | Handle for the per-frame mount ticker in the main thread | ChunkDownloader.h | |
| PakFiles | TMap< FString, TSharedRef< FPakFile > > | Pak file name to pak file record | ChunkDownloader.h | |
| PlatformName | FString | Platform name (determines the manifest) | ChunkDownloader.h | |
| PostLoadCallbacks | TArray< FCallback > | ChunkDownloader.h | ||
| TargetDownloadsInFlight | int32 | Maximum number of downloads to allow concurrently | ChunkDownloader.h | |
| UpdateBuildCallback | FCallback | ChunkDownloader.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void BeginLoadingMode
(
const FCallback& Callback |
Snapshot stats and enter into loading screen mode (pauses all background downloads). | ChunkDownloader.h | |
void DownloadChunk
(
int32 ChunkId, |
Download all pak files in the chunk, but don't mount. | ChunkDownloader.h | |
void DownloadChunks
(
const TArray< int32 >& ChunkIds, |
Download (Cache) all pak files in these chunks then fire the callback (convenience wrapper managing multiple DownloadChunk calls) | ChunkDownloader.h | |
void Finalize () |
Unmount all chunks and cancel any downloads in progress (preserving partial downloads). | ChunkDownloader.h | |
int FlushCache () |
Flush any cached files (on disk) that are not currently being downloaded to or mounting (does not unmount the corresponding pak files). | ChunkDownloader.h | |
void GetAllChunkIds
(
TArray< int32 >& OutChunkIds |
Return a list of all chunk IDs in the current manifest | ChunkDownloader.h | |
EChunkStatus GetChunkStatus
(
int32 ChunkId |
Get the current status of the specified chunk | ChunkDownloader.h | |
const FString & GetContentBuildId() |
Get the current content build ID | ChunkDownloader.h | |
const FString & GetDeploymentName() |
Get the most recent deployment name | ChunkDownloader.h | |
const FStats & GetLoadingStats() |
Get the current loading stats (generally only useful if you're in loading mode see BeginLoadingMode) | ChunkDownloader.h | |
int32 GetNumDownloadRequests() |
Get current number of download requests, so we know whether download is in progress. Downlading Requests will be removed from this array in it's FDownload::OnCompleted callback. | ChunkDownloader.h | |
void Initialize
(
const FString& PlatformName, |
Initialize the download manager (populates the list of cached pak files from disk). Call only once. | ChunkDownloader.h | |
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) | ChunkDownloader.h | |
void MountChunk
(
int32 ChunkId, |
Download all pak files, then asynchronously mount them in order (in order among themselves, async with game thread). | ChunkDownloader.h | |
void MountChunks
(
const TArray< int32 >& ChunkIds, |
Download and mount all chunks then fire the callback (convenience wrapper managing multiple MountChunk calls) | ChunkDownloader.h | |
void UpdateBuild
(
const FString& DeploymentName, |
Set the the content build id if the content build id has changed, we pull the new BuildManifest from CDN and load it. | ChunkDownloader.h | |
int ValidateCache () |
Validate all fully cached files (blocking) by attempting to read them and check their Version hash. | ChunkDownloader.h |
Protected
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool CheckFileSha1Hash
(
const FString& FullPathOnDisk, |
ChunkDownloader.h | ||
static const TCHAR * ChunkStatusToString
(
EChunkStatus Status |
Chunk status as logable string | ChunkDownloader.h | |
static void DumpLoadedChunks() |
ChunkDownloader.h | ||
static TSharedPtr< FChunkDownloader > Get() |
Static getters | ChunkDownloader.h | |
static TSharedRef< FChunkDownloader > GetChecked() |
ChunkDownloader.h | ||
static TSharedRef< FChunkDownloader > GetOrCreate() |
ChunkDownloader.h | ||
static void Shutdown() |
ChunkDownloader.h |