Lesson 63 - Parsing the Payload

This commit is contained in:
Norman Lansing
2026-03-16 06:46:34 -04:00
parent 7f154aa6f9
commit 30c1e42379
3 changed files with 33 additions and 0 deletions

View File

@@ -42,5 +42,9 @@ void UAPITestManager::ListFleets_Response(FHttpRequestPtr Request, FHttpResponse
FJsonObjectConverter::JsonObjectToUStruct(MetaDataJsonObject.ToSharedRef(), &DSMetaData); FJsonObjectConverter::JsonObjectToUStruct(MetaDataJsonObject.ToSharedRef(), &DSMetaData);
DSMetaData.Dump(); DSMetaData.Dump();
} }
FDS_ListFleetsResponse ListFleetsResponse;
FJsonObjectConverter::JsonObjectToUStruct(JsonObject.ToSharedRef(), &ListFleetsResponse);
ListFleetsResponse.Dump();
} }
} }

View File

@@ -9,3 +9,16 @@ void FDS_MetaData::Dump() const
UE_LOGFMT(LogDedicatedServers, Log, "attemps: {attempts}", attempts); UE_LOGFMT(LogDedicatedServers, Log, "attemps: {attempts}", attempts);
UE_LOGFMT(LogDedicatedServers, Log, "totalRetryDelay: {totalRetryDelay}", totalRetryDelay); UE_LOGFMT(LogDedicatedServers, Log, "totalRetryDelay: {totalRetryDelay}", totalRetryDelay);
} }
void FDS_ListFleetsResponse::Dump() const
{
UE_LOGFMT(LogDedicatedServers, Log, "ListFleetsResponse:");
for (const FString& FleetId : FleetIds)
{
UE_LOGFMT(LogDedicatedServers, Log, "FleetId: {FleetId}", FleetId);
}
if (!NextToken.IsEmpty())
{
UE_LOGFMT(LogDedicatedServers, Log, "NextToken: {NextToken}", NextToken);
}
}

View File

@@ -23,5 +23,21 @@ public:
UPROPERTY() UPROPERTY()
double totalRetryDelay{}; double totalRetryDelay{};
void Dump() const;
};
USTRUCT()
struct FDS_ListFleetsResponse
{
GENERATED_BODY()
public:
UPROPERTY()
TArray<FString> FleetIds{};
UPROPERTY()
FString NextToken{};
void Dump() const; void Dump() const;
}; };