bUseEOSConnect

bUseEOSConnect

#Overview

name: bUseEOSConnect

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

It is referenced in 11 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bUseEOSConnect is to enable the use of EOS Connect APIs for linking accounts and enabling cross-play functionality in Unreal Engine games integrated with Epic Online Services (EOS).

This setting variable is primarily used by the OnlineSubsystemEOS plugin, which is part of Unreal Engine’s online subsystem framework. It specifically affects the behavior of the EOS user management and authentication systems.

The value of this variable is typically set in the game’s configuration files (e.g., DefaultEngine.ini) and can be modified through the Unreal Engine editor settings. It is read from the configuration files in the UEOSSettings::ManualGetSettings() function.

bUseEOSConnect interacts with several other variables, including:

Developers should be aware that:

  1. Enabling bUseEOSConnect is necessary for using EOS Game Services, including cross-play features.
  2. When bUseEOSConnect is disabled, related features like mirroring stats and achievements to EOS are automatically disabled.
  3. Enabling certain features (e.g., mirroring stats or achievements) will automatically set bUseEOSConnect to true.

Best practices when using this variable include:

  1. Ensure that the EOS SDK is properly set up and configured before enabling this feature.
  2. Consider the implications on user privacy and data handling when enabling cross-platform account linking.
  3. Test the integration thoroughly, especially the login and account linking processes, to ensure a smooth user experience.
  4. Be aware of how this setting interacts with other EOS-related settings to avoid conflicts or unexpected behavior.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/Custom/EOS/DefaultEngine.ini:26, section: [/Script/OnlineSubsystemEOS.EOSSettings]

Location: <Workspace>/Projects/Lyra/Config/Custom/SteamEOS/DefaultEngine.ini:31, section: [/Script/OnlineSubsystemEOS.EOSSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOS/Private/EOSSettings.cpp:139

Scope (from outer to inner):

file
function     FEOSSettings::FEOSSettings

Source code excerpt:

	, bPreferPersistentAuth(false)
	, bUseEAS(false)
	, bUseEOSConnect(false)
	, bUseEOSSessions(false)
	, bMirrorStatsToEOS(false)
	, bMirrorAchievementsToEOS(false)
	, bMirrorPresenceToEAS(false)
{

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOS/Private/EOSSettings.cpp:188

Scope (from outer to inner):

file
function     const FEOSSettings& UEOSSettings::ManualGetSettings

Source code excerpt:

		GConfig->GetBool(INI_SECTION, TEXT("bPreferPersistentAuth"), CachedSettings->bPreferPersistentAuth, GEngineIni);
		GConfig->GetBool(INI_SECTION, TEXT("bUseEAS"), CachedSettings->bUseEAS, GEngineIni);
		GConfig->GetBool(INI_SECTION, TEXT("bUseEOSConnect"), CachedSettings->bUseEOSConnect, GEngineIni);
		GConfig->GetBool(INI_SECTION, TEXT("bUseEOSSessions"), CachedSettings->bUseEOSSessions, GEngineIni);
		GConfig->GetBool(INI_SECTION, TEXT("bMirrorStatsToEOS"), CachedSettings->bMirrorStatsToEOS, GEngineIni);
		GConfig->GetBool(INI_SECTION, TEXT("bMirrorAchievementsToEOS"), CachedSettings->bMirrorAchievementsToEOS, GEngineIni);
		GConfig->GetBool(INI_SECTION, TEXT("bMirrorPresenceToEAS"), CachedSettings->bMirrorPresenceToEAS, GEngineIni);
		// Artifacts explicitly skipped
		GConfig->GetArray(INI_SECTION, TEXT("TitleStorageTags"), CachedSettings->TitleStorageTags, GEngineIni);

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOS/Private/EOSSettings.cpp:220

Scope (from outer to inner):

file
function     FEOSSettings UEOSSettings::ToNative

Source code excerpt:

	Native.bPreferPersistentAuth = bPreferPersistentAuth;
	Native.bUseEAS = bUseEAS;
	Native.bUseEOSConnect = bUseEOSConnect;
	Native.bUseEOSSessions = bUseEOSSessions;
	Native.bMirrorStatsToEOS = bMirrorStatsToEOS;
	Native.bMirrorAchievementsToEOS = bMirrorAchievementsToEOS;
	Native.bMirrorPresenceToEAS = bMirrorPresenceToEAS;
	Algo::Transform(Artifacts, Native.Artifacts, &FArtifactSettings::ToNative);
	Native.TitleStorageTags = TitleStorageTags;

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOS/Private/EOSSettings.cpp:427

Scope (from outer to inner):

file
function     void UEOSSettings::PostEditChangeProperty

Source code excerpt:

	if (PropertyChangedEvent.Property->GetFName() == FName(TEXT("bUseEOSConnect")))
	{
		if (!bUseEOSConnect)
		{
			bMirrorAchievementsToEOS = false;
			bMirrorStatsToEOS = false;
			bUseEOSSessions = false;
		}
	}

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOS/Private/EOSSettings.cpp:442

Scope (from outer to inner):

file
function     void UEOSSettings::PostEditChangeProperty

Source code excerpt:

		if (bMirrorAchievementsToEOS || bMirrorStatsToEOS || bUseEOSSessions)
		{
			bUseEOSConnect = true;
		}
	}

	Super::PostEditChangeProperty(PropertyChangedEvent);
}

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOS/Private/UserManagerEOS.cpp:390

