6#include "CoreMinimal.h"
9#include "TimerManager.h"
10#include "Kismet/BlueprintAsyncActionBase.h"
11#include "LootLockerSDK/Private/Utils/LootLockerUtilities.h"
13#include "LootLockerRemoteSessionRequestHandler.generated.h"
22UENUM(BlueprintType, Category =
"LootLocker")
40UENUM(BlueprintType, Category =
"LootLocker")
60USTRUCT(BlueprintType, Category =
"LootLocker")
67 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
72 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
77 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
82 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
87 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
92 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
97 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
102 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
107 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
112 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
117 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
122 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
127 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
132 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
139USTRUCT(BlueprintType, Category =
"LootLocker")
146 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
151 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
156 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
161 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
166 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
171 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
182USTRUCT(BlueprintType, Category =
"LootLocker")
189 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
194 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
199 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
204 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
211USTRUCT(BlueprintType, Category =
"LootLocker")
218 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
223 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
228 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
233 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
237USTRUCT(BlueprintType)
241 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"LootLocker")
252USTRUCT(BlueprintType, Category =
"LootLocker")
259 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
264 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
269 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
274 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
279 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
284 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
289 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
296USTRUCT(BlueprintType, Category =
"LootLocker")
303 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
310USTRUCT(BlueprintType, Category =
"LootLocker")
317 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
322 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
327 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
334USTRUCT(BlueprintType, Category =
"LootLocker")
341 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
403 float PollingIntervalSeconds = 1.0f,
404 float TimeOutAfterMinutes = 5.0f,
405 const FString& ForPlayerWithUlid =
"",
415 const FString& TitleId,
416 const FString& EnvironmentId,
418 const FString& ForPlayerWithUlid,
419 const LLAPI<FLootLockerLeaseRemoteSessionResponse>::FResponseInspectorCallback& OnCompleteCallback,
421 static FString
StartRemoteSession(
const FString& LeaseCode,
const FString& LeaseNonce,
const LLAPI<FLootLockerStartRemoteSessionResponse>::FResponseInspectorCallback& OnCompleteCallback);
422 static void SetTimer(FTimerHandle TimerHandle,
const FTimerDelegate& BaseDelegate,
float TimeToNextPoll);
426 static TMap<FString, FLootLockerRemoteSessionProcess> RemoteSessionProcesses;
436DECLARE_DYNAMIC_MULTICAST_DELEGATE_SevenParams(FLootLockerAsyncRemoteSessionMulticastDelegate, FString, LeaseProcessID,
FLootLockerRemoteSessionLeaseData, LeaseData,
bool, HasPlayerData, FString, SessionTokenOnSuccess, FString, RefreshTokenOnSuccess,
FLootLockerRemoteSessionPlayerData, PlayerDataOnSuccess,
FLootLockerResponse, ResponseOnFailure);
468 UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly =
"true", Category =
"LootLocker Methods | Remote Session", WorldContext =
"WorldContextObject", AdvancedDisplay =
"PollingIntervalSeconds,TimeOutAfterMinutes,ForPlayerWithUlid,Provider", PollingIntervalSeconds = 1.0f, TimeOutAfterMinutes = 5.0f,
ForPlayerWithUlid =
""))
493 UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly =
"true", Category =
"LootLocker Methods | Remote Session", WorldContext =
"WorldContextObject", AdvancedDisplay =
"PollingIntervalSeconds,TimeOutAfterMinutes,ForPlayerWithUlid,Provider", PollingIntervalSeconds = 1.0f, TimeOutAfterMinutes = 5.0f,
ForPlayerWithUlid =
""))
498 UPROPERTY(BlueprintAssignable)
501 UPROPERTY(BlueprintAssignable)
504 UPROPERTY(BlueprintAssignable)
507 UPROPERTY(BlueprintAssignable)
510 UPROPERTY(BlueprintAssignable)
513 UPROPERTY(BlueprintAssignable)
516 UPROPERTY(BlueprintAssignable)
520 LOOTLOCKERSDK_API virtual
void Activate() override;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_SevenParams(FLootLockerAsyncRemoteSessionMulticastDelegate, FString, LeaseProcessID, FLootLockerRemoteSessionLeaseData, LeaseData, bool, HasPlayerData, FString, SessionTokenOnSuccess, FString, RefreshTokenOnSuccess, FLootLockerRemoteSessionPlayerData, PlayerDataOnSuccess, FLootLockerResponse, ResponseOnFailure)
Multicast Delegate for events triggered from the Async Remote Session node.
Definition LootLockerRemoteSessionRequestHandler.h:445
FLootLockerRemoteSessionLeaseData LeaseData
Definition LootLockerRemoteSessionRequestHandler.h:530
virtual void HandleLeaseProcessCompleted(const FLootLockerStartRemoteSessionResponse &LeaseProcessCompletedResponse)
FLootLockerAsyncRemoteSessionMulticastDelegate OnLeaseVerified
Triggered once the remote lease has been verified (external process).
Definition LootLockerRemoteSessionRequestHandler.h:505
FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessTimedOut
Triggered if the process times out.
Definition LootLockerRemoteSessionRequestHandler.h:511
ELootLockerRemoteSessionLeaseIntent Intent
Definition LootLockerRemoteSessionRequestHandler.h:524
FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessFinished
Triggered if the process concluded successfully.
Definition LootLockerRemoteSessionRequestHandler.h:517
FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessCancelled
Triggered if the process was canceled using the CancelRemoteSessionProcess method.
Definition LootLockerRemoteSessionRequestHandler.h:508
static ULootLockerAsyncStartRemoteSession * AsyncStartRemoteSession(UObject *WorldContextObjectfloat, float PollingIntervalSeconds, float TimeOutAfterMinutes, ELootLockerAccountProvider Provider=ELootLockerAccountProvider::Guest)
Start a remote session If you want to let your local user sign in using another device then you use t...
ELootLockerAccountProvider Provider
Definition LootLockerRemoteSessionRequestHandler.h:525
virtual void HandleLeaseProcessStarted(const FLootLockerLeaseRemoteSessionResponse &LeaseProcessStartedResponse)
FString LeaseProcessID
Definition LootLockerRemoteSessionRequestHandler.h:526
FLootLockerAsyncRemoteSessionMulticastDelegate OnLeaseClaimed
Triggered once the remote lease has been claimed (external process).
Definition LootLockerRemoteSessionRequestHandler.h:502
FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessFailed
Triggered if the process has concluded and was not a success.
Definition LootLockerRemoteSessionRequestHandler.h:514
virtual void HandleLeaseProcessUpdate(const FLootLockerRemoteSessionStatusPollingResponse &LeaseProcessUpdateResponse)
float PollingIntervalInSeconds
Definition LootLockerRemoteSessionRequestHandler.h:527
FString ForPlayerWithUlid
Definition LootLockerRemoteSessionRequestHandler.h:523
static ULootLockerAsyncStartRemoteSession * AsyncStartRemoteSessionForLinking(UObject *WorldContextObject, FString ForPlayerWithUlid, float PollingIntervalSeconds, float TimeOutAfterMinutes, ELootLockerAccountProvider Provider=ELootLockerAccountProvider::Guest)
Start a remote session with the intent to use the remote session for connecting accounts If you want ...
FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessStarted
Triggered once the lease process has successfully been started and the LeaseData property has been po...
Definition LootLockerRemoteSessionRequestHandler.h:499
virtual void Activate() override
Execute the actual operation.
float TimeoutAfterMinutes
Definition LootLockerRemoteSessionRequestHandler.h:528
ULootLockerRemoteSessionRequestHandler()
Definition LootLockerRemoteSessionRequestHandler.h:395
static void KillProcess(const FString &ProcessID)
static FString StartRemoteSession(const FString &LeaseCode, const FString &LeaseNonce, const LLAPI< FLootLockerStartRemoteSessionResponse >::FResponseInspectorCallback &OnCompleteCallback)
static FString ContinualPollingAction(const FString &ProcessID, const FLootLockerRemoteSessionStatusPollingResponseDelegate &RemoteSessionLeaseStatusUpdate=FLootLockerRemoteSessionStatusPollingResponseDelegate(), const FLootLockerStartRemoteSessionResponseDelegate &OnComplete=FLootLockerStartRemoteSessionResponseDelegate())
static void CancelRemoteSessionProcess(const FString &ProcessID)
static FString RefreshRemoteSession(const FString &RefreshToken, const FLootLockerRefreshRemoteSessionResponseDelegate &OnComplete)
static FString StartRemoteSession(ELootLockerRemoteSessionLeaseIntent Intent=ELootLockerRemoteSessionLeaseIntent::login, const FLootLockerLeaseRemoteSessionResponseDelegate &RemoteSessionLeaseInformation=FLootLockerLeaseRemoteSessionResponseDelegate(), const FLootLockerRemoteSessionStatusPollingResponseDelegate &RemoteSessionLeaseStatusUpdate=FLootLockerRemoteSessionStatusPollingResponseDelegate(), const FLootLockerStartRemoteSessionResponseDelegate &OnComplete=FLootLockerStartRemoteSessionResponseDelegate(), float PollingIntervalSeconds=1.0f, float TimeOutAfterMinutes=5.0f, const FString &ForPlayerWithUlid="", ELootLockerAccountProvider Provider=ELootLockerAccountProvider::Guest)
static void ClearTimer(FTimerHandle TimerHandle)
static FString LeaseRemoteSession(const FString &TitleId, const FString &EnvironmentId, ELootLockerRemoteSessionLeaseIntent Intent, const FString &ForPlayerWithUlid, const LLAPI< FLootLockerLeaseRemoteSessionResponse >::FResponseInspectorCallback &OnCompleteCallback, ELootLockerAccountProvider Provider=ELootLockerAccountProvider::Guest)
static void SetTimer(FTimerHandle TimerHandle, const FTimerDelegate &BaseDelegate, float TimeToNextPoll)
ELootLockerAccountProvider
Account providers possible to use for connected accounts.
Definition LootLockerConnectedAccountsRequestHandler.h:21
@ Guest
Definition LootLockerConnectedAccountsRequestHandler.h:22
void(* FLootLockerRefreshRemoteSessionResponseDelegate)(FLootLockerRefreshRemoteSessionResponse)
C++ response delegate for receiving the refreshed remote session.
Definition LootLockerRemoteSessionRequestHandler.h:366
void(* FLootLockerStartRemoteSessionResponseDelegate)(FLootLockerStartRemoteSessionResponse)
C++ response delegate for receiving the finalized remote session data (whether successful or not).
Definition LootLockerRemoteSessionRequestHandler.h:362
ELootLockerRemoteSessionLeaseIntent
Possible intents for remote sessions.
Definition LootLockerRemoteSessionRequestHandler.h:45
void(* FLootLockerRemoteSessionStatusPollingResponseDelegate)(FLootLockerRemoteSessionStatusPollingResponse)
C++ response delegate for receiving continual polling updates.
Definition LootLockerRemoteSessionRequestHandler.h:358
void(* FLootLockerLeaseRemoteSessionResponseDelegate)(FLootLockerLeaseRemoteSessionResponse)
C++ response delegate for receiving the remote session lease information.
Definition LootLockerRemoteSessionRequestHandler.h:354
ELootLockerRemoteSessionLeaseStatus
Possible entity kinds that catalog entries can have.
Definition LootLockerRemoteSessionRequestHandler.h:27
@ link
Intent is to link different providers.
Definition LootLockerRemoteSessionRequestHandler.h:53
@ login
Intent is to log in using a leased remote session.
Definition LootLockerRemoteSessionRequestHandler.h:49
@ Created
Definition LootLockerRemoteSessionRequestHandler.h:28
@ Timed_out
Definition LootLockerRemoteSessionRequestHandler.h:33
@ Verified
Definition LootLockerRemoteSessionRequestHandler.h:30
@ Claimed
Definition LootLockerRemoteSessionRequestHandler.h:29
@ Cancelled
Definition LootLockerRemoteSessionRequestHandler.h:32
@ Authorized
Definition LootLockerRemoteSessionRequestHandler.h:31
@ Failed
Definition LootLockerRemoteSessionRequestHandler.h:34
Definition LootLockerAuthenticationRequestHandler.h:420
Definition LootLockerAuthenticationRequestHandler.h:122
Request body for remote session lease (now required fields).
Definition LootLockerRemoteSessionRequestHandler.h:184
FString Title_id
The title id for the game, this is the same as the Title ID in the LootLocker dashboard.
Definition LootLockerRemoteSessionRequestHandler.h:190
FString Environment_id
The environment id for the game, this is the same as the Environment ID in the LootLocker dashboard.
Definition LootLockerRemoteSessionRequestHandler.h:195
FString Game_version
The Game Version configured for the game.
Definition LootLockerRemoteSessionRequestHandler.h:200
TArray< FString > Providers
Optional list of identity providers to restrict the remote session to (e.g., "steam",...
Definition LootLockerRemoteSessionRequestHandler.h:205
Response containing the lease codes, redirect URLs, current lease status, and intent returned when st...
Definition LootLockerRemoteSessionRequestHandler.h:254
ELootLockerRemoteSessionLeaseIntent Intent
The intent for this lease request.
Definition LootLockerRemoteSessionRequestHandler.h:290
ELootLockerRemoteSessionLeaseStatus Status
The status of this lease process.
Definition LootLockerRemoteSessionRequestHandler.h:285
FString Redirect_url
A url with the code and nonce baked in that can be used to immediately start the remote authenticatio...
Definition LootLockerRemoteSessionRequestHandler.h:270
FString Redirect_url_qr_base64
A QR code representation of the redirect_url encoded in Base64.
Definition LootLockerRemoteSessionRequestHandler.h:275
FString Code
The unique code for this leasing process, this is what identifies the leasing process and that is use...
Definition LootLockerRemoteSessionRequestHandler.h:260
FString Display_url
A clean version of the redirect_url without the code visible that you can use in your UI.
Definition LootLockerRemoteSessionRequestHandler.h:280
FString Nonce
The nonce used to sign usage of the lease code.
Definition LootLockerRemoteSessionRequestHandler.h:265
Definition LootLockerAuthenticationRequestHandler.h:406
Definition LootLockerRemoteSessionRequestHandler.h:239
FString refresh_token
Definition LootLockerRemoteSessionRequestHandler.h:242
Response containing the refreshed authentication data and a new refresh token for an existing remote ...
Definition LootLockerRemoteSessionRequestHandler.h:336
FString Refresh_token
A refresh token that can be used to refresh the remote session instead of signing in each time the se...
Definition LootLockerRemoteSessionRequestHandler.h:342
Holds the lease codes, redirect URL, Base64 QR code, and display URL needed to drive the remote sessi...
Definition LootLockerRemoteSessionRequestHandler.h:141
FString Code
The unique code for this leasing process, this is what identifies the leasing process and that is use...
Definition LootLockerRemoteSessionRequestHandler.h:147
FString Redirect_url
A url with the code and nonce baked in that can be used to immediately start the remote authenticatio...
Definition LootLockerRemoteSessionRequestHandler.h:157
FString Display_url
A clean version of the redirect_url without the code visible that you can use in your UI.
Definition LootLockerRemoteSessionRequestHandler.h:172
FString Redirect_url_qr_base64
A QR code representation of the redirect_url encoded in Base64.
Definition LootLockerRemoteSessionRequestHandler.h:162
UTexture2D * Redirect_url_qr_texture
A QR code representation of the redirect_url parsed as a Texture2D*.
Definition LootLockerRemoteSessionRequestHandler.h:167
FString Nonce
The nonce used to sign usage of the lease code.
Definition LootLockerRemoteSessionRequestHandler.h:152
Holds the player data returned when a remote session lease is successfully authorized,...
Definition LootLockerRemoteSessionRequestHandler.h:62
FString player_identifier
The player identifier of the player.
Definition LootLockerRemoteSessionRequestHandler.h:123
int32 xp
The current xp of this player.
Definition LootLockerRemoteSessionRequestHandler.h:103
FString player_name
The player's name if it has been set by using SetPlayerName().
Definition LootLockerRemoteSessionRequestHandler.h:68
FString wallet_id
The id of the wallet for this account.
Definition LootLockerRemoteSessionRequestHandler.h:133
int32 account_balance
The current balance in this account.
Definition LootLockerRemoteSessionRequestHandler.h:118
int32 player_id
The player id.
Definition LootLockerRemoteSessionRequestHandler.h:73
FLootLockerLevelThresholds level_thresholds
The level_thresholds that the level and xp data relates to.
Definition LootLockerRemoteSessionRequestHandler.h:113
int32 level
The current level of this player.
Definition LootLockerRemoteSessionRequestHandler.h:108
bool check_grant_notifications
Whether this player has new information to check in grants.
Definition LootLockerRemoteSessionRequestHandler.h:93
FString player_ulid
The player ULID for this player.
Definition LootLockerRemoteSessionRequestHandler.h:83
FString player_created_at
When this player was first created.
Definition LootLockerRemoteSessionRequestHandler.h:128
bool seen_before
Whether this player has been seen before (true) or is new (false).
Definition LootLockerRemoteSessionRequestHandler.h:88
bool check_deactivation_notifications
Whether this player has new information to check in deactivations.
Definition LootLockerRemoteSessionRequestHandler.h:98
FString public_uid
The public UID for this player.
Definition LootLockerRemoteSessionRequestHandler.h:78
FTimerHandle RemoteSessionProcessTimerHandle
Definition LootLockerRemoteSessionRequestHandler.h:384
bool ShouldCancel
Definition LootLockerRemoteSessionRequestHandler.h:383
int Retries
Definition LootLockerRemoteSessionRequestHandler.h:382
FString LeaseNonce
Definition LootLockerRemoteSessionRequestHandler.h:377
float PollingIntervalSeconds
Definition LootLockerRemoteSessionRequestHandler.h:380
FDateTime LastUpdatedAt
Definition LootLockerRemoteSessionRequestHandler.h:381
FDateTime LeasingProcessTimeoutTime
Definition LootLockerRemoteSessionRequestHandler.h:379
static constexpr int RetryLimit
Definition LootLockerRemoteSessionRequestHandler.h:375
FLootLockerRemoteSessionProcess(float _PollingIntervalSeconds, float timeOutAfterMinutes)
FString LeaseCode
Definition LootLockerRemoteSessionRequestHandler.h:376
ELootLockerRemoteSessionLeaseStatus LastUpdatedStatus
Definition LootLockerRemoteSessionRequestHandler.h:378
Response containing the current lease status of a remote session when polled during the authorization...
Definition LootLockerRemoteSessionRequestHandler.h:298
ELootLockerRemoteSessionLeaseStatus Lease_status
The current status of this lease process.
Definition LootLockerRemoteSessionRequestHandler.h:304
Base response struct — every SDK callback receives a struct that derives from this.
Definition LootLockerResponse.h:19
Request to exchange a remote session lease code and nonce for an authorized session using the game AP...
Definition LootLockerRemoteSessionRequestHandler.h:213
FString Lease_code
The lease code returned with the response when starting a lease process.
Definition LootLockerRemoteSessionRequestHandler.h:229
FString Nonce
The nonce returned with the response when starting a lease process.
Definition LootLockerRemoteSessionRequestHandler.h:234
FString Game_api_key
The Game Key configured for the game.
Definition LootLockerRemoteSessionRequestHandler.h:219
FString Game_version
The Game Version configured for the game.
Definition LootLockerRemoteSessionRequestHandler.h:224
Response returned when remote session polling completes, containing the lease status and,...
Definition LootLockerRemoteSessionRequestHandler.h:312
ELootLockerRemoteSessionLeaseStatus Lease_Status
The current status of this lease process.
Definition LootLockerRemoteSessionRequestHandler.h:318
ELootLockerRemoteSessionLeaseIntent Intent
The intent for this lease request.
Definition LootLockerRemoteSessionRequestHandler.h:328
FString Refresh_token
A refresh token that can be used to refresh the remote session instead of signing in each time the se...
Definition LootLockerRemoteSessionRequestHandler.h:323