LootLocker Unity SDK 8.0.0
Game backend SDK for Unity
Loading...
Searching...
No Matches
Presence

Detailed Description

Track when and how players are active across all platforms in real time.

Basic Presence records session start/end times, automatically computing CCU (concurrent users) and session length. Rich Presence (available to select customers) extends this with developer-defined per-session player statuses (e.g., Main Menu, Level 3) that produce a detailed activity timeline per session — useful for analytics, live-ops, and player support.

See the LootLocker documentation.

Function Documentation

◆ ForceStartPresenceConnection()

static void LootLocker.Requests.LootLockerSDKManager.ForceStartPresenceConnection ( LootLockerPresenceCallback  onComplete = null,
string  forPlayerWithUlid = null 
)
inlinestatic

Force start the Presence WebSocket connection manually.

This will override the automatic presence management and manually establish a connection. Use this when you need precise control over presence connections, otherwise let the SDK auto-manage.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Parameters
onCompleteCallback indicating whether the connection and authentication succeeded
forPlayerWithUlidOptional: Execute the request for the specified player. If not supplied, the default player will be used.

◆ ForceStopAllPresenceConnections()

static void LootLocker.Requests.LootLockerSDKManager.ForceStopAllPresenceConnections ( )
inlinestatic

Force stop all Presence WebSocket connections manually.

This will override the automatic presence management and disconnect all active connections. Use this when you need to immediately disconnect all presence connections.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

◆ ForceStopPresenceConnection()

static void LootLocker.Requests.LootLockerSDKManager.ForceStopPresenceConnection ( LootLockerPresenceCallback  onComplete = null,
string  forPlayerWithUlid = null 
)
inlinestatic

Force stop the Presence WebSocket connection manually.

This will override the automatic presence management and manually disconnect. Use this when you need precise control over presence connections, otherwise let the SDK auto-manage.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Parameters
onCompleteOptional callback indicating whether the disconnection succeeded
forPlayerWithUlidOptional: Execute the request for the specified player. If not supplied, the default player will be used.

◆ GetCurrentPresenceStatus()

static string LootLocker.Requests.LootLockerSDKManager.GetCurrentPresenceStatus ( string  forPlayerWithUlid = null)
inlinestatic

Get the last status that was sent for a specific player.

NOTE: To use this the rich presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Parameters
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.
Returns
The last sent status string, or null if no client is found or no status has been sent

◆ GetPresenceConnectionState()

static LootLockerPresenceConnectionState LootLocker.Requests.LootLockerSDKManager.GetPresenceConnectionState ( string  forPlayerWithUlid = null)
inlinestatic

Get the current Presence connection state for a specific player.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Parameters
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.
Returns
The current connection state

◆ GetPresenceConnectionStats()

static LootLockerPresenceConnectionStats LootLocker.Requests.LootLockerSDKManager.GetPresenceConnectionStats ( string  forPlayerWithUlid)
inlinestatic

Get statistics about the Presence connection for a specific player.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Parameters
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.
Returns
Connection statistics

◆ IsPresenceAutoConnectEnabled()

static bool LootLocker.Requests.LootLockerSDKManager.IsPresenceAutoConnectEnabled ( )
inlinestatic

Check if automatic presence connections are enabled.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Returns
True if auto-connect is enabled, false otherwise

◆ IsPresenceAutoDisconnectOnFocusChangeEnabled()

static bool LootLocker.Requests.LootLockerSDKManager.IsPresenceAutoDisconnectOnFocusChangeEnabled ( )
inlinestatic

Check if automatic presence disconnection on focus change is enabled.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Returns
True if auto-disconnect on focus change is enabled, false otherwise

◆ IsPresenceConnected()

static bool LootLocker.Requests.LootLockerSDKManager.IsPresenceConnected ( string  forPlayerWithUlid = null)
inlinestatic

Check if Presence is connected and authenticated for a specific player.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Parameters
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.
Returns
True if connected and active, false otherwise

◆ IsPresenceEnabled()

static bool LootLocker.Requests.LootLockerSDKManager.IsPresenceEnabled ( )
inlinestatic

Check if presence system is currently enabled.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Returns
True if enabled, false otherwise

◆ ListPresenceConnections()

static IEnumerable< string > LootLocker.Requests.LootLockerSDKManager.ListPresenceConnections ( )
inlinestatic

Get a list of player ULIDs that currently have active Presence connections.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Returns
Collection of player ULIDs that have active presence connections

◆ SetPresenceAutoConnectEnabled()

