bEnablePlugin

bEnablePlugin

#Overview

name: bEnablePlugin

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

It is referenced in 5 C++ source files. Also referenced in 2 C# build files meaning it may affect the build system logic.

#Summary

#Usage in the C++ source code

The purpose of bEnablePlugin is to control the activation of specific plugins within the Unreal Engine 5 environment. It serves as a configuration flag to enable or disable functionality associated with particular plugins.

Based on the provided callsites, this variable is utilized by two Unreal Engine plugins:

  1. AndroidFileServer: This plugin is part of the Runtime category and is likely used for file management on Android devices.
  2. GooglePAD: This plugin is also in the Runtime category and appears to be related to Google Play Asset Delivery services.

The value of this variable is typically set in the plugin’s runtime settings class constructor. For AndroidFileServer, it’s set to true by default, while for GooglePAD, it’s set to false by default.

This variable interacts with other configuration variables within each plugin. For example, in AndroidFileServer, when bEnablePlugin is true, it enables the editing of bAllowNetworkConnection. In GooglePAD, it’s used in conjunction with bOnlyDistribution and bOnlyShipping to determine when the plugin should be active.

Developers must be aware that:

  1. This variable controls critical functionality for these plugins, and changing its value can significantly impact the behavior of applications using these plugins.
  2. The default values differ between plugins, so it’s essential to check the specific plugin’s documentation or source code.
  3. For GooglePAD, the variable is checked at runtime to determine if the plugin’s functionality should be initialized.

Best practices when using this variable include:

  1. Only enable the plugin when its functionality is required for the project to avoid unnecessary overhead.
  2. Ensure that when enabling the plugin, all necessary configurations and dependencies are properly set up.
  3. For GooglePAD, consider the implications of enabling the plugin only for specific build configurations (distribution or shipping).
  4. Always test the application thoroughly after changing this setting to ensure it doesn’t negatively impact performance or functionality.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:367, section: [/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/AndroidFileServer/Source/AndroidFileServerEditor/Private/AndroidFileServerRuntimeSettings.cpp:9

Scope (from outer to inner):

file
function     UAndroidFileServerRuntimeSettings::UAndroidFileServerRuntimeSettings

Source code excerpt:

UAndroidFileServerRuntimeSettings::UAndroidFileServerRuntimeSettings(const FObjectInitializer& ObjectInitializer)
        : Super(ObjectInitializer)
        , bEnablePlugin(true)
		, bAllowNetworkConnection(true)
		, SecurityToken(TEXT("[AUTO]"))
		, bIncludeInShipping(false)
		, bAllowExternalStartInShipping(false)
		, bCompileAFSProject(false)
		, bUseCompression(false)

#Loc: <Workspace>/Engine/Plugins/Runtime/AndroidFileServer/Source/AndroidFileServerEditor/Public/AndroidFileServerRuntimeSettings.h:27

Scope (from outer to inner):

file
class        class UAndroidFileServerRuntimeSettings : public UObject

Source code excerpt:

	// Enable Android FileServer for packaged builds and quick launch
	UPROPERTY(EditAnywhere, config, Category = Packaging, Meta = (DisplayName = "Use AndroidFileServer"))
	bool bEnablePlugin;

	// Allow FileServer connection using network
	UPROPERTY(EditAnywhere, config, Category = Packaging, Meta = (EditCondition = "bEnablePlugin"))
	bool bAllowNetworkConnection;

	// Optional security token required to start FileServer (leave empty to disable)

#Loc: <Workspace>/Engine/Plugins/Runtime/GooglePAD/Source/GooglePAD/Private/GooglePADFunctionLibrary.cpp:27

Scope (from outer to inner):

file
function     void UGooglePADFunctionLibrary::Initialize

Source code excerpt:

#if SUPPORTED_PLATFORM
	bool UseGooglePAD = false;
	GConfig->GetBool(TEXT("/Script/GooglePADEditor.GooglePADRuntimeSettings"), TEXT("bEnablePlugin"), UseGooglePAD, GEngineIni);

	if (UseGooglePAD)
	{
		if (JNIEnv* Env = FAndroidApplication::GetJavaEnv())
		{
			static jmethodID IsGooglePADAvailableFunc = FJavaWrapper::FindMethod(Env, FJavaWrapper::GameActivityClassID, "AndroidThunkJava_GooglePAD_Available", "()Z", false);

#Loc: <Workspace>/Engine/Plugins/Runtime/GooglePAD/Source/GooglePADEditor/Private/GooglePADRuntimeSettings.cpp:7

Scope (from outer to inner):

file
function     UGooglePADRuntimeSettings::UGooglePADRuntimeSettings

Source code excerpt:

UGooglePADRuntimeSettings::UGooglePADRuntimeSettings(const FObjectInitializer& ObjectInitializer)
        : Super(ObjectInitializer)
        , bEnablePlugin(false)
        , bOnlyDistribution(true)
		, bOnlyShipping(false)
{
}

#Loc: <Workspace>/Engine/Plugins/Runtime/GooglePAD/Source/GooglePADEditor/Public/GooglePADRuntimeSettings.h:18

Scope (from outer to inner):

file
class        class UGooglePADRuntimeSettings : public UObject

Source code excerpt:

	// Enable GooglePAD plugin
	UPROPERTY(EditAnywhere, config, Category = Packaging)
	bool bEnablePlugin;

	// Only for distribution builds
	UPROPERTY(EditAnywhere, config, Category = Packaging)
	bool bOnlyDistribution;

	// Only for shipping builds

#References in C# build files

This variable is referenced in the following C# build files:

Location: <Workspace>/Engine/Source/Programs/AutomationTool/Android/AndroidPlatform.Automation.cs:830


		ConfigHierarchy Ini = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(RawProjectPath), TargetPlatform);
		if (!Ini.GetBool("/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings", "bEnablePlugin", out bEnablePlugin))
		{
			bEnablePlugin = true;
		}
		if (!Ini.GetString("/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings", "SecurityToken", out AFSToken))
		{
			AFSToken = "";

Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/Android/UEDeployAndroid.cs:4949


					bool bUseAFS = true;
					if (!Ini.GetBool("/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings", "bEnablePlugin", out bUseAFS))
					{
						bUseAFS = true;
					}

					Ini.GetString("/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings", "SecurityToken", out string AFSToken);