ClassesExcludedOnDedicatedServer

ClassesExcludedOnDedicatedServer

#Overview

name: ClassesExcludedOnDedicatedServer

The value of this variable can be defined or overridden in .ini config files. 18 .ini config files referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ClassesExcludedOnDedicatedServer is to specify a list of class names that should be excluded when cooking content for a dedicated server build in Unreal Engine 5.

This setting variable is primarily used by the Cooker subsystem, which is responsible for packaging and preparing game content for distribution. It’s part of the DeveloperToolSettings module, which provides various configuration options for development tools.

The value of this variable is set in the UCookerSettings class, which is derived from UDeveloperSettings. It’s defined as a UPROPERTY with the GlobalConfig specifier, meaning it can be configured globally in the project settings.

ClassesExcludedOnDedicatedServer interacts closely with ModulesExcludedOnDedicatedServer. Both are used together to update the list of excluded classes and modules for dedicated server builds.

Developers must be aware that changes to this variable will affect the content included in dedicated server builds. Excluding classes can reduce the size of the server build and potentially improve performance, but it may also lead to missing functionality if not carefully managed.

Best practices when using this variable include:

  1. Only exclude classes that are genuinely not needed on the server side, such as client-specific UI classes.
  2. Test thoroughly after making changes to ensure server functionality is not broken.
  3. Keep the list up-to-date as the project evolves, removing entries for classes that no longer exist or are no longer exclusion candidates.
  4. Consider the implications on networked gameplay when excluding classes.
  5. Use in conjunction with ModulesExcludedOnDedicatedServer for more comprehensive control over server content.

#Setting Variables

#References In INI files

<Workspace>/Engine/Config/BaseEngine.ini:3111, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3112, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3113, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3114, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3115, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3116, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3117, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3118, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3119, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3120, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3121, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3122, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3123, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3124, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3125, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3126, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3127, section: [/Script/UnrealEd.CookerSettings]
<Workspace>/Engine/Config/BaseEngine.ini:3128, section: [/Script/UnrealEd.CookerSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Classes/CookerSettings.h:154

Scope (from outer to inner):

file
class        class UCookerSettings : public UDeveloperSettings

Source code excerpt:

	/** List of class names to exclude when cooking for dedicated server */
	UPROPERTY(GlobalConfig, EditAnywhere, Category = Cooker, AdvancedDisplay, meta = (DisplayName = "Classes excluded when cooking for dedicated server"))
	TArray<FString> ClassesExcludedOnDedicatedServer;

	/** List of module names to exclude when cooking for dedicated server */
	UPROPERTY(GlobalConfig, EditAnywhere, Category = Cooker, AdvancedDisplay, meta = (DisplayName = "Modules excluded when cooking for dedicated server"))
	TArray<FString> ModulesExcludedOnDedicatedServer;

	/** List of class names to exclude when cooking for dedicated client */

#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Private/CookerSettings.cpp:35

Scope (from outer to inner):

file
function     void UCookerSettings::PostInitProperties

Source code excerpt:

{
	Super::PostInitProperties();
	UObject::UpdateClassesExcludedFromDedicatedServer(ClassesExcludedOnDedicatedServer, ModulesExcludedOnDedicatedServer);
	UObject::UpdateClassesExcludedFromDedicatedClient(ClassesExcludedOnDedicatedClient, ModulesExcludedOnDedicatedClient);

	// In the 'false' case, we previously deferred to the 'EnabledBlueprintsOnly' method, which is the current default, so we don't need to handle it here.
	if (bCookBlueprintComponentTemplateData)
	{
		BlueprintComponentDataCookingMethod = EBlueprintComponentDataCookingMethod::AllBlueprints;

#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Private/CookerSettings.cpp:49

Scope (from outer to inner):

file
function     void UCookerSettings::PostEditChangeProperty

Source code excerpt:

void UCookerSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
	static FName NAME_ClassesExcludedOnDedicatedServer = GET_MEMBER_NAME_CHECKED(UCookerSettings, ClassesExcludedOnDedicatedServer);
	static FName NAME_ClassesExcludedOnDedicatedClient = GET_MEMBER_NAME_CHECKED(UCookerSettings, ClassesExcludedOnDedicatedClient);

	static FName NAME_ModulesExcludedOnDedicatedServer(TEXT("ModulesExcludedOnDedicatedServer"));
	static FName NAME_ModulesExcludedOnDedicatedClient(TEXT("ModulesExcludedOnDedicatedClient"));

	static FName NAME_bCookBlueprintComponentTemplateData = GET_MEMBER_NAME_CHECKED(UCookerSettings, bCookBlueprintComponentTemplateData);

#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Private/CookerSettings.cpp:63

Scope (from outer to inner):

file
function     void UCookerSettings::PostEditChangeProperty

Source code excerpt:

			|| PropertyChangedEvent.Property->GetFName() == NAME_ModulesExcludedOnDedicatedServer)
		{
			UObject::UpdateClassesExcludedFromDedicatedServer(ClassesExcludedOnDedicatedServer, ModulesExcludedOnDedicatedServer);
		}
		else if(PropertyChangedEvent.Property->GetFName() == NAME_ClassesExcludedOnDedicatedClient
			|| PropertyChangedEvent.Property->GetFName() == NAME_ModulesExcludedOnDedicatedClient)
		{
			UObject::UpdateClassesExcludedFromDedicatedClient(ClassesExcludedOnDedicatedClient, ModulesExcludedOnDedicatedClient);
		}