static void LootLocker.Requests.LootLockerSDKManager.SetPresenceAutoConnectEnabled ( bool  enabled)
inlinestatic

Enable or disable automatic presence connection when sessions start.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Parameters
enabledWhether to auto-connect presence

◆ SetPresenceAutoDisconnectOnFocusChangeEnabled()

static void LootLocker.Requests.LootLockerSDKManager.SetPresenceAutoDisconnectOnFocusChangeEnabled ( bool  enabled)
inlinestatic

Enable or disable automatic presence disconnection when the application loses focus or is paused.

When enabled, presence connections will automatically disconnect when the app goes to background and reconnect when it returns to foreground. Useful for saving battery on mobile or managing resources.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Parameters
enabledTrue to enable auto-disconnect on focus change, false to disable

◆ SetPresenceEnabled()

static void LootLocker.Requests.LootLockerSDKManager.SetPresenceEnabled ( bool  enabled)
inlinestatic

Enable or disable the entire Presence system.

NOTE: To use this the presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Parameters
enabledWhether to enable presence

◆ UpdatePresenceStatus()

static void LootLocker.Requests.LootLockerSDKManager.UpdatePresenceStatus ( string  status,
Dictionary< string, string >  metadata = null,
Action< bool >  onComplete = null,
string  forPlayerWithUlid = null 
)
inlinestatic

Update the player's presence status.

NOTE: To use this the rich presence feature must be enabled for your game. Contact LootLocker support if you need assistance.

Parameters
statusThe status to set (e.g., "online", "in_game", "away")
metadataOptional metadata to include with the status
onCompleteCallback for the result of the operation
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

Functions

static void LootLocker.Requests.LootLockerSDKManager.ForceStartPresenceConnection (LootLockerPresenceCallback onComplete=null, string forPlayerWithUlid=null)
 Force start the Presence WebSocket connection manually.
 
static void LootLocker.Requests.LootLockerSDKManager.ForceStopPresenceConnection (LootLockerPresenceCallback onComplete=null, string forPlayerWithUlid=null)
 Force stop the Presence WebSocket connection manually.
 
static void LootLocker.Requests.LootLockerSDKManager.ForceStopAllPresenceConnections ()
 Force stop all Presence WebSocket connections manually.
 
static IEnumerable< string > LootLocker.Requests.LootLockerSDKManager.ListPresenceConnections ()
 Get a list of player ULIDs that currently have active Presence connections.
 
static void LootLocker.Requests.LootLockerSDKManager.UpdatePresenceStatus (string status, Dictionary< string, string > metadata=null, Action< bool > onComplete=null, string forPlayerWithUlid=null)
 Update the player's presence status.
 
static LootLockerPresenceConnectionState LootLocker.Requests.LootLockerSDKManager.GetPresenceConnectionState (string forPlayerWithUlid=null)
 Get the current Presence connection state for a specific player.
 
static bool LootLocker.Requests.LootLockerSDKManager.IsPresenceConnected (string forPlayerWithUlid=null)
 Check if Presence is connected and authenticated for a specific player.
 
static LootLockerPresenceConnectionStats LootLocker.Requests.LootLockerSDKManager.GetPresenceConnectionStats (string forPlayerWithUlid)
 Get statistics about the Presence connection for a specific player.
 
static string LootLocker.Requests.LootLockerSDKManager.GetCurrentPresenceStatus (string forPlayerWithUlid=null)
 Get the last status that was sent for a specific player.
 
static void LootLocker.Requests.LootLockerSDKManager.SetPresenceEnabled (bool enabled)
 Enable or disable the entire Presence system.
 
static bool LootLocker.Requests.LootLockerSDKManager.IsPresenceEnabled ()
 Check if presence system is currently enabled.
 
static void LootLocker.Requests.LootLockerSDKManager.SetPresenceAutoConnectEnabled (bool enabled)
 Enable or disable automatic presence connection when sessions start.
 
static bool LootLocker.Requests.LootLockerSDKManager.IsPresenceAutoConnectEnabled ()
 Check if automatic presence connections are enabled.
 
static void LootLocker.Requests.LootLockerSDKManager.SetPresenceAutoDisconnectOnFocusChangeEnabled (bool enabled)
 Enable or disable automatic presence disconnection when the application loses focus or is paused.
 
static bool LootLocker.Requests.LootLockerSDKManager.IsPresenceAutoDisconnectOnFocusChangeEnabled ()
 Check if automatic presence disconnection on focus change is enabled.