UCookOnTheFlyServer

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

UnrealEd

Header

/Engine/Source/Editor/UnrealEd/Classes/CookOnTheSide/CookOnTheFlyServer.h

Include

#include "CookOnTheSide/CookOnTheFlyServer.h"

Syntax

class UCookOnTheFlyServer :
    public UObject,
    public FTickableEditorObject,
    public FExec,
    public UE::Cook::ICookInfo

Constructors

No constructors are accessible with public or protected access.

Destructors

Name Description

Public function Virtual

~UCookOnTheFlyServer()

Functions

Name Description

Public function

bool

 

BroadcastFileserverPresence

(
    const FGuid& InstanceId
)

Broadcast our the fileserver presence on the network

Public function

void

 

CancelAllQueues()

Demote all PackageDatas in any queue back to Idle, and eliminate any pending requests.

Public function

void

 

CancelCookByTheBook()

Cancel the currently running cook by the book (needs to be called from the game thread)

Public function

void

 

ClearAllCookedData()

Clear all the previously cooked data all cook requests from now on will be considered recook requests

Public function

void

 

ClearCachedCookedPlatformDataForPlatform

(
    const ITargetPlatform* TargetP...
)

Clear any cached cooked platform data for a platform call ClearCachedCookedPlatformData on all UObjects

Public function

void

 

ClearPlatformCookedData

(
    const ITargetPlatform* TargetP...
)

Clear all the previously cooked data for the platform passed in

Public function

void

 

CookerAddReferencedObjects

(
    FReferenceCollector& Ar
)

Public function

void

 

DumpStats()

Dumps cooking stats to the log run from the exec command "Cook stats"

Public function Const

ECookMode::T...

 

GetCookMode()

Public function Const

double

 

GetIdleTimeToGC()

Returns the configured amount of idle time before forcing a GC

Public function Const

uint32

 

GetPackagesPerGC()

Returns the configured number of packages to process before GC

Public function Const

uint32

 

GetPackagesPerPartialGC()

Returns the configured number of packages to process before partial GC

Public function Const

bool

 

HasExceededMaxMemory()

Public function Const

bool

 

HasRecompileShaderRequests()

Public function Const

bool

 

HasRemainingWork()

Return whether TickCookOnTheSide needs to take any action for the current session.

Public function

void

 

Initialize

(
    ECookMode::Type DesiredCookMode,
    ECookInitializationFlags InCookInit...,
    const FString& OutputDirectoryOver...
)

Initialize the CookServer so that either CookOnTheFly can be called or Cook on the side can be started and ticked

Public function Const

bool

 

IsCookByTheBookMode()

Helper function returns if we are in any cook by the book mode

Public function Const

bool

 

IsCookByTheBookRunning()

Public function Const

bool

 

IsCookingInEditor()

Is this cooker running in the editor

Public function Const

bool

 

IsCookOnTheFlyMode()

Helper function returns if we are in any cook on the fly mode

Public function Const

bool

 

IsInSession()

Report whether the CookOnTheFlyServer is in a cook session, either CookByTheBook or CookOnTheFly.

Public function Const

bool

 

IsRealtimeMode()

Is this cooker running in real time mode (where it needs to respect the timeslice)

Public function Const

bool

 

IsUsingShaderCodeLibrary()

Public function Const

bool

 

IsUsingZenStore()

Public function

void

 

MarkPackageDirtyForCooker

(
    UPackage* Package,
    bool bAllowInSession
)

Marks a package as dirty for cook causes package to be recooked on next request (and all dependent packages which are currently cooked)

Public function

void

 

MarkPackageDirtyForCookerFromSchedulerThread

(
    const FName& PackageName
)

Helper function for MarkPackageDirtyForCooker.

Public function

void

 

MaybeMarkPackageAsAlreadyLoaded

(
    UPackage* Package
)

MaybeMarkPackageAsAlreadyLoaded Mark the package as already loaded if we have already cooked the package for all requested target platforms this hints to the objects on load that we don't need to load all our bulk data

Public function Const

uint32

 

NumConnections()

Public function

void

 

OnObjectModified

(
    UObject* ObjectMoving
)

Callbacks from editor

Public function

void

 

OnObjectPropertyChanged

(
    UObject* ObjectBeingModified,
    FPropertyChangedEvent& PropertyCha...
)

Public function

void

 

OnObjectSaved

(
    UObject* ObjectSaved,
    FObjectPreSaveContext SaveContext
)

Public function

void

 

OnObjectUpdated

