ListGameFeaturePlugins

ListGameFeaturePlugins

#Overview

name: ListGameFeaturePlugins

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ListGameFeaturePlugins is to provide a console command that allows developers to list and inspect the current state of game feature plugins in the Unreal Engine 5 project. This functionality is part of the Game Features system, which enables dynamic loading and unloading of game content and functionality.

This setting variable is primarily used within the GameFeatures subsystem, specifically in the UGameFeaturesSubsystem class. It is part of the GameFeatures plugin, which is a runtime plugin for managing modular game features.

The value of this variable is not set directly, but rather it is registered as a console command in the Initialize function of the UGameFeaturesSubsystem. This means it can be invoked through the game’s console or debug interface.

The ListGameFeaturePlugins function interacts with other parts of the system, such as checking for additional command-line arguments like “-activeonly” and “-csv” to modify its output. It also uses FPlatformMisc to get system information.

Developers should be aware that this command provides a snapshot of the current state of game feature plugins. It’s a diagnostic tool that can be particularly useful during development and debugging phases.

Best practices for using this variable include:

  1. Use it regularly during development to verify the state of game feature plugins.
  2. Combine it with the “-activeonly” flag to focus on currently active plugins.
  3. Use the “-csv” option when you need to process the output programmatically or import it into spreadsheet software.
  4. Be aware that the output may vary depending on the current state of the game and which plugins are loaded or active.
  5. Use this in conjunction with other Game Features subsystem commands like “LoadGameFeaturePlugin” for a comprehensive understanding and control of the Game Features system.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/GameFeatures/Source/GameFeatures/Private/GameFeaturesSubsystem.cpp:372

Scope (from outer to inner):

file
function     void UGameFeaturesSubsystem::Initialize

Source code excerpt:


	IConsoleManager::Get().RegisterConsoleCommand(
		TEXT("ListGameFeaturePlugins"),
		TEXT("Prints game features plugins and their current state to log. (options: [-activeonly] [-csv])"),
		FConsoleCommandWithWorldArgsAndOutputDeviceDelegate::CreateUObject(this, &ThisClass::ListGameFeaturePlugins),
		ECVF_Default);

	IConsoleManager::Get().RegisterConsoleCommand(
		TEXT("LoadGameFeaturePlugin"),
		TEXT("Loads and activates a game feature plugin by PluginName or URL"),
		FConsoleCommandWithWorldArgsAndOutputDeviceDelegate::CreateLambda([](const TArray<FString>& Args, UWorld*, FOutputDevice& Ar)
		{
			if (TOptional<FString> PluginURL = UE::GameFeatures::GetPluginUrlForConsoleCommand(Args, Ar))

#Loc: <Workspace>/Engine/Plugins/Runtime/GameFeatures/Source/GameFeatures/Private/GameFeaturesSubsystem.cpp:2906

Scope (from outer to inner):

file
function     void UGameFeaturesSubsystem::ListGameFeaturePlugins

Source code excerpt:

}

void UGameFeaturesSubsystem::ListGameFeaturePlugins(const TArray<FString>& Args, UWorld* InWorld, FOutputDevice& Ar)
{
	const bool bActiveOnly = Args.ContainsByPredicate([](const FString& Arg) { return Arg.Compare(TEXT("-ACTIVEONLY"), ESearchCase::IgnoreCase) == 0; });
	const bool bCsv = Args.ContainsByPredicate([](const FString& Arg) { return Arg.Compare(TEXT("-CSV"), ESearchCase::IgnoreCase) == 0; });

	FString PlatformName = FPlatformMisc::GetCPUBrand().TrimStartAndEnd();
	Ar.Logf(TEXT("Listing Game Feature Plugins...(%s)"), *PlatformName);

#Loc: <Workspace>/Engine/Plugins/Runtime/GameFeatures/Source/GameFeatures/Public/GameFeaturesSubsystem.h:750

Scope (from outer to inner):

file
function     class GAMEFEATURES_API UGameFeaturesSubsystem : public UEngineSubsystem { GENERATED_BODY

Source code excerpt:

	bool EnumeratePluginDependenciesWithShouldActivate(const FString& PluginURL, const FString& PluginFilename, CallableT Callable) const;

	/** Handle 'ListGameFeaturePlugins' console command */
	void ListGameFeaturePlugins(const TArray<FString>& Args, UWorld* InWorld, FOutputDevice& Ar);

	enum class EObserverCallback
	{
		CheckingStatus,
		Terminating,
		Predownloading,