Lesson 63 - Parsing the Payload
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,3 +25,19 @@ public:
|
|||||||
|
|
||||||
void Dump() const;
|
void Dump() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
USTRUCT()
|
||||||
|
struct FDS_ListFleetsResponse
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
TArray<FString> FleetIds{};
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
FString NextToken{};
|
||||||
|
|
||||||
|
void Dump() const;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user