UOnlineHotfixManager

This class manages the downloading and application of hotfix data Hotfix data is a set of non-executable files downloaded and applied to the game.

Windows
MacOS
Linux

Inheritance Hierarchy

UObjectBase

UObjectBaseUtility

UObject

UOnlineHotfixManager

References

Module

Hotfix

Header

/Engine/Plugins/Online/OnlineFramework/Source/Hotfix/Public/OnlineHotfixManager.h

Include

#include "OnlineHotfixManager.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)(Config=Engine)
class UOnlineHotfixManager : public UObject

Remarks

This class manages the downloading and application of hotfix data Hotfix data is a set of non-executable files downloaded and applied to the game. The base implementation knows how to handle INI, PAK, and locres files.

Each INI/PAK file must be prefixed by the platform name they are targeted at

Variables

Name Description

Public variable UProperty Transient

TArray< UObject...

 

AssetsHotfixedFromIniFiles

Array of objects that we're forcing to remain resident because we've applied live hotfixes and won't get an opportunity to reapply changes if the object is evicted from memory.

Public variable

bool

 

bHotfixingInProgress

Some title file interfaces aren't re-entrant so handle it ourselves

Public variable

bool

 

bHotfixNeedsMapReload

Set to true if any PAK file contains an update to a level that is currently loaded

Public variable

bool

 

bLogMountedPakContents

Whether we want to log all of the files that are in a mounted pak file or not

Public variable

TArray< FCloudF...

 

ChangedHotfixFileList

The set of hotfix files that have changed from the last time we applied them

Public variable

uint32

 

ChangedOrRemovedPakCount

If we have removed or changed a currently mounted PAK file, then we'll need to restart the app because there's no simple undo for objects that were loaded and possibly rooted

Public variable UProperty Config

FString

 

DebugPrefix

Used to prevent development work from interfering with playtests, etc.

Public variable

FString

 

DefaultPrefix

Normally will be "Default" but could be different if we have a debug prefix

Public variable

FString

 

GameContentPath

Holds a chunk of string that will be swapped for Game during processing pak files (MyGame/Content/Maps -> /Game/Maps)

Public variable

TArray< FCloudF...

 

HotfixFileList

The filtered list of files that are part of the hotfix

Public variable UProperty Config

FString

 

HotfixManagerClassName

Tells the factory method which class to contruct

Public variable

TArray< FConfig...

 

IniBackups

Backup copies of INI files that change during hotfixing so they can be undone afterward

Public variable

TArray< FCloudF...

 

LastHotfixFileList

The last set of hotfix files that was applied so we can determine whether we are up to date or not

Public variable

TArray< FString...

 

MountedPakFiles

Holds which files have been mounted for unmounting

Public variable

uint64

 

NumBytes

Public variable

uint32

 

NumDownloaded

Protected variable

FOnEnumerateFil...

 

OnEnumerateFilesCompleteDelegate

Callbacks for when the title file interface is done

Protected variable

FDelegateHandle

 

OnEnumerateFilesCompleteDelegateHandle

Protected variable

FDelegateHandle

 

OnEnumerateFilesForAvailabilityCompleteDelegateHandle

Public variable

FOnHotfixComple...

 

OnHotfixCompleteDelegates

Delegate fired when the hotfix process has completed

Public variable

FOnHotfixProces...

 

OnHotfixProcessedFileDelegates

Delegate fired as the hotfix files are applied

Public variable

FOnHotfixProgre...

 

OnHotfixProgressDelegates

Delegate fired as the hotfix files are read

Protected variable

IOnlineTitleFil...

 

OnlineTitleFile

The online interface to use for downloading the hotfix files

Protected variable

FOnReadFileComp...

 

OnReadFileCompleteDelegate

Protected variable

FDelegateHandle

 

OnReadFileCompleteDelegateHandle

Protected variable

FOnReadFileProg...

 

OnReadFileProgressDelegate

Protected variable

FDelegateHandle

 

OnReadFileProgressDelegateHandle

Public variable UProperty Config

FString

 

OSSName

Tells the hotfix manager which OSS to use. Uses the default if empty

Public variable

TWeakObjectPtr<...

 

OwnerWorld

Our passed-in World

Public variable

