8#include "CoreMinimal.h"
9#include "UObject/NoExportTypes.h"
10#include "Engine/Engine.h"
11#include "LootLockerPresenceClient.h"
13#include "LootLockerPresenceManager.generated.h"
42 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
46 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
50 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
54 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
270 TMap<FString, ULootLockerPresenceClient*> PresenceClients;
273 TSet<FString> ConnectingClients;
276 TSet<FString> PausedClients;
279 mutable FCriticalSection ClientMapLock;
299 ULootLockerPresenceClient* CreatePresenceClient(const FString& PlayerUlid, const FString& SessionToken);
308 void HandleClientConnectionStateChange(const FString& PlayerUlid, ELootLockerPresenceConnectionState OldState, ELootLockerPresenceConnectionState NewState, const FString& ErrorMessage);
315 UFUNCTION(Category=
"LootLocker")
316 void HandleStartup();
319 UFUNCTION(Category=
"LootLocker")
320 void HandleShutdown();
323 UFUNCTION(Category=
"LootLocker")
324 void HandleApplicationBackground();
327 UFUNCTION(Category=
"LootLocker")
328 void HandleApplicationForeground();
335 UFUNCTION(Category=
"LootLocker")
336 void HandleConfigurationUpdated(const FString& SettingName);
378 static FCriticalSection InstanceLock;
static bool IsAutoConnectEnabled()
Check if auto-connect is enabled.
static void Initialize()
Initialize the presence manager subsystem.
void ConnectPresence(const FString &PlayerUlid, const FLootLockerPresenceCallbackDelegate &OnComplete)
Manually connect presence for a specific player.
bool IsPresenceActiveForPlayer(const FString &PlayerUlid) const
Check if presence is active for a specific player.
static void SetEnabledInEditor(bool bEnabled)
Enable or disable presence in editor.
static void SetPauseOnBackgroundEnabled(bool bEnabled)
Enable or disable pause-on-background behavior.
static void NotifyPlayerActivated(const FString &PlayerUlid)
Notify manager that a player has been activated (e.g., logged in).
void UpdateSessionToken(const FString &PlayerUlid, const FString &NewToken)
Update session token for an existing presence connection.
void PauseConnection(const FString &PlayerUlid)
Pause presence connection for a specific player.
static void Shutdown()
Shutdown and cleanup the presence manager subsystem.
virtual void BeginDestroy() override
void PauseAllConnections()
Pause all active presence connections (keeps connections alive but stops activity) Called when app go...
static ULootLockerPresenceManager * GetInstance()
Get the singleton instance of the presence manager.
void ResumeConnection(const FString &PlayerUlid)
Resume presence connection for a specific player.
FLootLockerPresenceConnectionStats GetConnectionStatsForPlayer(const FString &PlayerUlid) const
Get connection statistics for a specific player.
ELootLockerPresenceConnectionState GetPresenceStateForPlayer(const FString &PlayerUlid) const
Get connection state for a specific player.
static bool IsPauseOnBackgroundEnabled()
Check if pause-on-background is enabled.
int32 GetActiveConnectionCount() const
Get count of currently active presence connections.
static bool IsEnabledInEditor()
Check if presence is enabled in editor.
static void SetEnabled(bool bEnabled)
Enable or disable presence manager globally.
static void SetAutoConnectEnabled(bool bEnabled)
Enable or disable auto-connect behavior.
void UpdateStatus(const FString &PlayerUlid, const FString &Status, const TMap< FString, FString > &Metadata, const FLootLockerPresenceCallbackDelegate &OnComplete)
Update status for a player's presence connection.
TArray< FString > GetConnectedPlayerUlids() const
Get list of all currently connected player ULIDs.
static bool IsEnabled()
Check if presence manager is globally enabled.
void GracefullyShutdown()
Gracefully shutdown all presence connections Called during application termination.
void DisconnectAll(const FLootLockerPresenceCallbackDelegate &OnComplete)
Disconnect all active presence connections.
static void NotifyPlayerDeactivated(const FString &PlayerUlid)
Notify manager that a player has been deactivated (e.g., logged out).
void ResumeAllConnections()
Resume all paused presence connections Called when app returns to foreground, network is restored,...
ULootLockerPresenceManager()
void ConnectPresenceForAllActiveSessions(const FLootLockerPresenceCallbackDelegate &OnComplete)
Connect presence for all currently authenticated players/sessions.
void DisconnectPresence(const FString &PlayerUlid, const FLootLockerPresenceCallbackDelegate &OnComplete)
Manually disconnect presence for a specific player.
void(* FLootLockerPresenceConnectionDelegate)(const FString &, ELootLockerPresenceConnectionState, ELootLockerPresenceConnectionState, const FString &)
Delegate for presence connection state changes.
Definition LootLockerPresenceManager.h:22
void(* FLootLockerPresenceCallbackDelegate)(bool, const FString &)
Delegate for handling presence connection process callbacks.
Definition LootLockerPresenceManager.h:27
Definition LootLockerPresenceManager.h:63
FString Status
Status string to set.
Definition LootLockerPresenceManager.h:67
TMap< FString, FString > Metadata
Optional metadata key-value pairs.
Definition LootLockerPresenceManager.h:70
Configuration structure for presence manager behavior.
Definition LootLockerPresenceManager.h:38
bool bAutoConnectEnabled
Whether to auto-connect presence when sessions are established.
Definition LootLockerPresenceManager.h:47
bool bAutoDisconnectOnFocusChange
Whether to pause connections when app goes to background.
Definition LootLockerPresenceManager.h:51
bool bEnabledInEditor
Whether presence is enabled in editor.
Definition LootLockerPresenceManager.h:55
bool bIsEnabled
Whether presence connections are enabled globally.
Definition LootLockerPresenceManager.h:43