bUseEAS

bUseEAS

#Overview

name: bUseEAS

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

It is referenced in 18 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bUseEAS is to control the usage of Epic Account Services (EAS) within the Unreal Engine’s Online Subsystem for Epic Online Services (EOS). Specifically:

  1. This variable is part of the Online Subsystem EOS plugin, which is responsible for integrating Epic Online Services into Unreal Engine games.

  2. The EOS subsystem and the UserManagerEOS module primarily rely on this setting variable.

  3. The value of this variable is set in the engine’s configuration files (GEngineIni) and can be modified through the project settings in the Unreal Editor.

  4. bUseEAS interacts with other variables such as bUseEOSConnect, bMirrorPresenceToEAS, and bPreferPersistentAuth. For example, if bUseEAS is false, bMirrorPresenceToEAS is automatically set to false as well.

  5. Developers must be aware that:

    • Setting bUseEAS to true enables the use of Epic Account Services for features like unified friends lists.
    • When false, certain EAS-specific functionalities will be disabled or bypassed.
    • It affects the login process, friend list management, and other online features.
  6. Best practices when using this variable:

    • Ensure it aligns with your game’s online infrastructure requirements.
    • Be consistent in its usage across different parts of your game to avoid conflicts.
    • Consider the implications on cross-platform play and account linking when enabling or disabling this feature.
    • Test thoroughly with both true and false settings to ensure your game functions correctly in both scenarios.

#Setting Variables

#References In INI files

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

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

Location: <Workspace>/Projects/Lyra/Config/Windows/Custom/EOS/WindowsEngine.ini:9, 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:138

Scope (from outer to inner):

file
function     FEOSSettings::FEOSSettings

Source code excerpt:

	, bEnableEditorOverlay(false)
	, 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:187

Scope (from outer to inner):

file
function     const FEOSSettings& UEOSSettings::ManualGetSettings

Source code excerpt:

		GConfig->GetBool(INI_SECTION, TEXT("bEnableEditorOverlay"), CachedSettings->bEnableEditorOverlay, GEngineIni);
		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

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

Scope (from outer to inner):

file
function     FEOSSettings UEOSSettings::ToNative

Source code excerpt:

	Native.bEnableEditorOverlay = bEnableEditorOverlay;
	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);

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

Scope (from outer to inner):

file
function     void UEOSSettings::PostEditChangeProperty

Source code excerpt:

	if (PropertyChangedEvent.Property->GetFName() == FName(TEXT("bUseEAS")))
	{
		if (!bUseEAS)
		{
			bMirrorPresenceToEAS = false;
		}
	}

	// Turning on presence requires EAS

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

Scope (from outer to inner):

file
function     void UEOSSettings::PostEditChangeProperty

Source code excerpt:

		if (bMirrorPresenceToEAS)
		{
			bUseEAS = true;
		}
	}

	// Turning off EAS disables presence mirroring too
	if (PropertyChangedEvent.Property->GetFName() == FName(TEXT("bUseEOSConnect")))
	{

#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
	if (!EOSSubsystem->bIsDefaultOSS && !EOSSubsystem->bIsPlatformOSS && Settings.bUseEAS)
	{
		if (Settings.bPreferPersistentAuth)
		{
			LoginViaPersistentAuth(LocalUserNum, AccountCredentials);
		}
		else

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

Scope (from outer to inner):

file
function     void FUserManagerEOS::RefreshConnectLogin

Source code excerpt:


	const FEOSSettings Settings = UEOSSettings::GetSettings();
	// In the case where bIsDefaultOSS is true, FUserManagerEOS::Login will default to using EOS_Auth_Login regardless of the value that bUseEAS is set to
	// This behaviour will be fixed as part of a wider refactor of FUserManagerEOS::Login
	const bool bShouldUseEOSAuthToken = EOSSubsystem->bIsDefaultOSS || Settings.bUseEAS;
	if (bShouldUseEOSAuthToken)
	{
		const FString AccessToken = GetAuthToken(LocalUserNum);
		if (!AccessToken.IsEmpty())
		{
			// We update the auth token cached in the user account, along with the user information

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

Scope (from outer to inner):

file
function     bool FUserManagerEOS::AutoLogin

Source code excerpt:

	FEOSSettings Settings = UEOSSettings::GetSettings();

	if (EOSSubsystem->bIsDefaultOSS && Settings.bUseEAS && AuthType.IsEmpty())
	{
		UE_LOG_ONLINE(Warning, TEXT("Unable to AutoLogin user (%d) due to missing auth command line args"), LocalUserNum);
		return false;
	}
	FOnlineAccountCredentials Creds(AuthType, LoginId, Password);

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

Scope (from outer to inner):

file
function     ELoginStatus::Type FUserManagerEOS::GetLoginStatus

Source code excerpt:

	FEOSSettings Settings = UEOSSettings::GetSettings();
	// If the user isn't using EAS, then only check for a product user id
	if (!Settings.bUseEAS)
	{
		const EOS_ProductUserId ProductUserId = UserId.GetProductUserId();
		if (ProductUserId != nullptr)
		{
			return ELoginStatus::LoggedIn;
		}

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

Scope: file

Source code excerpt:

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

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

Scope (from outer to inner):

file
class        class UEOSSettings : public URuntimeOptionsBase

Source code excerpt:

	/** Set to true to have Epic Accounts used (friends list will be unified with the default platform) */
	UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category="EOSPlus Login Settings", DisplayName="Use Epic Account for EOS login (requires account linking)")
	bool bUseEAS = false;

	/** 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 */

#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

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

Scope (from outer to inner):

file
function     bool FOnlineUserEOSPlus::ReadFriendsList
lambda-function

Source code excerpt:

		{
			// Skip reading EAS if not in use and if we errored at the platform level
			if (!UEOSSettings::GetSettings().bUseEAS || !bWasSuccessful)
			{
				CacheFriendListNetIds(LocalUserNum, ListName);

				IntermediateComplete.ExecuteIfBound(LocalUserNum, bWasSuccessful, ListName, ErrorStr);
				return;
			}

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

Scope (from outer to inner):

file
function     bool FOnlineUserEOSPlus::ReadFriendsList

Source code excerpt:


		// Skip reading EAS if not in use
		if (!UEOSSettings::GetSettings().bUseEAS)
		{
			Delegate.ExecuteIfBound(LocalUserNum, false, ListName, FString());
			return false;
		}

		// Read the EAS version

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

Scope (from outer to inner):

file
function     bool FOnlineUserEOSPlus::GetFriendsList

Source code excerpt:

	}

	if (UEOSSettings::GetSettings().bUseEAS)
	{
		Friends.Reset();
		bWasSuccessful |= EOSFriendsInterface->GetFriendsList(LocalUserNum, ListName, Friends);
		// Build the list of EOS friends
		for (TSharedRef<FOnlineFriend> Friend : Friends)
		{

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

Scope (from outer to inner):

file
function     bool FOnlineUserEOSPlus::IsFriend

Source code excerpt:

	}

	if (!bIsFriend && UEOSSettings::GetSettings().bUseEAS && NetIdPlusToEOSNetId.Contains(FriendId.ToString()))
	{
		bIsFriend = EOSFriendsInterface->IsFriend(LocalUserNum, *NetIdPlusToEOSNetId[FriendId.ToString()], ListName);
	}
	return bIsFriend;
}