LootLocker Unreal SDK 10.7.0
Game backend SDK for Unreal Engine
Loading...
Searching...
No Matches
LootLockerHTTPRequestData.h
Go to the documentation of this file.
1// Copyright (c) 2021 LootLocker
2
3#pragma once
4
5#include "CoreMinimal.h"
8
14struct LOOTLOCKERSDK_API FLootLockerHTTPRequestData
15{
19 FString RequestId = TEXT("");
20
26 FString ForPlayerUlid = TEXT("");
27
29 FString Endpoint = TEXT("");
30
32 FString Verb = TEXT("");
33
35 FString Body = TEXT("");
36
38 TMap<FString, FString> ExtraHeaders;
39
45
51 TArray<FResponseCallback> Listeners;
52
54 int32 TimesRetried = 0;
55
60 double RequestStartTime = 0.0;
61
67 FDateTime RequestStartDateTime = FDateTime(0);
68
74
75 // --- File-upload fields (only meaningful when bIsFileUpload == true) ---
76
78 bool bIsFileUpload = false;
79
81 FString FilePath = TEXT("");
82
84 TMap<FString, FString> AdditionalFields;
85
86 // --- Helpers ---
87
96
97 bool operator==(const FLootLockerHTTPRequestData& Other) const
98 {
99 return RequestId == Other.RequestId;
100 }
101
102 bool operator!=(const FLootLockerHTTPRequestData& Other) const
103 {
104 return !(*this == Other);
105 }
106};
Captures everything needed to dispatch — and later retry — a single SDK HTTP request.
Definition LootLockerHTTPRequestData.h:15
FLootLockerPlayerData PlayerData
Player session data used for auth-token injection and session-refresh decisions.
Definition LootLockerHTTPRequestData.h:44
FString Body
JSON body string.
Definition LootLockerHTTPRequestData.h:35
TMap< FString, FString > AdditionalFields
Additional form-data fields to include alongside the file (only used when bIsFileUpload is true).
Definition LootLockerHTTPRequestData.h:84
double RequestStartTime
Wall-clock time (FPlatformTime::Seconds()) when the request was first submitted to the queue.
Definition LootLockerHTTPRequestData.h:60
bool bIsFileUpload
True when this request represents a file upload rather than a JSON call.
Definition LootLockerHTTPRequestData.h:78
FString FilePath
Absolute path to the file to upload (only used when bIsFileUpload is true).
Definition LootLockerHTTPRequestData.h:81
bool HaveListenersBeenInvoked
True once all Listeners have been invoked via CallListenersWithResult().
Definition LootLockerHTTPRequestData.h:73
TArray< FResponseCallback > Listeners
Registered completion callbacks.
Definition LootLockerHTTPRequestData.h:51
void CallListenersWithResult(const FLootLockerResponse &Response)
Invokes every registered Listener with the supplied Response.
bool operator==(const FLootLockerHTTPRequestData &Other) const
Definition LootLockerHTTPRequestData.h:97
int32 TimesRetried
Number of retry attempts made for this request so far.
Definition LootLockerHTTPRequestData.h:54
FString RequestId
Unique identifier for this request.
Definition LootLockerHTTPRequestData.h:19
FDateTime RequestStartDateTime
UTC calendar time when the request was first submitted to the queue.
Definition LootLockerHTTPRequestData.h:67
FString ForPlayerUlid
ULID of the player this request is being made on behalf of.
Definition LootLockerHTTPRequestData.h:26
TMap< FString, FString > ExtraHeaders
Additional headers to merge on top of the SDK defaults for this request.
Definition LootLockerHTTPRequestData.h:38
bool operator!=(const FLootLockerHTTPRequestData &Other) const
Definition LootLockerHTTPRequestData.h:102
FString Endpoint
Fully-formed URL endpoint (before any run-time query-param appending).
Definition LootLockerHTTPRequestData.h:29
FString Verb
HTTP verb ("GET", "POST", "PUT", "PATCH", "DELETE", …).
Definition LootLockerHTTPRequestData.h:32
Definition LootLockerPlayerData.h:12
Base response struct — every SDK callback receives a struct that derives from this.
Definition LootLockerResponse.h:19