bAutoLoginAtStartup

bAutoLoginAtStartup

#Overview

name: bAutoLoginAtStartup

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 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bAutoLoginAtStartup is to control whether the Null Online Subsystem should automatically log in the first user at startup, simulating the behavior of single-user platforms.

This setting variable is primarily used in the Null Online Subsystem, which is part of Unreal Engine’s online functionality modules. It’s specifically utilized in the OnlineSubsystemNull plugin, which provides a mock implementation of online services for testing and development purposes.

The value of this variable is set in multiple places:

  1. It’s initialized to true by default in the FOnlineSubsystemNull class.
  2. It can be modified through a console variable “OSSNull.AutoLoginAtStartup”.
  3. It’s read from the configuration file (GEngineIni) under the “OnlineSubsystemNull” section.

This variable interacts with other configuration variables in the Null Online Subsystem, such as bSupportExternalUI, bRequireShowLoginUI, and others, which collectively define the behavior of the mock online system.

Developers should be aware that:

  1. This variable affects the automatic login behavior of the Null Online Subsystem.
  2. Changing this variable can impact how the online subsystem behaves during testing and development.
  3. It’s part of a suite of configuration options for the Null Online Subsystem that can be used to emulate different platform behaviors.

Best practices when using this variable include:

  1. Use it in conjunction with other Null Online Subsystem settings to accurately simulate the desired online environment for testing.
  2. Be aware of its impact on the login flow when testing multiplayer or online features.
  3. Consider setting it explicitly in configuration files or through console variables to ensure consistent behavior across different development environments.
  4. Document any custom settings used during development to aid in reproducing specific test scenarios.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:2315, section: [OnlineSubsystemNull]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemNull/Source/Private/OnlineIdentityNull.cpp:340

Scope (from outer to inner):

file
function     FOnlineIdentityNull::FOnlineIdentityNull

Source code excerpt:

	: NullSubsystem(InSubsystem)
{	
	if (FOnlineSubsystemNull::bAutoLoginAtStartup)
	{
		// autologin the 0-th player
		Login(0, FOnlineAccountCredentials(TEXT("DummyType"), TEXT("DummyUser"), TEXT("DummyId")) );
	}
}

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemNull/Source/Private/OnlineSubsystemNull.cpp:202

Scope: file

Source code excerpt:

// Declares console variables that modify how OSS null works so it can emulate different platforms for testing. These are also loaded from [OnlineSubsystemNull]

bool FOnlineSubsystemNull::bAutoLoginAtStartup = true;
FAutoConsoleVariableRef CVarAutoLoginAtStartup(
	TEXT("OSSNull.AutoLoginAtStartup"),
	FOnlineSubsystemNull::bAutoLoginAtStartup,
	TEXT("True if it should login the first user at startup like single-user platforms, false to only login when requested"),
	ECVF_Default | ECVF_Cheat);

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemNull/Source/Private/OnlineSubsystemNull.cpp:276

Scope (from outer to inner):

file
function     bool FOnlineSubsystemNull::Init

Source code excerpt:

			// Read configuration variables once for emulating other login systems, cvars can override in PIE
			bLoadedConfig = true;
			GConfig->GetBool(TEXT("OnlineSubsystemNull"), TEXT("bAutoLoginAtStartup"), bAutoLoginAtStartup, GEngineIni);
			GConfig->GetBool(TEXT("OnlineSubsystemNull"), TEXT("bSupportExternalUI"), bSupportExternalUI, GEngineIni);
			GConfig->GetBool(TEXT("OnlineSubsystemNull"), TEXT("bRequireShowLoginUI"), bRequireShowLoginUI, GEngineIni);
			GConfig->GetBool(TEXT("OnlineSubsystemNull"), TEXT("bForceShowLoginUIUserChange"), bForceShowLoginUIUserChange, GEngineIni);
			GConfig->GetBool(TEXT("OnlineSubsystemNull"), TEXT("bRequireLoginCredentials"), bRequireLoginCredentials, GEngineIni);
			GConfig->GetBool(TEXT("OnlineSubsystemNull"), TEXT("bAddUserNumToNullId"), bAddUserNumToNullId, GEngineIni);
			GConfig->GetBool(TEXT("OnlineSubsystemNull"), TEXT("bForceStableNullId"), bForceStableNullId, GEngineIni);

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemNull/Source/Public/OnlineSubsystemNull.h:102

Scope (from outer to inner):

file
class        class FOnlineSubsystemNull : public FOnlineSubsystemImpl

Source code excerpt:


	/** True if it should login the first user at startup like single-user platforms, false to only login when requested */
	static bool bAutoLoginAtStartup;

	/** True if it should support an external UI interface */
	static bool bSupportExternalUI;

	/** True if login requires calling ShowLoginUI on the externalUI, depends on SupportExternalUI */
	static bool bRequireShowLoginUI;