(
    UObject* Object
)

Public function

void

 

PostGarbageCollect()

Public function

void

 

PostLoadPackageFixup

(
    UPackage* Package,
    TArray< FName >* OutDiscovered...,
    TMap< FName, UE::Cook::FInstigator ...
)

Execute class-specific special case cook postloads and reference discovery on a given package.

Public function

void

 

PreGarbageCollect()

Callbacks from UObject globals

Public function

void

 

QueueCancelCookByTheBook()

Queue a cook by the book cancel (you might want to do this instead of calling cancel directly so that you don't have to be in the game thread when canceling

Public function

bool

 

RecompileChangedShaders

(
    const TArray< const ITargetPlatform...
)

Recompile any global shader changes if any are detected then clear the cooked platform data so that they can be rebuilt

Public function

bool

 

RequestPackage

(
    const FName& StandardPackageFName,
    const bool bForceFrontOfQueue
)

RequestPackage to be cooked This function can only be called while the cooker is in cook by the book mode

Public function

bool

 

RequestPackage

(
    const FName& StandardFileName,
    const TArrayView< const ITargetPlat...,
    const bool bForceFrontOfQueue
)

RequestPackage to be cooked

Public function

void

 

ResetCook

(
    TConstArrayView< TPair< const ITarg...
)

Clear platforms' explored flags for all PackageDatas and optionally clear the cookresult flags.

Public function

void

 

ShutdownCookOnTheFly()

Shutdown cook on the fly server

Public function

void

 

StartCookByTheBook

(
    const FCookByTheBookStartupOptions ...
)

Start a cook by the book session Cook on the fly can't run at the same time as cook by the book

Public function

bool

 

StartCookOnTheFly

(
    FCookOnTheFlyOptions InCookOnTheFly...
)

Initialize cook on the fly server

Public function

void

 

StopAndClearCookedData()

Force stop whatever pending cook requests are going on and clear all the cooked data

Public function

uint32

 

TickCookOnTheSide

(
    const float TimeSlice,
    uint32& CookedPackagesCount,
    ECookTickFlags TickFlags
)

Handles cook package requests until there are no more requests, then returns

Public function

void

 

TickRecompileShaderRequests()

Process any shader recompile requests

Public function

void

 

WaitForRequests

(
    int TimeoutMs
)

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Overridden from FTickableObjectBase

Name Description

Public function Virtual Const

TStatId

 

GetStatId()

FTickableEditorObject interface used by cook on the side

Public function Virtual Const

bool

 

IsTickable()

Virtual that can be overloaded by the inheriting class.

Public function Virtual

void

 

Tick

(
    float DeltaTime
)

Pure virtual that must be overloaded by the inheriting class.

Overridden from FExec

Name Description

Public function Virtual

bool

 

Exec

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

FExec interface used in the editor

Overridden from ICookInfo

Name Description

Public function Virtual

UE::Cook::FI...

 

GetInstigator

(
    FName PackageName
)

ICookInfo interface

Public function Virtual

TArray< UE::...

 

GetInstigatorChain

(
    FName PackageName
)

Return the chain of instigators that caused the package to be requested by the cook.

Classes

Enums

Typedefs

Name

Description

FIniSettingContainer

Tmap of the Config name, Section name, Key name, to the value

Deprecated Functions

Name Description

Public function

void

 

ClearCachedCookedPlatformDataForPlatform

(
    const FName& PlatformName
)

Use version that takes const ITargetPlatform* instead

Public function

void

 

ClearPlatformCookedData

(
    const FString& PlatformName
)

Use version that takes const ITargetPlatform* instead

Public function Const

uint64

 

GetMaxMemoryAllowance()

Use HasExceededMaxMemory instead

Public function Const

TArray< UPac...

 

GetUnsolicitedPackages

(
    const TArray< const ITargetPlatform...
)

Unsolicited packages are now added directly to the savequeue and are not marked as unsolicited

Public function Const

bool

 

HasCookRequests()

Use HasRemainingWork instead

Public function

void

 

MarkGCPackagesToKeepForCooker()

UCookOnTheFlyServer now uses FGCObject to interact with garbage collection

Public function

bool

 

RecompileChangedShaders

(
    const TArray< FName >& TargetPlatf...
)

Use version that takes const ITargetPlatform* instead

Public function

bool

 

RequestPackage

(
    const FName& StandardFileName,
    const TArrayView< const FName >& T...,
    const bool bForceFrontOfQueue
)

Use Version that takes TArray instead