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 = "";
206USTRUCT(BlueprintType, Category = "LootLocker")
213 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
214 FString Game_api_key = "";
218 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
219 FString Game_version = "";
223 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
224 FString Lease_code = "";
228 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
232USTRUCT(BlueprintType)
236 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"LootLocker")
237 FString refresh_token = "";
247USTRUCT(BlueprintType, Category = "LootLocker")
254 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
259 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
264 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
265 FString Redirect_url = "";
269 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
270 FString Redirect_url_qr_base64 = "";
274 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
275 FString Display_url = "";
279 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
284 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
291USTRUCT(BlueprintType, Category = "LootLocker")
298 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
305USTRUCT(BlueprintType, Category = "LootLocker")
312 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
317 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
318 FString Refresh_token = "";
322 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
329USTRUCT(BlueprintType, Category = "LootLocker")
336 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"LootLocker")
337 FString Refresh_token = "";
370 static constexpr int RetryLimit = 5;
371 FString LeaseCode =
"";
372 FString LeaseNonce =
"";
375 float PollingIntervalSeconds = 1.0f;
378 bool ShouldCancel =
false;
398 float PollingIntervalSeconds = 1.0f,
399 float TimeOutAfterMinutes = 5.0f,
400 const FString& ForPlayerWithUlid =
"",
410 const FString& TitleId,
411 const FString& EnvironmentId,
413 const FString& ForPlayerWithUlid,
414 const LLAPI<FLootLockerLeaseRemoteSessionResponse>::FResponseInspectorCallback& OnCompleteCallback,
416 static FString
StartRemoteSession(
const FString& LeaseCode,
const FString& LeaseNonce,
const LLAPI<FLootLockerStartRemoteSessionResponse>::FResponseInspectorCallback& OnCompleteCallback);
417 static void SetTimer(FTimerHandle TimerHandle,
const FTimerDelegate& BaseDelegate,
float TimeToNextPoll);
421 static TMap<FString, FLootLockerRemoteSessionProcess> RemoteSessionProcesses;
431DECLARE_DYNAMIC_MULTICAST_DELEGATE_SevenParams(FLootLockerAsyncRemoteSessionMulticastDelegate, FString, LeaseProcessID,
FLootLockerRemoteSessionLeaseData, LeaseData,
bool, HasPlayerData, FString, SessionTokenOnSuccess, FString, RefreshTokenOnSuccess,
FLootLockerRemoteSessionPlayerData, PlayerDataOnSuccess,
FLootLockerResponse, ResponseOnFailure);
463 UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly =
"true", Category =
"LootLocker Methods | Remote Session", WorldContext =
"WorldContextObject", AdvancedDisplay =
"PollingIntervalSeconds,TimeOutAfterMinutes,ForPlayerWithUlid,Provider", PollingIntervalSeconds = 1.0f, TimeOutAfterMinutes = 5.0f, ForPlayerWithUlid =
""))
488 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 UPROPERTY(BlueprintAssignable)
494 FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessStarted;
496 UPROPERTY(BlueprintAssignable)
497 FLootLockerAsyncRemoteSessionMulticastDelegate OnLeaseClaimed;
499 UPROPERTY(BlueprintAssignable)
500 FLootLockerAsyncRemoteSessionMulticastDelegate OnLeaseVerified;
502 UPROPERTY(BlueprintAssignable)
503 FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessCancelled;
505 UPROPERTY(BlueprintAssignable)
506 FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessTimedOut;
508 UPROPERTY(BlueprintAssignable)
509 FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessFailed;
511 UPROPERTY(BlueprintAssignable)
512 FLootLockerAsyncRemoteSessionMulticastDelegate OnProcessFinished;
515 LOOTLOCKERSDK_API virtual
void Activate() override;
518 FString ForPlayerWithUlid = "";
521 FString LeaseProcessID = "";
522 float PollingIntervalInSeconds = 0.0f;
523 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:440
Definition LootLockerRemoteSessionRequestHandler.h:387
ULootLockerRemoteSessionRequestHandler()
Definition LootLockerRemoteSessionRequestHandler.h:390
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:361
void(* FLootLockerStartRemoteSessionResponseDelegate)(FLootLockerStartRemoteSessionResponse)
C++ response delegate for receiving the finalized remote session data (whether successful or not)
Definition LootLockerRemoteSessionRequestHandler.h:357
ELootLockerRemoteSessionLeaseIntent
Possible intents for remote sessions.
Definition LootLockerRemoteSessionRequestHandler.h:45
void(* FLootLockerRemoteSessionStatusPollingResponseDelegate)(FLootLockerRemoteSessionStatusPollingResponse)
C++ response delegate for receiving continual polling updates.
Definition LootLockerRemoteSessionRequestHandler.h:353
void(* FLootLockerLeaseRemoteSessionResponseDelegate)(FLootLockerLeaseRemoteSessionResponse)
C++ response delegate for receiving the remote session lease information.
Definition LootLockerRemoteSessionRequestHandler.h:349
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:381
Definition LootLockerAuthenticationRequestHandler.h:83
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:249
Definition LootLockerAuthenticationRequestHandler.h:367
Definition LootLockerRemoteSessionRequestHandler.h:234
Response containing the refreshed authentication data and a new refresh token for an existing remote ...
Definition LootLockerRemoteSessionRequestHandler.h:331
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:369
FTimerHandle RemoteSessionProcessTimerHandle
Definition LootLockerRemoteSessionRequestHandler.h:379
FDateTime LastUpdatedAt
Definition LootLockerRemoteSessionRequestHandler.h:376
FDateTime LeasingProcessTimeoutTime
Definition LootLockerRemoteSessionRequestHandler.h:374
FLootLockerRemoteSessionProcess(float _PollingIntervalSeconds, float timeOutAfterMinutes)
Response containing the current lease status of a remote session when polled during the authorization...
Definition LootLockerRemoteSessionRequestHandler.h:293
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:208
Response returned when remote session polling completes, containing the lease status and,...
Definition LootLockerRemoteSessionRequestHandler.h:307