LootLocker Unreal SDK 10.7.0
Game backend SDK for Unreal Engine
Loading...
Searching...
No Matches
LootLockerItemRequestHandler.h
Go to the documentation of this file.
1// Copyright (c) 2021 LootLocker
2
3#pragma once
4
5
6#include "CoreMinimal.h"
7#include "Dom/JsonObject.h"
11#include "LootLockerItemRequestHandler.generated.h"
12
13
14//==================================================
15// Enum Definitions
16//==================================================
17
20UENUM(BlueprintType, Category = "LootLocker")
25{
26 All = 0,
29};
30
31
34UENUM(BlueprintType, Category = "LootLocker")
38enum class ELootLockerItemType : uint8
39{
41 None = 0,
46};
47
48
51UENUM(BlueprintType, Category = "LootLocker")
55enum class ELootLockerItemSortField : uint8
56{
58 None = 0,
64 Source = 3,
65};
66
67
70UENUM(BlueprintType, Category = "LootLocker")
74enum class ELootLockerItemSortOrder : uint8
75{
77 None = 0,
79 Asc = 1,
81 Desc = 2,
82};
83
84
87UENUM(BlueprintType, Category = "LootLocker")
122
123
124
125//==================================================
126// Data Type Definitions
127//==================================================
128
129
133USTRUCT(BlueprintType, Category = "LootLocker")
135{
136 GENERATED_BODY()
137
138
139 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
140 FString Id = "";
141
143 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
144 FString Name = "";
145
147 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
148 int32 Limited = 0;
149
151 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
153
155 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
156 bool Consumable = false;
157
159 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
160 bool Deletable = false;
161
163 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
164 FDateTime Created_at = FDateTime(0);
165
167 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
168 FDateTime Updated_at = FDateTime(0);
169};
170
178USTRUCT(BlueprintType, Category = "LootLocker")
180{
181 GENERATED_BODY()
182
183
184 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
185 FString Id = "";
186
188 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
189 int32 Player_id = 0;
190
192 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
193 FString Item_template_id = "";
194
196 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
198
200 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
201 bool Consumable = false;
202
204 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
205 bool Deletable = false;
206
208 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
209 int32 Count = 0;
210
212 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
213 FString Source = "";
214
216 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
217 FString Name = "";
218
220 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
221 FDateTime Created_at = FDateTime(0);
222
224 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
225 FDateTime Updated_at = FDateTime(0);
226
228 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
230};
231
235USTRUCT(BlueprintType, Category = "LootLocker")
237{
238 GENERATED_BODY()
239
240
241 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
242 FString Source_id = "";
243
245 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
246 int32 Count = 0;
247
249 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
251
253 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
254 FString Name = "";
255
257 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
258 FString Code = "";
259};
260
261
262//==================================================
263// Request Definitions
264//==================================================
265
266
270USTRUCT(BlueprintType, Category = "LootLocker")
272{
273 GENERATED_BODY()
274
275
279 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
280 int32 Count = 1;
281};
282
286USTRUCT(BlueprintType, Category = "LootLocker")
288{
289 GENERATED_BODY()
290
291
292 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
293 int32 Count = 0;
294};
295
299USTRUCT(BlueprintType, Category = "LootLocker")
301{
302 GENERATED_BODY()
303
304
305 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
307
309 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
311};
312
313
314//==================================================
315// Response Definitions
316//==================================================
317
318
322USTRUCT(BlueprintType, Category = "LootLocker")
324{
325 GENERATED_BODY()
326
327
328 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
330
332 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
334};
335
342USTRUCT(BlueprintType, Category = "LootLocker")
344{
345 GENERATED_BODY()
346
347
348 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
350
352 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
354
359};
360
364USTRUCT(BlueprintType, Category = "LootLocker")
366{
367 GENERATED_BODY()
368
369
370 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
371 FString Id = "";
372
374 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
375 int32 Player_id = 0;
376
378 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
379 FString Item_template_id = "";
380
382 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
384
386 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
387 bool Consumable = false;
388
390 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
391 bool Deletable = false;
392
394 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
395 int32 Count = 0;
396
398 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
399 FString Source = "";
400
402 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
403 FDateTime Created_at = FDateTime(0);
404
406 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
407 FDateTime Updated_at = FDateTime(0);
408
410 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
412
414 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
416
421};
422
426USTRUCT(BlueprintType, Category = "LootLocker")
428{
429 GENERATED_BODY()
430
431
432 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
433 bool Consumed = false;
434
436 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
438};
439
443USTRUCT(BlueprintType, Category = "LootLocker")
445{
446 GENERATED_BODY()
447
448
449 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
450 FString Id = "";
451};
452
456USTRUCT(BlueprintType, Category = "LootLocker")
458{
459 GENERATED_BODY()
460};
461
462
463//==================================================
464// Delegate Definitions
465//==================================================
466
469
473
478
483
488
493
498
499
500//==================================================
501// API Class Definition
502//==================================================
503
505UCLASS()
506class LOOTLOCKERSDK_API ULootLockerItemRequestHandler : public UObject
507{
508 GENERATED_BODY()
509public:
511
512 static FString ListItemTemplates(const FLootLockerPlayerData& PlayerData, int32 PerPage, int32 Page, const FLootLockerListItemTemplatesResponseDelegate& OnCompletedRequest);
513
514 static FString ListPlayerInventoryItems(const FLootLockerPlayerData& PlayerData, int32 PerPage, int32 Page, const FString& Name, ELootLockerItemType ItemType, ELootLockerItemConsumableFilter ConsumableFilter, ELootLockerItemSortField Sort, ELootLockerItemSortOrder Order, const FLootLockerListPlayerInventoryItemsResponseDelegate& OnCompletedRequest);
515
516 static FString GetPlayerInventoryItem(const FLootLockerPlayerData& PlayerData, const FString& InventoryId, const FLootLockerGetPlayerInventoryItemResponseDelegate& OnCompletedRequest);
517
518 static FString DeletePlayerInventoryItem(const FLootLockerPlayerData& PlayerData, const FString& InventoryId, const FLootLockerDefaultDelegate& OnCompletedRequest);
519
520 static FString ConsumePlayerInventoryItem(const FLootLockerPlayerData& PlayerData, const FString& InventoryId, const FLootLockerConsumeInventoryItemRequest& Request, const FLootLockerConsumePlayerInventoryItemResponseDelegate& OnCompletedRequest);
521
522 static FString SplitPlayerInventoryItemStack(const FLootLockerPlayerData& PlayerData, const FString& InventoryId, const FLootLockerSplitInventoryItemStackRequest& Request, const FLootLockerSplitInventoryItemStackResponseDelegate& OnCompletedRequest);
523
525};
void(* FLootLockerDefaultDelegate)(FLootLockerResponse)
Definition LootLockerResponse.h:38
static FString ListPlayerInventoryItems(const FLootLockerPlayerData &PlayerData, int32 PerPage, int32 Page, const FString &Name, ELootLockerItemType ItemType, ELootLockerItemConsumableFilter ConsumableFilter, ELootLockerItemSortField Sort, ELootLockerItemSortOrder Order, const FLootLockerListPlayerInventoryItemsResponseDelegate &OnCompletedRequest)
static FString SplitPlayerInventoryItemStack(const FLootLockerPlayerData &PlayerData, const FString &InventoryId, const FLootLockerSplitInventoryItemStackRequest &Request, const FLootLockerSplitInventoryItemStackResponseDelegate &OnCompletedRequest)
static FString GetPlayerInventoryItem(const FLootLockerPlayerData &PlayerData, const FString &InventoryId, const FLootLockerGetPlayerInventoryItemResponseDelegate &OnCompletedRequest)
static FString ListItemTemplates(const FLootLockerPlayerData &PlayerData, int32 PerPage, int32 Page, const FLootLockerListItemTemplatesResponseDelegate &OnCompletedRequest)
static FString MergePlayerInventoryItemStacks(const FLootLockerPlayerData &PlayerData, const FLootLockerMergeInventoryItemStacksRequest &Request, const FLootLockerMergeInventoryItemStacksResponseDelegate &OnCompletedRequest)
static FString DeletePlayerInventoryItem(const FLootLockerPlayerData &PlayerData, const FString &InventoryId, const FLootLockerDefaultDelegate &OnCompletedRequest)
ULootLockerItemRequestHandler()
Definition LootLockerItemRequestHandler.h:510
static FString ConsumePlayerInventoryItem(const FLootLockerPlayerData &PlayerData, const FString &InventoryId, const FLootLockerConsumeInventoryItemRequest &Request, const FLootLockerConsumePlayerInventoryItemResponseDelegate &OnCompletedRequest)
@ Name
Definition LootLockerAssetsRequestHandler.h:297
ELootLockerRewardKind
The kind of reward that was granted as a result of a behaviour.
Definition LootLockerItemRequestHandler.h:92
void(* FLootLockerSplitInventoryItemStackResponseDelegate)(FLootLockerSplitInventoryItemStackResponse)
C++ response delegate for splitting an item stack.
Definition LootLockerItemRequestHandler.h:492
void(* FLootLockerListPlayerInventoryItemsResponseDelegate)(FLootLockerListPlayerInventoryItemsResponse)
C++ response delegate for listing player items.
Definition LootLockerItemRequestHandler.h:477
void(* FLootLockerGetPlayerInventoryItemResponseDelegate)(FLootLockerGetPlayerInventoryItemResponse)
C++ response delegate for getting a player item.
Definition LootLockerItemRequestHandler.h:482
void(* FLootLockerListItemTemplatesResponseDelegate)(FLootLockerListItemTemplatesResponse)
C++ response delegate for listing item templates.
Definition LootLockerItemRequestHandler.h:472
ELootLockerItemType
The type of an item, determining whether item instances are stackable or individually tracked.
Definition LootLockerItemRequestHandler.h:39
ELootLockerItemSortOrder
The direction in which to order a player item list response.
Definition LootLockerItemRequestHandler.h:75
void(* FLootLockerConsumePlayerInventoryItemResponseDelegate)(FLootLockerConsumePlayerInventoryItemResponse)
C++ response delegate for consuming a player item.
Definition LootLockerItemRequestHandler.h:487
void(* FLootLockerMergeInventoryItemStacksResponseDelegate)(FLootLockerMergeInventoryItemStacksResponse)
C++ response delegate for merging item stacks.
Definition LootLockerItemRequestHandler.h:497
ELootLockerItemSortField
The field by which to order a player item list response.
Definition LootLockerItemRequestHandler.h:56
ELootLockerItemConsumableFilter
Enum for filtering player items on whether they are consumable.
Definition LootLockerItemRequestHandler.h:25
@ Group
A group.
Definition LootLockerItemRequestHandler.h:104
@ File
A file.
Definition LootLockerItemRequestHandler.h:116
@ Asset
An asset.
Definition LootLockerItemRequestHandler.h:96
@ Item_template
An item template.
Definition LootLockerItemRequestHandler.h:120
@ Reward
A reward.
Definition LootLockerItemRequestHandler.h:106
@ Publisher_progression_points
Publisher progression points.
Definition LootLockerItemRequestHandler.h:112
@ Currency
A currency.
Definition LootLockerItemRequestHandler.h:102
@ Discord_role
A Discord role.
Definition LootLockerItemRequestHandler.h:118
@ Progression_points
Progression points.
Definition LootLockerItemRequestHandler.h:98
@ Progression_reset
A progression reset.
Definition LootLockerItemRequestHandler.h:100
@ Unknown
The reward kind could not be determined.
Definition LootLockerItemRequestHandler.h:94
@ Player_metadata
Player metadata.
Definition LootLockerItemRequestHandler.h:114
@ Publisher_currency
A publisher currency.
Definition LootLockerItemRequestHandler.h:110
@ Platform_key
A platform key.
Definition LootLockerItemRequestHandler.h:108
@ Stackable
The item is stored as a single entry with a count that can be incremented or decremented.
Definition LootLockerItemRequestHandler.h:45
@ None
No filter.
Definition LootLockerItemRequestHandler.h:41
@ Instanced
Each granted item is a separate, individually tracked instance.
Definition LootLockerItemRequestHandler.h:43
@ Desc
Order descending.
Definition LootLockerItemRequestHandler.h:81
@ Asc
Order ascending.
Definition LootLockerItemRequestHandler.h:79
@ Created_at
Order by when the item was created.
Definition LootLockerItemRequestHandler.h:60
@ Updated_at
Order by when the item was last updated.
Definition LootLockerItemRequestHandler.h:62
@ Source
Order by the source that granted the item.
Definition LootLockerItemRequestHandler.h:64
@ Not_consumable
Definition LootLockerItemRequestHandler.h:28
@ Consumable
Definition LootLockerItemRequestHandler.h:27
@ All
Definition LootLockerItemRequestHandler.h:26
Request to consume one or more of an item.
Definition LootLockerItemRequestHandler.h:272
int32 Count
The number of items to consume.
Definition LootLockerItemRequestHandler.h:280
Response for consuming one or more of an item.
Definition LootLockerItemRequestHandler.h:428
bool Consumed
Whether the item was consumed.
Definition LootLockerItemRequestHandler.h:433
TArray< FLootLockerGrantedItem > Granted
Any items granted as a result of consuming the item.
Definition LootLockerItemRequestHandler.h:437
Definition LootLockerResponse.h:101
Response for getting a single player inventory item.
Definition LootLockerItemRequestHandler.h:366
int32 Player_id
The legacy integer id of the player that owns this item.
Definition LootLockerItemRequestHandler.h:375
FString Id
The ULID of this specific inventory item.
Definition LootLockerItemRequestHandler.h:371
ELootLockerItemType Item_type
The type of the item (instanced or stackable).
Definition LootLockerItemRequestHandler.h:383
FLootLockerItemTemplate Template
The item template that this item is based on.
Definition LootLockerItemRequestHandler.h:411
bool Consumable
Whether this item can be consumed.
Definition LootLockerItemRequestHandler.h:387
FDateTime Updated_at
When this item was last updated.
Definition LootLockerItemRequestHandler.h:407
FString Source
How this item was acquired.
Definition LootLockerItemRequestHandler.h:399
FDateTime Created_at
When this item was acquired.
Definition LootLockerItemRequestHandler.h:403
void PopulateConvenienceStructures()
Populate convenience structures (parsed metadata) from the raw response.
FString Item_template_id
The ULID of the item template that this item is based on.
Definition LootLockerItemRequestHandler.h:379
TArray< FLootLockerMetadataEntry > Metadata
The free-form metadata for this item.
Definition LootLockerItemRequestHandler.h:415
int32 Count
How many of this item the stack holds.
Definition LootLockerItemRequestHandler.h:395
bool Deletable
Whether this item can be deleted by the player.
Definition LootLockerItemRequestHandler.h:391
Represents an item that was granted as a result of consuming an item.
Definition LootLockerItemRequestHandler.h:237
ELootLockerRewardKind Type
The kind of reward that was granted.
Definition LootLockerItemRequestHandler.h:250
FString Code
The code of the granted reward.
Definition LootLockerItemRequestHandler.h:258
FString Source_id
The ULID of the granted reward.
Definition LootLockerItemRequestHandler.h:242
int32 Count
How many of the item were granted.
Definition LootLockerItemRequestHandler.h:246
FString Name
The name of the granted reward.
Definition LootLockerItemRequestHandler.h:254
Represents a single item (inventory entry) owned by a player.
Definition LootLockerItemRequestHandler.h:180
FString Name
The name of the item template this item is based on.
Definition LootLockerItemRequestHandler.h:217
FString Id
The ULID of this specific inventory item.
Definition LootLockerItemRequestHandler.h:185
bool Consumable
Whether this item can be consumed.
Definition LootLockerItemRequestHandler.h:201
TArray< FLootLockerMetadataEntry > Metadata
The free-form metadata for this item.
Definition LootLockerItemRequestHandler.h:229
bool Deletable
Whether this item can be deleted by the player.
Definition LootLockerItemRequestHandler.h:205
int32 Count
How many of this item the stack holds.
Definition LootLockerItemRequestHandler.h:209
FDateTime Created_at
When this item was acquired.
Definition LootLockerItemRequestHandler.h:221
FString Source
How this item was acquired.
Definition LootLockerItemRequestHandler.h:213
ELootLockerItemType Item_type
The type of the item (instanced or stackable).
Definition LootLockerItemRequestHandler.h:197
int32 Player_id
The legacy integer id of the player that owns this item.
Definition LootLockerItemRequestHandler.h:189
FString Item_template_id
The ULID of the item template that this item is based on.
Definition LootLockerItemRequestHandler.h:193
FDateTime Updated_at
When this item was last updated.
Definition LootLockerItemRequestHandler.h:225
Represents an item template that can be granted to players.
Definition LootLockerItemRequestHandler.h:135
FDateTime Created_at
When this item template was created.
Definition LootLockerItemRequestHandler.h:164
bool Consumable
Whether this item can be consumed.
Definition LootLockerItemRequestHandler.h:156
ELootLockerItemType Item_type
The type of the item (instanced or stackable).
Definition LootLockerItemRequestHandler.h:152
FString Id
The ULID of the item template.
Definition LootLockerItemRequestHandler.h:140
bool Deletable
Whether instances of this item can be deleted by players.
Definition LootLockerItemRequestHandler.h:160
FString Name
The name of the item template.
Definition LootLockerItemRequestHandler.h:144
FDateTime Updated_at
When this item template was last updated.
Definition LootLockerItemRequestHandler.h:168
int32 Limited
Whether this template is limited (0 for not limited, otherwise the limit).
Definition LootLockerItemRequestHandler.h:148
Response for listing item templates.
Definition LootLockerItemRequestHandler.h:324
TArray< FLootLockerItemTemplate > Items
List of item templates according to the requested pagination.
Definition LootLockerItemRequestHandler.h:329
FLootLockerExtendedIndexBasedPagination Pagination
Pagination information for the item templates returned.
Definition LootLockerItemRequestHandler.h:333
Response for listing a player's inventory items.
Definition LootLockerItemRequestHandler.h:344
FLootLockerExtendedIndexBasedPagination Pagination
Pagination information for the items returned.
Definition LootLockerItemRequestHandler.h:353
void PopulateConvenienceStructures()
Populate convenience structures (parsed metadata) from the raw response.
TArray< FLootLockerInventoryItem > Items
List of the player's items according to the requested filters and pagination.
Definition LootLockerItemRequestHandler.h:349
Request to merge two item stacks into one.
Definition LootLockerItemRequestHandler.h:301
FString Source_inventory_id
The ULID of the item stack to take items from.
Definition LootLockerItemRequestHandler.h:306
FString Target_inventory_id
The ULID of the item stack that will receive the items.
Definition LootLockerItemRequestHandler.h:310
Response for merging two item stacks.
Definition LootLockerItemRequestHandler.h:458
Represents a single typed metadata entry with a key, value type, tags, and access level,...
Definition LootLockerMetadataRequestHandler.h:118
Definition LootLockerPlayerData.h:12
Base response struct — every SDK callback receives a struct that derives from this.
Definition LootLockerResponse.h:19
Request to split a stackable item into two stacks.
Definition LootLockerItemRequestHandler.h:288
int32 Count
How many items to move to the new stack.
Definition LootLockerItemRequestHandler.h:293
Response for splitting an item stack.
Definition LootLockerItemRequestHandler.h:445
FString Id
The ULID of the newly created item stack.
Definition LootLockerItemRequestHandler.h:450