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")
68 FString player_name = "";
72 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
77 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
78 FString public_uid = "";
82 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
83 FString player_ulid = "";
87 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
88 bool seen_before = false;
92 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
93 bool check_grant_notifications = false;
97 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
98 bool check_deactivation_notifications = false;
102 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
107 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
112 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
117 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
118 int32 account_balance = 0;
122 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
123 FString player_identifier = "";
127 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
128 FString player_created_at = "";
132 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
133 FString wallet_id = "";
139USTRUCT(BlueprintType, Category = "LootLocker")
146 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
151 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
156 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
157 FString Redirect_url = "";
161 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
162 FString Redirect_url_qr_base64 = "";
166 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
167 UTexture2D* Redirect_url_qr_texture =
nullptr;
171 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
172 FString Display_url = "";
182USTRUCT(BlueprintType, Category = "LootLocker")
189 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
190 FString Title_id = "";
194 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
195 FString Environment_id = "";
199 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
200 FString Game_version = "";
204 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
205 TArray<FString> Providers;
211USTRUCT(BlueprintType, Category = "LootLocker")
218 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
219 FString Game_api_key = "";
223 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
224 FString Game_version = "";
228 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
229 FString Lease_code = "";
233 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
237USTRUCT(BlueprintType)
241 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"LootLocker")
242 FString refresh_token = "";
252USTRUCT(BlueprintType, Category = "LootLocker")
259 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
264 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
269 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
270 FString Redirect_url = "";
274 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
275 FString Redirect_url_qr_base64 = "";
279 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
280 FString Display_url = "";
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")
323 FString Refresh_token = "";
327 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
334USTRUCT(BlueprintType, Category = "LootLocker")
341 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
342 FString Refresh_token = "";
375 static constexpr int RetryLimit = 5;
376 FString LeaseCode =
"";
377 FString LeaseNonce =
"";
380 float PollingIntervalSeconds = 1.0f;
383 bool ShouldCancel =
false;
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)
499 FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessStarted;
501 UPROPERTY(BlueprintAssignable)
502 FLootLockerAsyncRemoteSessionMulticastDelegate OnLeaseClaimed;
504 UPROPERTY(BlueprintAssignable)
505 FLootLockerAsyncRemoteSessionMulticastDelegate OnLeaseVerified;
507 UPROPERTY(BlueprintAssignable)
508 FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessCancelled;
510 UPROPERTY(BlueprintAssignable)
511 FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessTimedOut;
513 UPROPERTY(BlueprintAssignable)
514 FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessFailed;
516 UPROPERTY(BlueprintAssignable)
517 FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessFinished;
520 LOOTLOCKERSDK_API virtual
void Activate() override;
523 FString ForPlayerWithUlid = "";
526 FString LeaseProcessID = "";
527 float PollingIntervalInSeconds = 0.0f;
528 float TimeoutAfterMinutes = 0.0f;
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
Definition LootLockerRemoteSessionRequestHandler.h:392
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
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.
@ login
Intent is to log in using a leased remote session.
Definition LootLockerAuthenticationRequestHandler.h:420
Definition LootLockerAuthenticationRequestHandler.h:122
Request body for remote session lease (now required fields)
Definition LootLockerRemoteSessionRequestHandler.h:184
Response containing the lease codes, redirect URLs, current lease status, and intent returned when st...
Definition LootLockerRemoteSessionRequestHandler.h:254
Definition LootLockerAuthenticationRequestHandler.h:406
Definition LootLockerRemoteSessionRequestHandler.h:239
Response containing the refreshed authentication data and a new refresh token for an existing remote ...
Definition LootLockerRemoteSessionRequestHandler.h:336
Holds the lease codes, redirect URL, Base64 QR code, and display URL needed to drive the remote sessi...
Definition LootLockerRemoteSessionRequestHandler.h:141
Holds the player data returned when a remote session lease is successfully authorized,...
Definition LootLockerRemoteSessionRequestHandler.h:62
Definition LootLockerRemoteSessionRequestHandler.h:374
FTimerHandle RemoteSessionProcessTimerHandle
Definition LootLockerRemoteSessionRequestHandler.h:384
FDateTime LastUpdatedAt
Definition LootLockerRemoteSessionRequestHandler.h:381
FDateTime LeasingProcessTimeoutTime
Definition LootLockerRemoteSessionRequestHandler.h:379
FLootLockerRemoteSessionProcess(float _PollingIntervalSeconds, float timeOutAfterMinutes)
Response containing the current lease status of a remote session when polled during the authorization...
Definition LootLockerRemoteSessionRequestHandler.h:298
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
Response returned when remote session polling completes, containing the lease status and,...
Definition LootLockerRemoteSessionRequestHandler.h:312