LootLocker Unreal SDK 11.1.0
Game backend SDK for Unreal Engine
Loading...
Searching...
No Matches
LootLockerIdentityRequestHandler.h
Go to the documentation of this file.
1// Copyright LootLocker AB
2
3#pragma once
4
5#include "CoreMinimal.h"
8#include "LootLockerIdentityRequestHandler.generated.h"
9
10//==================================================
11// Data Type Definitions
12//==================================================
15UENUM(BlueprintType, Category = "LootLocker")
58
59
60//==================================================
61// Data Definitions
62//==================================================
63
67USTRUCT(BlueprintType, Category = "LootLocker")
69{
70 GENERATED_BODY()
71
72
73 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
74 int32 game_id = 0;
75
77 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
78 FString first_session_at = "";
79
81 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
82 FString last_session_at = "";
83
85 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
86 int32 session_count = 0;
87};
88
97USTRUCT(BlueprintType, Category = "LootLocker")
99{
100 GENERATED_BODY()
101
102
103 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
104 FString id = "";
105
107 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
108 FString provider = "";
109
116 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
118
120 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
121 FString created_at = "";
122};
123
128USTRUCT(BlueprintType, Category = "LootLocker")
130{
131 GENERATED_BODY()
132
133
134 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
135 int32 game_id = 0;
136
138 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
139 int32 keep_player_id = 0;
140
142 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
144};
145
151USTRUCT(BlueprintType, Category = "LootLocker")
153{
154 GENERATED_BODY()
155
156
157 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
158 FString keep_identity_id = "";
159
161 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
162 FString merge_identity_id = "";
163
165 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
167};
168
169//==================================================
170// Request Definitions
171//==================================================
172
179USTRUCT(BlueprintType, Category = "LootLocker")
181{
182 GENERATED_BODY()
183
184
185 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
186 TArray<FString> identity_ids;
187
189 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
190 TArray<int32> game_ids;
191
193 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
195};
196
200USTRUCT(BlueprintType, Category = "LootLocker")
202{
203 GENERATED_BODY()
204
205
206 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
208
210 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
211 FString provider_uid = "";
212};
213
217USTRUCT(BlueprintType, Category = "LootLocker")
219{
220 GENERATED_BODY()
221
222
223 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
224 int32 game_id = 0;
225
227 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
228 int32 keep_player_id = 0;
229};
230
237USTRUCT(BlueprintType, Category = "LootLocker")
239{
240 GENERATED_BODY()
241
242
243 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
244 FString merge_identity_id = "";
245
247 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
249
251 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
252 FString trigger_provider = "";
253
255 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
257};
258
259//==================================================
260// Response Definitions
261//==================================================
262
266USTRUCT(BlueprintType, Category = "LootLocker")
268{
269 GENERATED_BODY()
270
271
272 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
273 FString id = "";
274
276 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
277 int32 publisher_id = 0;
278
280 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
281 FString created_at = "";
282
284 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
286
294 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
296
298 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
299 bool has_providers = false;
300};
301
305USTRUCT(BlueprintType, Category = "LootLocker")
307{
308 GENERATED_BODY()
309
310
311 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
313};
314
321USTRUCT(BlueprintType, Category = "LootLocker")
323{
324 GENERATED_BODY()
325
326
327 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
328 FString message = "";
329
331 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
333
335 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
337};
338
342USTRUCT(BlueprintType, Category = "LootLocker")
344{
345 GENERATED_BODY()
346
347
348 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
349 bool created = false;
350
355 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
357
359 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
360 bool has_conflict = false;
361};
362
366USTRUCT(BlueprintType, Category = "LootLocker")
368{
369 GENERATED_BODY()
370
371
372 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
373 FString keep_identity_id = "";
374
376 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
377 FString merge_identity_id = "";
378
380 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
382};
383
387USTRUCT(BlueprintType, Category = "LootLocker")
389{
390 GENERATED_BODY()
391
392
393 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
394 FString id = "";
395
397 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
398 int32 publisher_id = 0;
399
401 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
402 FString created_at = "";
403
405 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
407
414 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
416
418 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
419 bool has_providers = false;
420};
421
422//==================================================
423// Delegate Definitions
424//==================================================
427
437
438//==================================================
439// API Class Definition
440//==================================================
441
443UCLASS()
444class LOOTLOCKERSDK_API ULootLockerIdentityRequestHandler : public UObject
445{
446 GENERATED_BODY()
447public:
449
450 static FString GetIdentity(const FLootLockerPlayerData& PlayerData, const FLootLockerIdentityResponseDelegate& OnComplete);
452 static FString LinkProvider(const FLootLockerPlayerData& PlayerData, const FLootLockerIdentityLinkRequest& Request, const FLootLockerIdentityLinkResponseDelegate& OnComplete);
453 static FString UnlinkProvider(const FLootLockerPlayerData& PlayerData, const FString& CredentialId, const FLootLockerDefaultDelegate& OnComplete);
454 static FString PreviewIdentityMerge(const FLootLockerPlayerData& PlayerData, const FString& MergeIdentityId, const FLootLockerIdentityMergePreviewResponseDelegate& OnComplete);
455 static FString MergeIdentities(const FLootLockerPlayerData& PlayerData, const FLootLockerIdentityMergeRequest& Request, const FLootLockerIdentityMergeResponseDelegate& OnComplete);
456
463
468
473 static ELootLockerIdentityProvider SlugToProvider(const FString& Slug);
474
482
485};
void(* FLootLockerDefaultDelegate)(FLootLockerResponse)
Definition LootLockerResponse.h:38
ULootLockerIdentityRequestHandler()
Definition LootLockerIdentityRequestHandler.h:448
static FString GetIdentity(const FLootLockerPlayerData &PlayerData, const FLootLockerIdentityResponseDelegate &OnComplete)
static FString PreviewIdentityMerge(const FLootLockerPlayerData &PlayerData, const FString &MergeIdentityId, const FLootLockerIdentityMergePreviewResponseDelegate &OnComplete)
static void ParseLinkConflict(FLootLockerIdentityLinkResponse &Response)
Parses the 409 merge offer onto the response.
static ELootLockerIdentityProvider SlugToProvider(const FString &Slug)
Resolves a provider slug to its enumerator, or Unknown when this SDK does not map it.
static FString GetProviderCredentialId(const FLootLockerIdentityResponse &Identity, ELootLockerIdentityProvider Provider)
The credential id for a provider, or an empty string when no credential for it is linked.
static FString UnlinkProvider(const FLootLockerPlayerData &PlayerData, const FString &CredentialId, const FLootLockerDefaultDelegate &OnComplete)
static FString ProviderToSlug(ELootLockerIdentityProvider Provider)
The wire slug for a provider, which is the lowercased enumerator name.
static FString LookupIdentities(const FLootLockerPlayerData &PlayerData, const FLootLockerIdentityLookupRequest &Request, const FLootLockerIdentityLookupResponseDelegate &OnComplete)
static FString LinkProvider(const FLootLockerPlayerData &PlayerData, const FLootLockerIdentityLinkRequest &Request, const FLootLockerIdentityLinkResponseDelegate &OnComplete)
static FString MergeIdentities(const FLootLockerPlayerData &PlayerData, const FLootLockerIdentityMergeRequest &Request, const FLootLockerIdentityMergeResponseDelegate &OnComplete)
static void MarkProvidersPresent(FLootLockerIdentityResponse &Response)
Sets has_providers when the payload carried a providers array.
void(* FLootLockerIdentityResponseDelegate)(FLootLockerIdentityResponse)
C++ response delegate for reading the current identity.
Definition LootLockerIdentityRequestHandler.h:428
void(* FLootLockerIdentityMergePreviewResponseDelegate)(FLootLockerIdentityMergePreviewResponse)
C++ response delegate for previewing an identity merge.
Definition LootLockerIdentityRequestHandler.h:434
void(* FLootLockerIdentityLookupResponseDelegate)(FLootLockerIdentityLookupResponse)
C++ response delegate for looking identities up.
Definition LootLockerIdentityRequestHandler.h:430
ELootLockerIdentityProvider
Platforms that can be presented as a credential when linking a provider to an identity.
Definition LootLockerIdentityRequestHandler.h:27
void(* FLootLockerIdentityLinkResponseDelegate)(FLootLockerIdentityLinkResponse)
C++ response delegate for linking a provider credential.
Definition LootLockerIdentityRequestHandler.h:432
void(* FLootLockerIdentityMergeResponseDelegate)(FLootLockerIdentityMergeResponse)
C++ response delegate for merging identities.
Definition LootLockerIdentityRequestHandler.h:436
@ Google_sign_in
Definition LootLockerIdentityRequestHandler.h:44
@ Google_play_games
Definition LootLockerIdentityRequestHandler.h:50
@ Nintendo_switch
Definition LootLockerIdentityRequestHandler.h:39
@ Steam
Definition LootLockerIdentityRequestHandler.h:34
@ Epic_games
Definition LootLockerIdentityRequestHandler.h:45
@ Lootlocker_delegation
Definition LootLockerIdentityRequestHandler.h:48
@ Twitch
Definition LootLockerIdentityRequestHandler.h:49
@ Google_play_store
Definition LootLockerIdentityRequestHandler.h:37
@ Publisher_account
A publisher account credential (email).
Definition LootLockerIdentityRequestHandler.h:56
@ White_label_login
Definition LootLockerIdentityRequestHandler.h:41
@ Apple_app_store
Definition LootLockerIdentityRequestHandler.h:36
@ Unknown
A provider this SDK does not recognise, or one the response did not populate.
Definition LootLockerIdentityRequestHandler.h:33
@ Discord
Definition LootLockerIdentityRequestHandler.h:51
@ Psn
Definition LootLockerIdentityRequestHandler.h:35
@ Apple_sign_in
Definition LootLockerIdentityRequestHandler.h:43
@ Apple_game_center
Definition LootLockerIdentityRequestHandler.h:46
@ Guest
Definition LootLockerIdentityRequestHandler.h:42
@ Meta
Definition LootLockerIdentityRequestHandler.h:47
@ Amazon_luna
Definition LootLockerIdentityRequestHandler.h:40
@ Xbox_one
Definition LootLockerIdentityRequestHandler.h:38
One game in which a player of this identity has been active.
Definition LootLockerIdentityRequestHandler.h:69
int32 game_id
The legacy integer id of the game.
Definition LootLockerIdentityRequestHandler.h:74
FString first_session_at
The first time a session was started for this identity in the game.
Definition LootLockerIdentityRequestHandler.h:78
FString last_session_at
The most recent time a session was started for this identity in the game.
Definition LootLockerIdentityRequestHandler.h:82
int32 session_count
The number of sessions started for this identity in the game.
Definition LootLockerIdentityRequestHandler.h:86
The body of the 409 returned when the credential being linked already belongs to another identity.
Definition LootLockerIdentityRequestHandler.h:323
FString message
The message the server attached to the conflict.
Definition LootLockerIdentityRequestHandler.h:328
FString conflicting_identity_id
The ULID of the identity that already owns the credential.
Definition LootLockerIdentityRequestHandler.h:332
FLootLockerIdentityMergePreview merge_preview
What a merge of the requesting identity (keep) into the conflicting identity (merge) would resolve.
Definition LootLockerIdentityRequestHandler.h:336
Request to record a provider credential against the player's identity.
Definition LootLockerIdentityRequestHandler.h:202
ELootLockerIdentityProvider provider
The provider platform the credential belongs to.
Definition LootLockerIdentityRequestHandler.h:207
FString provider_uid
The provider's identifier for the player, for example the Steam ID.
Definition LootLockerIdentityRequestHandler.h:211
Response returned after linking a provider credential.
Definition LootLockerIdentityRequestHandler.h:344
bool has_conflict
Whether Conflict was populated, because Conflict itself is a value type that cannot be null.
Definition LootLockerIdentityRequestHandler.h:360
FLootLockerIdentityLinkConflict conflict
Set when the request was answered with 409 because the credential belongs to another identity.
Definition LootLockerIdentityRequestHandler.h:356
bool created
True when a new credential was recorded, false when the identity already owned it.
Definition LootLockerIdentityRequestHandler.h:349
Request to look identities up by id and/or by the games they have been active in.
Definition LootLockerIdentityRequestHandler.h:181
TArray< FString > identity_ids
Optional: The ULIDs of the identities to look up.
Definition LootLockerIdentityRequestHandler.h:186
bool include_game_activity
Optional: Whether to populate game_activity on each result.
Definition LootLockerIdentityRequestHandler.h:194
TArray< int32 > game_ids
Optional: The legacy integer ids of games to filter the identities by.
Definition LootLockerIdentityRequestHandler.h:190
Response containing zero or more identities.
Definition LootLockerIdentityRequestHandler.h:307
TArray< FLootLockerIdentityResponse > identities
The identities matching the lookup.
Definition LootLockerIdentityRequestHandler.h:312
Response containing a merge preview.
Definition LootLockerIdentityRequestHandler.h:368
FString merge_identity_id
The ULID of the identity that would be merged into the kept identity.
Definition LootLockerIdentityRequestHandler.h:377
FString keep_identity_id
The ULID of the identity the caller keeps.
Definition LootLockerIdentityRequestHandler.h:373
TArray< FLootLockerIdentityPlayerConflict > player_conflicts
The games in which both identities have a live player.
Definition LootLockerIdentityRequestHandler.h:381
What merging two identities would resolve, without executing anything.
Definition LootLockerIdentityRequestHandler.h:153
TArray< FLootLockerIdentityPlayerConflict > player_conflicts
The games in which both identities have a live player.
Definition LootLockerIdentityRequestHandler.h:166
FString merge_identity_id
The ULID of the identity that would be merged into the kept identity.
Definition LootLockerIdentityRequestHandler.h:162
FString keep_identity_id
The ULID of the identity the caller keeps.
Definition LootLockerIdentityRequestHandler.h:158
Request to merge another identity into the current one.
Definition LootLockerIdentityRequestHandler.h:239
FString trigger_provider
Optional: The provider whose credential conflict led to this merge, recorded in the merge log.
Definition LootLockerIdentityRequestHandler.h:252
TArray< FLootLockerIdentityMergeResolution > resolutions
One entry per game listed in the merge preview's player_conflicts.
Definition LootLockerIdentityRequestHandler.h:248
FString trigger_provider_uid
Optional: The provider credential that led to this merge, recorded in the merge log.
Definition LootLockerIdentityRequestHandler.h:256
FString merge_identity_id
The ULID of the identity to merge into the authenticated identity.
Definition LootLockerIdentityRequestHandler.h:244
The choice of which player to keep in one game where both identities have a live player.
Definition LootLockerIdentityRequestHandler.h:219
int32 game_id
The legacy integer id of the game this resolution is for.
Definition LootLockerIdentityRequestHandler.h:224
int32 keep_player_id
The player to keep in this game.
Definition LootLockerIdentityRequestHandler.h:228
Response returned after merging two identities, containing the surviving identity.
Definition LootLockerIdentityRequestHandler.h:389
TArray< FLootLockerIdentityGameActivity > game_activity
The games the surviving identity has been active in.
Definition LootLockerIdentityRequestHandler.h:406
FString created_at
When the surviving identity was created.
Definition LootLockerIdentityRequestHandler.h:402
TArray< FLootLockerIdentityProviderInfo > providers
The provider credentials linked to the surviving identity.
Definition LootLockerIdentityRequestHandler.h:415
int32 publisher_id
The legacy integer id of the publisher that owns the identity.
Definition LootLockerIdentityRequestHandler.h:398
bool has_providers
Whether providers was present in the payload.
Definition LootLockerIdentityRequestHandler.h:419
One game in which both identities being merged have a live player, and therefore needs a choice of wh...
Definition LootLockerIdentityRequestHandler.h:130
int32 merge_player_id
The player id belonging to the identity that is merged away.
Definition LootLockerIdentityRequestHandler.h:143
int32 game_id
The legacy integer id of the game the conflict is in.
Definition LootLockerIdentityRequestHandler.h:135
int32 keep_player_id
The player id belonging to the identity that is kept.
Definition LootLockerIdentityRequestHandler.h:139
A provider credential linked to an identity.
Definition LootLockerIdentityRequestHandler.h:99
FString created_at
When the credential was linked to the identity.
Definition LootLockerIdentityRequestHandler.h:121
ELootLockerIdentityProvider provider_type
The provider this credential belongs to, resolved from Provider.
Definition LootLockerIdentityRequestHandler.h:117
FString provider
The provider slug, for example "steam", "psn" or "xbox_one", exactly as the backend stored it.
Definition LootLockerIdentityRequestHandler.h:108
Response containing a single identity.
Definition LootLockerIdentityRequestHandler.h:268
int32 publisher_id
The legacy integer id of the publisher that owns the identity.
Definition LootLockerIdentityRequestHandler.h:277
TArray< FLootLockerIdentityGameActivity > game_activity
The games this identity has been active in.
Definition LootLockerIdentityRequestHandler.h:285
bool has_providers
Whether providers was present in the payload, because an empty array cannot be told from absent.
Definition LootLockerIdentityRequestHandler.h:299
FString created_at
When the identity was created.
Definition LootLockerIdentityRequestHandler.h:281
TArray< FLootLockerIdentityProviderInfo > providers
The provider credentials linked to this identity.
Definition LootLockerIdentityRequestHandler.h:295
Definition LootLockerPlayerData.h:12
Base response struct — every SDK callback receives a struct that derives from this.
Definition LootLockerResponse.h:19