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")
43 bool bIsEnabled = true;
46 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
47 bool bAutoConnectEnabled = true;
50 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
51 bool bAutoDisconnectOnFocusChange = true;
54 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
55 bool bEnabledInEditor = true;
70 TMap<FString, FString> Metadata;
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);
350 static
void Initialize();
354 static
void Shutdown();
365 static
void NotifyPlayerActivated(const FString& PlayerUlid);
372 static
void NotifyPlayerDeactivated(const FString& PlayerUlid);
378 static FCriticalSection InstanceLock;
Manager for LootLocker presence functionality Coordinates presence connections for multiple players/s...
Definition LootLockerPresenceManager.h:85
static bool IsAutoConnectEnabled()
Check if auto-connect is enabled.
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.
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.
virtual void BeginDestroy() override
void PauseAllConnections()
Pause all active presence connections (keeps connections alive but stops activity) Called when app go...
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.
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
Configuration structure for presence manager behavior.
Definition LootLockerPresenceManager.h:38