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

Detailed Description

Set up and configure the SDK before starting a session.

Call LootLockerSDKManager.Init() once at game startup, or rely on the LootLocker Settings asset configured in Edit → Project Settings → LootLocker SDK./// See the LootLocker documentation.

Function Documentation

◆ CheckInitialized()

static bool LootLocker.Requests.LootLockerSDKManager.CheckInitialized ( bool  skipSessionCheck = false,
string  forPlayerWithUlid = null 
)
inlinestatic

Utility function to check if the sdk has been initialized.

Parameters
skipSessionCheckOptional : When true, skips the check for an active session token. Useful when calling SDK methods that don't require a session.
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.
Returns
True if initialized, false otherwise.

◆ Init()

static bool LootLocker.Requests.LootLockerSDKManager.Init ( string  apiKey,
string  gameVersion,
string  domainKey,
LootLockerLogger::LogLevel  logLevel = LootLockerLogger::LogLevel::Info,
bool  logInBuilds = false,
bool  errorsAsWarnings = false,
bool  allowTokenRefresh = true,
bool  prettifyJson = false,
bool  obfuscateLogs = true,
bool  enablePresence = false,
bool  enablePresenceAutoConnect = true,
bool  enablePresenceAutoDisconnectOnFocusChange = false,
bool  enablePresenceInEditor = true 
)
inlinestatic

Manually initialize the SDK.

Parameters
apiKeyFind the Game API-key at https://console.lootlocker.com/settings/api-keys and click on the API-tab
gameVersionThe current version of the game in the format 1.2.3.4 (the 3 and 4 being optional but recommended)
domainKeyExtra key needed for some endpoints, can be found by going to https://console.lootlocker.com/settings/api-keys and click on the API-tab
logLevelWhat log level to use for the SDKs internal logging
logInBuildsIf true, logs will also be printed in builds. If false, logs will only be printed in the editor.
errorsAsWarningsIf true, errors will be logged as warnings instead of errors.
allowTokenRefreshIf true, the SDK will attempt to refresh tokens automatically.
prettifyJsonIf true, JSON logs will be prettified.
obfuscateLogsIf true, sensitive information in logs will be obfuscated.
enablePresenceIf true, presence features will be enabled.
enablePresenceAutoConnectIf true, presence will auto-connect.
enablePresenceAutoDisconnectOnFocusChangeIf true, presence will auto-disconnect on focus change.
enablePresenceInEditorIf true, presence will be enabled in the editor.
Returns
True if initialized successfully, false otherwise

Functions

static bool LootLocker.Requests.LootLockerSDKManager.Init (string apiKey, string gameVersion, string domainKey, LootLockerLogger.LogLevel logLevel=LootLockerLogger.LogLevel.Info, bool logInBuilds=false, bool errorsAsWarnings=false, bool allowTokenRefresh=true, bool prettifyJson=false, bool obfuscateLogs=true, bool enablePresence=false, bool enablePresenceAutoConnect=true, bool enablePresenceAutoDisconnectOnFocusChange=false, bool enablePresenceInEditor=true)
 Manually initialize the SDK.
 
static bool LootLocker.Requests.LootLockerSDKManager.CheckInitialized (bool skipSessionCheck=false, string forPlayerWithUlid=null)
 Utility function to check if the sdk has been initialized.