LootLocker Unreal SDK 11.1.0
Game backend SDK for Unreal Engine
Loading...
Searching...
No Matches
LootLockerEquipmentRequestHandler.h
Go to the documentation of this file.
1// Copyright LootLocker AB
2
3#pragma once
4
5#include "CoreMinimal.h"
8#include "LootLockerEquipmentRequestHandler.generated.h"
9
10//==================================================
11// Request Definitions
12//==================================================
13
16UENUM(BlueprintType, Category = "LootLocker")
21{
23 Unset = 0 UMETA(DisplayName = "Server default"),
28};
29
30
34USTRUCT(BlueprintType, Category = "LootLocker")
36{
37 GENERATED_BODY()
38
39
40 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
41 FString entity_type = "player";
42
44 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
45 FString source_id = "";
46
48 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
49 FString slot_id = "";
50
52 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
53 FString inventory_id = "";
54
56 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
57 int32 count = 0;
58
60 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
62};
63
64//==================================================
65// Data Definitions
66//==================================================
67
71USTRUCT(BlueprintType, Category = "LootLocker")
73{
74 GENERATED_BODY()
75
76
77 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
78 FString id = "";
79
81 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
82 FString name = "";
83
85 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
86 bool deletable = false;
87};
88
92USTRUCT(BlueprintType, Category = "LootLocker")
94{
95 GENERATED_BODY()
96
97
98 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
99 FString id = "";
100
102 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
103 FString slot_key = "";
104
106 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
107 FString name = "";
108
110 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
111 int32 max_items = 0;
112
114 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
115 TArray<FString> tags;
116};
117
121USTRUCT(BlueprintType, Category = "LootLocker")
123{
124 GENERATED_BODY()
125
126
127 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
128 FString entry_id = "";
129
131 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
132 FString inventory_id = "";
133
135 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
136 int32 count = 0;
137
139 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
141
146 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
147 bool valid = true;
148
150 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
151 bool over_limit = false;
152
154 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
155 FString mounted_at = "";
156};
157
161USTRUCT(BlueprintType, Category = "LootLocker")
163{
164 GENERATED_BODY()
165
166
167 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
169
171 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
173
175 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
176 bool HasStack = false;
177};
178
182USTRUCT(BlueprintType, Category = "LootLocker")
184{
185 GENERATED_BODY()
186
187
188 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
189 FString id = "";
190
192 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
193 FString group_key = "";
194
196 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
197 FString name = "";
198
200 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
201 FString entity_type = "";
202
204 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
206};
207
211USTRUCT(BlueprintType, Category = "LootLocker")
213{
214 GENERATED_BODY()
215
216
217 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
218 FString inventory_id = "";
219
221 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
223
225 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
226 FString item_type = "";
227
229 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
230 int32 count = 0;
231
233 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
234 int32 equippable = 0;
235};
236
237//==================================================
238// Response Definitions
239//==================================================
240
244USTRUCT(BlueprintType, Category = "LootLocker")
246{
247 GENERATED_BODY()
248
249
250 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
252
254 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
256};
257
261USTRUCT(BlueprintType, Category = "LootLocker")
263{
264 GENERATED_BODY()
265
266
267 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
269
271 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
273
275 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
277};
278
282USTRUCT(BlueprintType, Category = "LootLocker")
284{
285 GENERATED_BODY()
286
287
288 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
289 FString entry_id = "";
290
292 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
293 FString slot_id = "";
294
296 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
297 FString inventory_id = "";
298
300 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
301 int32 equipped = 0;
302
304 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
305 int32 remainder = 0;
306
308 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLocker")
309 FString replaced_entry_id = "";
310};
311
314
316
319
323
324UCLASS()
325class LOOTLOCKERSDK_API ULLEquipmentRequestHandler : public UObject
326{
327 GENERATED_BODY()
328public:
330
331 static FString GetLoadout(const FLootLockerPlayerData& PlayerData, int32 Page, int32 PerPage, const FLootLockerEquipmentLoadoutResponseDelegate& OnCompletedRequest);
332 static FString GetEntityLoadout(const FLootLockerPlayerData& PlayerData, const FString& EntityType, const FString& SourceId, int32 Page, int32 PerPage, const FLootLockerEquipmentLoadoutResponseDelegate& OnCompletedRequest);
333 static FString GetOtherPlayerLoadout(const FLootLockerPlayerData& PlayerData, const FString& PlayerPublicUid, int32 Page, int32 PerPage, const FLootLockerEquipmentLoadoutResponseDelegate& OnCompletedRequest);
334 static FString ListSlotCandidates(const FLootLockerPlayerData& PlayerData, const FString& SlotId, int32 Page, int32 PerPage, const FLootLockerEquipmentSlotCandidatesResponseDelegate& OnCompletedRequest);
335 static FString EquipStack(const FLootLockerPlayerData& PlayerData, const FLootLockerEquipmentEquipRequest& Request, const FLootLockerEquipmentEquipResponseDelegate& OnCompletedRequest);
336 static FString UnequipStack(const FLootLockerPlayerData& PlayerData, const FString& EntryId, const FLootLockerDefaultDelegate& OnCompletedRequest);
337};
void(* FLootLockerDefaultDelegate)(FLootLockerResponse)
Definition LootLockerResponse.h:38
static FString GetOtherPlayerLoadout(const FLootLockerPlayerData &PlayerData, const FString &PlayerPublicUid, int32 Page, int32 PerPage, const FLootLockerEquipmentLoadoutResponseDelegate &OnCompletedRequest)
static FString GetLoadout(const FLootLockerPlayerData &PlayerData, int32 Page, int32 PerPage, const FLootLockerEquipmentLoadoutResponseDelegate &OnCompletedRequest)
ULLEquipmentRequestHandler()
Definition LootLockerEquipmentRequestHandler.h:329
static FString EquipStack(const FLootLockerPlayerData &PlayerData, const FLootLockerEquipmentEquipRequest &Request, const FLootLockerEquipmentEquipResponseDelegate &OnCompletedRequest)
static FString ListSlotCandidates(const FLootLockerPlayerData &PlayerData, const FString &SlotId, int32 Page, int32 PerPage, const FLootLockerEquipmentSlotCandidatesResponseDelegate &OnCompletedRequest)
static FString UnequipStack(const FLootLockerPlayerData &PlayerData, const FString &EntryId, const FLootLockerDefaultDelegate &OnCompletedRequest)
static FString GetEntityLoadout(const FLootLockerPlayerData &PlayerData, const FString &EntityType, const FString &SourceId, int32 Page, int32 PerPage, const FLootLockerEquipmentLoadoutResponseDelegate &OnCompletedRequest)
ELootLockerEquipmentReplaceMode
Whether an occupied equipment slot should be auto-unequipped when equipping into it.
Definition LootLockerEquipmentRequestHandler.h:21
void(* FLootLockerEquipmentSlotCandidatesResponseDelegate)(FLootLockerEquipmentSlotCandidatesResponse)
C++ response callback delegate; receives an FLootLockerEquipmentSlotCandidatesResponse result.
Definition LootLockerEquipmentRequestHandler.h:318
void(* FLootLockerEquipmentLoadoutResponseDelegate)(FLootLockerEquipmentLoadoutResponse)
C++ response callback delegate; receives an FLootLockerEquipmentLoadoutResponse result.
Definition LootLockerEquipmentRequestHandler.h:315
void(* FLootLockerEquipmentEquipResponseDelegate)(FLootLockerEquipmentEquipResponse)
C++ response callback delegate; receives an FLootLockerEquipmentEquipResponse result.
Definition LootLockerEquipmentRequestHandler.h:321
@ Replace
Auto-unequip the stack already occupying the slot.
Definition LootLockerEquipmentRequestHandler.h:25
@ Unset
Leave replace out of the request so the server applies its own default.
Definition LootLockerEquipmentRequestHandler.h:23
@ Conflict
Do not replace the occupant; the request fails with a conflict instead.
Definition LootLockerEquipmentRequestHandler.h:27
An unequipped inventory stack that a slot would accept.
Definition LootLockerEquipmentRequestHandler.h:213
FString inventory_id
The ULID of the inventory stack.
Definition LootLockerEquipmentRequestHandler.h:218
FString item_type
The item type of the stack.
Definition LootLockerEquipmentRequestHandler.h:226
int32 equippable
The amount an equip would attach right now, which is count capped at the slot's max_items.
Definition LootLockerEquipmentRequestHandler.h:234
FLootLockerEquipmentItemTemplate item_template
A summary of the item template this stack was created from.
Definition LootLockerEquipmentRequestHandler.h:222
int32 count
The number of items in the inventory stack.
Definition LootLockerEquipmentRequestHandler.h:230
Request to equip an inventory stack into an equipment slot on an entity.
Definition LootLockerEquipmentRequestHandler.h:36
ELootLockerEquipmentReplaceMode replace
Optional: Whether a stack already occupying the slot should be auto-unequipped.
Definition LootLockerEquipmentRequestHandler.h:61
FString source_id
The ULID of the entity.
Definition LootLockerEquipmentRequestHandler.h:45
FString slot_id
The ULID of the equipment slot to equip into.
Definition LootLockerEquipmentRequestHandler.h:49
int32 count
Optional: The amount to equip.
Definition LootLockerEquipmentRequestHandler.h:57
FString entity_type
The entity the loadout hangs off.
Definition LootLockerEquipmentRequestHandler.h:41
FString inventory_id
The ULID of the inventory stack to equip.
Definition LootLockerEquipmentRequestHandler.h:53
Response describing what an equip did.
Definition LootLockerEquipmentRequestHandler.h:284
FString replaced_entry_id
The entry that was auto-unequipped to make room, if any.
Definition LootLockerEquipmentRequestHandler.h:309
FString inventory_id
The ULID of the attached inventory row, which is a fresh split row when the stack was split.
Definition LootLockerEquipmentRequestHandler.h:297
FString slot_id
The ULID of the slot the stack was equipped into.
Definition LootLockerEquipmentRequestHandler.h:293
FString entry_id
The equipment entry ULID, used to unequip the stack.
Definition LootLockerEquipmentRequestHandler.h:289
int32 equipped
The amount now attached to the slot.
Definition LootLockerEquipmentRequestHandler.h:301
int32 remainder
The amount left on the source inventory stack.
Definition LootLockerEquipmentRequestHandler.h:305
An equipment group as reported by a loadout read.
Definition LootLockerEquipmentRequestHandler.h:184
FString entity_type
The entity type this group serves.
Definition LootLockerEquipmentRequestHandler.h:201
TArray< FLootLockerEquipmentSlotAndStack > slots
The group's slots with the stack attached to each.
Definition LootLockerEquipmentRequestHandler.h:205
FString group_key
The stable machine key of the group.
Definition LootLockerEquipmentRequestHandler.h:193
FString name
The display name of the group.
Definition LootLockerEquipmentRequestHandler.h:197
A summary of the item template an equipped stack was created from.
Definition LootLockerEquipmentRequestHandler.h:73
FString name
The name of the item template.
Definition LootLockerEquipmentRequestHandler.h:82
bool deletable
Whether an inventory row of this template may be deleted.
Definition LootLockerEquipmentRequestHandler.h:86
Response containing a player's loadout: the groups for the entity's type, each with its slots and att...
Definition LootLockerEquipmentRequestHandler.h:246
TArray< FLootLockerEquipmentGroup > groups
The equipment groups serving the entity's type, paged over groups.
Definition LootLockerEquipmentRequestHandler.h:251
FLootLockerExtendedIndexBasedPagination pagination
Pagination information for the groups.
Definition LootLockerEquipmentRequestHandler.h:255
An equipment slot together with the stack attached to it, if any.
Definition LootLockerEquipmentRequestHandler.h:163
FLootLockerEquipmentStack stack
The attached stack.
Definition LootLockerEquipmentRequestHandler.h:172
bool HasStack
Whether a stack is attached to this slot.
Definition LootLockerEquipmentRequestHandler.h:176
FLootLockerEquipmentSlot slot
The slot definition.
Definition LootLockerEquipmentRequestHandler.h:168
Response containing the inventory stacks that a slot would accept for the calling player.
Definition LootLockerEquipmentRequestHandler.h:263
FLootLockerExtendedIndexBasedPagination pagination
Pagination information for the candidates.
Definition LootLockerEquipmentRequestHandler.h:276
FLootLockerEquipmentSlot slot
The slot the candidates were listed for.
Definition LootLockerEquipmentRequestHandler.h:268
TArray< FLootLockerEquipmentCandidate > candidates
The caller's unequipped stacks whose item template shares a tag with the slot.
Definition LootLockerEquipmentRequestHandler.h:272
An equipment slot definition belonging to an equipment group.
Definition LootLockerEquipmentRequestHandler.h:94
int32 max_items
The maximum number of items the slot holds.
Definition LootLockerEquipmentRequestHandler.h:111
FString name
The display name of the slot.
Definition LootLockerEquipmentRequestHandler.h:107
TArray< FString > tags
The tags an item template must share at least one of for the slot to accept it.
Definition LootLockerEquipmentRequestHandler.h:115
FString slot_key
The stable machine key of the slot, unique within its group.
Definition LootLockerEquipmentRequestHandler.h:103
A stack currently attached to an equipment slot.
Definition LootLockerEquipmentRequestHandler.h:123
FString mounted_at
When the stack was attached to the slot.
Definition LootLockerEquipmentRequestHandler.h:155
FString inventory_id
The ULID of the inventory row holding the equipped items.
Definition LootLockerEquipmentRequestHandler.h:132
bool valid
False when the item template's tags and the slot's tags no longer intersect.
Definition LootLockerEquipmentRequestHandler.h:147
FString entry_id
The equipment entry ULID.
Definition LootLockerEquipmentRequestHandler.h:128
int32 count
The number of items currently in the slot.
Definition LootLockerEquipmentRequestHandler.h:136
bool over_limit
True when the attached count exceeds the slot's max_items, for example after max_items was lowered.
Definition LootLockerEquipmentRequestHandler.h:151
FLootLockerEquipmentItemTemplate item_template
A summary of the item template this stack was created from.
Definition LootLockerEquipmentRequestHandler.h:140
Definition LootLockerResponse.h:101
Definition LootLockerPlayerData.h:12
Base response struct — every SDK callback receives a struct that derives from this.
Definition LootLockerResponse.h:19