TMap< FString, ...

 

PendingHotfixFiles

Holds which files are pending download

Public variable

FString

 

PlatformPrefix

Used to match any PAK files for this platform

Public variable

TArray< FCloudF...

 

RemovedHotfixFileList

The set of hotfix files that have been removed from the last time we applied them

Public variable

FString

 

ServerPrefix

Used to match any server-only hotfixes

Public variable

uint64

 

TotalBytes

Tracks the size of the files being processed as part of the hotfix

Public variable

uint32

 

TotalFiles

Tracks how many files are being processed as part of the hotfix

Constructors

Name Description

Public function

UOnlineHotfixManager()

Functions

Name Description

Public function Virtual

FDelegateHan...

 

AddOnHotfixCompleteDelegate_Handle

(
    const FOnHotfixCompleteDelegate& D...
)

Public function Virtual

FDelegateHan...

 

AddOnHotfixProcessedFileDelegate_Handle

(
    const FOnHotfixProcessedFileDelegat...
)

Public function Virtual

FDelegateHan...

 

AddOnHotfixProgressDelegate_Handle

(
    const FOnHotfixProgressDelegate& D...
)

Public function

void

 

ApplyHotfix()

Looks at each file returned via the hotfix and processes them

Protected function Virtual

bool

 

ApplyHotfixProcessing

(
    const FCloudFileHeader& FileHeader
)

Called when a file needs custom processing (see above).

Public function

FConfigFileB...

 

BackupIniFile

(
    const FString& IniName,
    const FConfigFile* ConfigFile
)

Stores off the INI file for restoration later

Public function

void

 

BuildHotfixFileListDeltas()

Builds the list of files that are different between two runs of the hotfix process

Public function Virtual

void

 

CheckAvailability

(
    FOnHotfixAvailableComplete& InComp...
)

Check for available hotfix files (but do not apply them)

Public function Virtual

void

 

Cleanup()

Public function Virtual

void

 

ClearOnHotfixCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnHotfixCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnHotfixProcessedFileDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnHotfixProcessedFileDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnHotfixProgressDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnHotfixProgressDelegates

(
    void* Object
)

Public function

void

 

FilterHotfixFiles()

Checks each file listed to see if it is a hotfix file to process

Public function Static

UOnlineHotfi...

 

Get

(
    UWorld* World
)

Factory method that returns the configured hotfix manager

Protected function Virtual

FString

 

GetCachedDirectory()

Override this to change the default caching directory

Public function

FConfigFile ...

 

GetConfigFile

(
    const FString& IniName
)

Public function

FString

 

GetConfigFileNamePath

(
    const FString& IniName
)

Protected function

FCloudFileHe...

 

GetFileHeaderFromDLName

(
    const FString& FileName
)

Finds the header associated with the file name

Public function Const

const FStrin...

 

GetFriendlyNameFromDLName

(
    const FString& DLName
)

Public function Virtual

FString

 

GetStrippedConfigFileName

(
    const FString& IniName
)

Public function Const

UWorld *

 

GetWorld()

Protected function Virtual

bool

 

HotfixIniFile

(
    const FString& FileName,
    const FString& IniData
)

Override this to change the default INI file handling (merge delta INI changes into the config cache)

Protected function Virtual

bool

 

HotfixPakFile

(
    const FCloudFileHeader& FileHeader
)

Override this to change the default PAK file handling:

Protected function Virtual

bool

 

HotfixPakIniFile

(
    const FString& FileName
)

Override this to change the default INI file handling (merge whole INI files into the config cache)

Protected function

void

 

HotfixRowUpdate

(
    UObject* Asset,
    const FString& AssetPath,
    const FString& RowName,
    const FString& ColumnName,
    const FString& NewValue,
    TArray< FString >& ProblemStrings
)

Used in PatchAssetsFromIniFiles to hotfix only a row in a table.

Protected function

void

 

HotfixTableUpdate

(
    UObject* Asset,
    const FString& AssetPath,
    const FString& JsonData,
    TArray< FString >& ProblemStrings
)

Used in PatchAssetsFromIniFiles to hotfix an entire table.

Public function Virtual

void

 

Init()

Public function

bool

 

IsMapLoaded

(
    const FString& MapName
)

