SocialUI.ForceDisconnectedToPartyService
SocialUI.ForceDisconnectedToPartyService
#Overview
name: SocialUI.ForceDisconnectedToPartyService
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Overrides the bIsConnectedToPartyService state
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of SocialUI.ForceDisconnectedToPartyService is to override the connection state to the party service within the social system of Unreal Engine. This setting variable is primarily used for debugging and testing purposes in the online party system.
This setting variable is relied upon by the Party module within the OnlineFramework plugin of Unreal Engine. Specifically, it’s used in the SocialManager class, which is part of the social and party management system.
The value of this variable is set through a console variable (CVar) named CVarForceDisconnectedToPartyService. It’s defined as a static TAutoConsoleVariable
The associated variable CVarForceDisconnectedToPartyService directly interacts with SocialUI.ForceDisconnectedToPartyService. They share the same value and purpose.
Developers must be aware that this variable is intended for debugging and testing. When set to true, it will force the party service to appear as disconnected, regardless of its actual state. This can be useful for simulating disconnection scenarios without actually disconnecting from the service.
Best practices when using this variable include:
- Only use it for debugging and testing purposes.
- Remember to reset it to false when not actively testing disconnection scenarios.
- Be cautious when using it in a production environment, as it can affect the behavior of the party system.
Regarding the associated variable CVarForceDisconnectedToPartyService:
The purpose of CVarForceDisconnectedToPartyService is to provide a console-accessible way to control the SocialUI.ForceDisconnectedToPartyService setting. It allows developers to toggle the forced disconnection state at runtime through the console.
This variable is used in the USocialManager::IsConnectedToPartyService() function to determine the connection state. When the CVar is set to true, it will cause this function to return false, simulating a disconnected state.
The value of CVarForceDisconnectedToPartyService can be set through the console or programmatically using Unreal Engine’s console variable system.
Developers should be aware that changes to this variable will immediately affect the behavior of the IsConnectedToPartyService() function, which could have wider implications on the party system’s functionality.
Best practices for using CVarForceDisconnectedToPartyService include:
- Use it in conjunction with other debugging tools to isolate and reproduce party connection issues.
- Document its usage clearly in testing procedures to ensure other team members understand when and why it’s being used.
- Consider adding safeguards in production builds to prevent accidental activation of this debug feature.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Online/OnlineFramework/Source/Party/Private/SocialManager.cpp:25
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarForceDisconnectedToPartyService(
TEXT("SocialUI.ForceDisconnectedToPartyService"),
false,
TEXT("Overrides the bIsConnectedToPartyService state"));
//////////////////////////////////////////////////////////////////////////
// FRejoinableParty
#Associated Variable and Callsites
This variable is associated with another variable named CVarForceDisconnectedToPartyService
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Online/OnlineFramework/Source/Party/Private/SocialManager.cpp:24
Scope: file
Source code excerpt:
#endif
static TAutoConsoleVariable<bool> CVarForceDisconnectedToPartyService(
TEXT("SocialUI.ForceDisconnectedToPartyService"),
false,
TEXT("Overrides the bIsConnectedToPartyService state"));
//////////////////////////////////////////////////////////////////////////
#Loc: <Workspace>/Engine/Plugins/Online/OnlineFramework/Source/Party/Private/SocialManager.cpp:1271
Scope (from outer to inner):
file
function bool USocialManager::IsConnectedToPartyService
Source code excerpt:
bool USocialManager::IsConnectedToPartyService() const
{
return bIsConnectedToPartyService && !CVarForceDisconnectedToPartyService.GetValueOnAnyThread();
}
void USocialManager::HandlePartyDisconnected(USocialParty* DisconnectingParty)
{
ABORT_DURING_SHUTDOWN();