Scope (from outer to inner):

file
function     bool FUserManagerEOS::Login

Source code excerpt:


	// Are we configured to run at all?
	if (!EOSSubsystem->bIsDefaultOSS && !EOSSubsystem->bIsPlatformOSS && !Settings.bUseEAS && !Settings.bUseEOSConnect)
	{
		UE_LOG_ONLINE(Warning, TEXT("Neither EAS nor EOS are configured to be used. Failed to login in user (%d)"), LocalUserNum);
		TriggerOnLoginCompleteDelegates(LocalUserNum, false, *FUniqueNetIdEOS::EmptyId(), FString(TEXT("Not configured")));
		return true;
	}

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOS/Private/UserManagerEOS.cpp:406

Scope (from outer to inner):

file
function     bool FUserManagerEOS::Login

Source code excerpt:


	// See if we are configured to just use EOS and not EAS
	if (!EOSSubsystem->bIsDefaultOSS && !EOSSubsystem->bIsPlatformOSS && !Settings.bUseEAS && Settings.bUseEOSConnect)
	{
		// Call the EOS + Platform login path
		return ConnectLoginNoEAS(LocalUserNum, AccountCredentials);
	}

	// See if we are logging in using platform credentials to link to EAS

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOS/Public/EOSSettings.h:80

Scope: file

Source code excerpt:

	bool bPreferPersistentAuth;
	bool bUseEAS;
	bool bUseEOSConnect;
	bool bUseEOSSessions;
	bool bMirrorStatsToEOS;
	bool bMirrorAchievementsToEOS;
	bool bMirrorPresenceToEAS;
	TArray<FEOSArtifactSettings> Artifacts;
	TArray<FString> TitleStorageTags;

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOS/Public/EOSSettings.h:155

Scope (from outer to inner):

file
class        class UEOSSettings : public URuntimeOptionsBase

Source code excerpt:

	/** Set to true to have EOS Connect APIs used to link accounts for crossplay */
	UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category="EOSPlus Login Settings", DisplayName="Use EOS Connect APIs to create and link Product User IDs (PUIDs), and use EOS Game Services")
	bool bUseEOSConnect = false;

	/** Set to true to write stats to EOS as well as the default platform */
	UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category="Crossplay Settings")
	bool bMirrorStatsToEOS = false;

	/** Set to true to write achievement data to EOS as well as the default platform */

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOSPlus/Private/OnlineUserEOSPlus.cpp:512

Scope (from outer to inner):

file
function     void FOnlineUserEOSPlus::OnEOSLoginChanged

Source code excerpt:

	const FEOSSettings& EOSSettings = UEOSSettings::GetSettings();

	if (!EOSSettings.bUseEAS && !EOSSettings.bUseEOSConnect)
	{
		return;
	}

	ELoginStatus::Type LoginStatus = EOSIdentityInterface->GetLoginStatus(LocalUserNum);
	if (LoginStatus == ELoginStatus::LoggedIn)

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOSPlus/Private/OnlineUserEOSPlus.cpp:564

Scope (from outer to inner):

file
function     void FOnlineUserEOSPlus::OnBaseLoginComplete

Source code excerpt:


	const FEOSSettings& EOSSettings = UEOSSettings::GetSettings();
	const bool bForward = EOSSettings.bUseEAS || EOSSettings.bUseEOSConnect;
	if (bForward)
	{
		check(LocalUserNumToLastLoginCredentials.Contains(LocalUserNum));
		EOSIdentityInterface->Login(LocalUserNum, *LocalUserNumToLastLoginCredentials[LocalUserNum]);
	}
	else