Public function

void

 

OnEnumerateFilesComplete

(
    bool bWasSuccessful,
    const FString& ErrorStr
)

Called once the list of hotfix files has been retrieved

Public function

void

 

OnEnumerateFilesForAvailabilityComplete

(
    bool bWasSuccessful,
    const FString& ErrorStr,
    FOnHotfixAvailableComplete InComple...
)

Called once the list of hotfix files has been retrieved and we only want to see if a hotfix is necessary

Protected function Virtual

void

 

OnHotfixAvailablityCheck

(
    const TArray< FCloudFileHeader >& ...,
    const TArray< FCloudFileHeader >& ...
)

Notify used by CheckAvailability()

Protected function Virtual

void

 

OnHotfixTableValueDouble

(
    UObject& Asset,
    const FString& RowName,
    const FString& ColumnName,
    const double& OldValue,
    const double& NewValue
)

Protected function Virtual

void

 

OnHotfixTableValueFloat

(
    UObject& Asset,
    const FString& RowName,
    const FString& ColumnName,
    const float& OldValue,
    const float& NewValue
)

Protected function Virtual

void

 

OnHotfixTableValueInt64

(
    UObject& Asset,
    const FString& RowName,
    const FString& ColumnName,
    const int64& OldValue,
    const int64& NewValue
)

Called after modifying table values by HotfixRowUpdate()

Protected function Virtual

void

 

OnHotfixTableValueName

(
    UObject& Asset,
    const FString& RowName,
    const FString& ColumnName,
    const FName& OldValue,
    const FName& NewValue
)

Protected function Virtual

void

 

OnHotfixTableValueObject

(
    UObject& Asset,
    const FString& RowName,
    const FString& ColumnName,
    const UObject* OldValue,
    const UObject* NewValue
)

Protected function Virtual

void

 

OnHotfixTableValueString

(
    UObject& Asset,
    const FString& RowName,
    const FString& ColumnName,
    const FString& OldValue,
    const FString& NewValue
)

Public function

void

 

OnReadFileComplete

(
    bool bWasSuccessful,
    const FString& FileName
)

Called as files are downloaded to determine when to apply the hotfix data

Public function

void

 

OnReadFileProgress

(
    const FString& FileName,
    uint64 BytesRead
)

Called as files are downloaded to provide progress notifications

Protected function Virtual

void

 

PatchAssetsFromIniFiles()

Called after any hotfixes are applied to apply last-second changes to certain asset types from .ini file data

Protected function Virtual Const

bool

 

PreProcessDownloadedFileData

(
    TArray< uint8 >& FileData
)

Called prior to reading the file data.

Public function

void

 

ReadHotfixFiles()

Starts the async reading process for the hotfix files

Public function

void

 

RestoreBackupIniFiles()

Restores any changed INI files to their default loaded state

Protected function Virtual Const

bool

 

ShouldWarnAboutMissingWhenPatchingFromIni

(
    const FString& AssetPath
)

Public function Virtual UFunction BlueprintCallable, Category

void

 

StartHotfixProcess()

Starts the fetching of hotfix data from the OnlineTitleFileInterface that is registered for this game

Public function

void

 

TriggerHotfixComplete

(
    EHotfixResult HotfixResult
)

Cleans up and fires the delegate indicating it's done

Public function Virtual

void

 

TriggerOnHotfixCompleteDelegates

(
    EHotfixResult Param1
)

Public function Virtual

void

 

TriggerOnHotfixProcessedFileDelegates

(
    const FString& Param1,
    const FString& Param2
)

Public function Virtual

void

 

TriggerOnHotfixProgressDelegates

(
    uint32 Param1,
    uint32 Param2,
    uint64 Param3,
    uint64 Param4
)

Public function

void

 

UnmountHotfixFiles()

Unmounts any changed PAK files so they can be re-mounted after downloading

Protected function

void

 

UpdateProgress

(
    uint32 FileCount,
    uint64 UpdateSize
)

Fires the progress delegate with our updated progress

Protected function Virtual

bool

 

WantsHotfixProcessing

(
    const FCloudFileHeader& FileHeader
)

Override this method to look at the file information for any game specific hotfix processing

Overridden from UObject

Name Description

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Classes

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