XMPP
XMPP
#Overview
name: XMPP
This variable is created as a Console Variable (cvar).
- type:
Exec
- help:
Sorry: Exec commands have no help
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of XMPP is to manage the XMPP (Extensible Messaging and Presence Protocol) functionality within Unreal Engine 5. XMPP is a communication protocol for real-time messaging, presence information, and contact list maintenance.
Based on the provided callsites, the XMPP setting variable is primarily used in the XMPP module, which is part of the Online subsystem in Unreal Engine 5. It is also referenced in the NetcodeUnitTest plugin.
The value of this variable is typically set in the engine’s configuration files, specifically in the GEngineIni file. Various settings related to XMPP are retrieved using GConfig->GetBool() and GConfig->GetInt() functions.
Other variables that interact with XMPP include:
- bEnabled - Determines whether the XMPP module is enabled or not.
- bUseShortDebugString - Controls the debug string format for XMPP user JIDs.
- ThreadStackSize - Sets the stack size for XMPP connection threads.
Developers should be aware of the following when using the XMPP variable:
- The XMPP module can be conditionally compiled and loaded, as seen in the NetcodeUnitTest plugin.
- The module’s functionality can be toggled using the bEnabled setting.
- XMPP relies on the WebSockets module, which is loaded when XMPP is enabled.
- There are debug and runtime command functionalities available for XMPP.
Best practices when using the XMPP variable include:
- Ensure that the XMPP module is properly configured in the engine’s configuration files.
- Use the provided configuration options to fine-tune XMPP behavior, such as debug string formatting and thread stack size.
- Be mindful of the module’s enabled state when integrating XMPP functionality into your project.
- Utilize the runtime commands and debug features for troubleshooting and development purposes.
- Consider the implications of XMPP on network performance and security when implementing real-time communication features in your game or application.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/UnitTestCommandlet.cpp:74
Scope (from outer to inner):
file
function int32 UUnitTestCommandlet::Main
Source code excerpt:
if (FModuleManager::Get().ModuleExists(TEXT("XMPP")))
{
FModuleManager::Get().LoadModule(TEXT("XMPP"));
}
FModuleManager::Get().LoadModule(TEXT("HTTP"));
FModuleManager::Get().LoadModule(TEXT("OnlineSubsystem"));
FModuleManager::Get().LoadModule(TEXT("OnlineSubsystemUtils"));
#Loc: <Workspace>/Engine/Source/Runtime/Online/XMPP/Private/XmppConnection.cpp:121
Scope (from outer to inner):
file
function FString FXmppUserJid::ToDebugString
lambda-function
Source code excerpt:
{
bool bValue = false;
GConfig->GetBool(TEXT("XMPP"), TEXT("bUseShortDebugString"), bValue, GEngineIni);
return bValue;
}();
if (bUseShortDebugString)
{
return FString::Printf(TEXT("%s:%s"), *Id, *Resource);
#Loc: <Workspace>/Engine/Source/Runtime/Online/XMPP/Private/XmppModule.cpp:19
Scope: file
Source code excerpt:
// FXmppModule
IMPLEMENT_MODULE(FXmppModule, XMPP);
FXmppModule* FXmppModule::Singleton = nullptr;
void FXmppModule::StartupModule()
{
Singleton = this;
bEnabled = true;
GConfig->GetBool(TEXT("XMPP"), TEXT("bEnabled"), bEnabled, GEngineIni);
if (bEnabled)
{
#if WITH_XMPP_STROPHE
FXmppStrophe::Init();
FModuleManager::LoadModuleChecked<FWebSocketsModule>("WebSockets");
#Loc: <Workspace>/Engine/Source/Runtime/Online/XMPP/Private/XmppModule.cpp:657
Scope (from outer to inner):
file
function bool FXmppModule::Exec_Runtime
Source code excerpt:
{
// Ignore any execs that don't start with Xmpp
if (FParse::Command(&Cmd, TEXT("XMPP")))
{
return HandleXmppCommand( Cmd, Ar );
}
return false;
}
#Loc: <Workspace>/Engine/Source/Runtime/Online/XMPP/Private/XmppStrophe/XmppStropheThread.cpp:27
Scope (from outer to inner):
file
function FXmppStropheThread::FXmppStropheThread
Source code excerpt:
static int32 ThreadInstanceIdx = 0;
int32 StackSize = 128 * 1024;
GConfig->GetInt(TEXT("XMPP"), TEXT("ThreadStackSize"), StackSize, GEngineIni);
ThreadPtr.Reset(FRunnableThread::Create(this, *FString::Printf(TEXT("XmppConnectionThread_%d"), ThreadInstanceIdx++), StackSize, TPri_Normal));
}
FXmppStropheThread::~FXmppStropheThread()
{
if (ThreadPtr.IsValid())