diff --git a/Content/DedicatedServers/APITest/BP_APITestManager.uasset b/Content/DedicatedServers/APITest/BP_APITestManager.uasset new file mode 100644 index 00000000..181fdde2 Binary files /dev/null and b/Content/DedicatedServers/APITest/BP_APITestManager.uasset differ diff --git a/Content/DedicatedServers/Data/DA_GameSessionsAPIData.uasset b/Content/DedicatedServers/Data/DA_GameSessionsAPIData.uasset new file mode 100644 index 00000000..c09a4c1a Binary files /dev/null and b/Content/DedicatedServers/Data/DA_GameSessionsAPIData.uasset differ diff --git a/Source/DedicatedServers/DedicatedServers.Build.cs b/Source/DedicatedServers/DedicatedServers.Build.cs index 1ce4533f..2c2bbbe8 100644 --- a/Source/DedicatedServers/DedicatedServers.Build.cs +++ b/Source/DedicatedServers/DedicatedServers.Build.cs @@ -14,7 +14,8 @@ public class DedicatedServers : ModuleRules { "Core", "CoreUObject", - "Engine" + "Engine", + "GameplayTags" }); PrivateDependencyModuleNames.AddRange(new string[] diff --git a/Source/DedicatedServers/Private/Data/API/APIData.cpp b/Source/DedicatedServers/Private/Data/API/APIData.cpp new file mode 100644 index 00000000..658f0f83 --- /dev/null +++ b/Source/DedicatedServers/Private/Data/API/APIData.cpp @@ -0,0 +1,11 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Data/API/APIData.h" + +FString UAPIData::GetAPIEndpoint(const FGameplayTag& APIEndpoint) +{ + const FString ResourceName = Resources.FindChecked(APIEndpoint); + + return InvokeUrl + "/" + Stage + "/" + ResourceName; +} diff --git a/Source/DedicatedServers/Private/GameplayTags/DedicatedServersTags.cpp b/Source/DedicatedServers/Private/GameplayTags/DedicatedServersTags.cpp new file mode 100644 index 00000000..77f8c8f8 --- /dev/null +++ b/Source/DedicatedServers/Private/GameplayTags/DedicatedServersTags.cpp @@ -0,0 +1,9 @@ +#include "GameplayTags/DedicatedServersTags.h" + +namespace DedicatedServersTags +{ + namespace GameSessionsAPI + { + UE_DEFINE_GAMEPLAY_TAG_COMMENT(ListFleets, "DedicatedServersTags.GameSessionsAPI.ListFleets", "List Fleets resource on the Game Session Resource") + } +} \ No newline at end of file diff --git a/Source/DedicatedServers/Public/Data/API/APIData.h b/Source/DedicatedServers/Public/Data/API/APIData.h new file mode 100644 index 00000000..94507cf5 --- /dev/null +++ b/Source/DedicatedServers/Public/Data/API/APIData.h @@ -0,0 +1,38 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Engine/DataAsset.h" +#include "GameplayTags/DedicatedServersTags.h" +#include "APIData.generated.h" + +/** + * + */ +UCLASS() +class DEDICATEDSERVERS_API UAPIData : public UDataAsset +{ + GENERATED_BODY() + +public: + FString GetAPIEndpoint(const FGameplayTag& APIEndpoint); + +protected: + + // Name of the API - for labeling in the Data Asset; this is not used by any code. + + UPROPERTY(EditAnywhere) + FString Name; + + UPROPERTY(EditDefaultsOnly) + FString InvokeUrl; + + UPROPERTY(EditDefaultsOnly) + FString Stage; + + UPROPERTY(EditDefaultsOnly) + TMap Resources; + + +}; diff --git a/Source/DedicatedServers/Public/GameplayTags/DedicatedServersTags.h b/Source/DedicatedServers/Public/GameplayTags/DedicatedServersTags.h new file mode 100644 index 00000000..4488ae6c --- /dev/null +++ b/Source/DedicatedServers/Public/GameplayTags/DedicatedServersTags.h @@ -0,0 +1,12 @@ +#pragma once + +#include "CoreMinimal.h" +#include "NativeGameplayTags.h" + +namespace DedicatedServersTags +{ + namespace GameSessionsAPI + { + UE_DECLARE_GAMEPLAY_TAG_EXTERN(ListFleets) + } +} \ No newline at end of file diff --git a/Source/DedicatedServers/Public/UI/HTTP/HTTPRequestManager.h b/Source/DedicatedServers/Public/UI/HTTP/HTTPRequestManager.h index aea59058..a90a0d39 100644 --- a/Source/DedicatedServers/Public/UI/HTTP/HTTPRequestManager.h +++ b/Source/DedicatedServers/Public/UI/HTTP/HTTPRequestManager.h @@ -6,6 +6,8 @@ #include "UObject/Object.h" #include "HTTPRequestManager.generated.h" +class UAPIData; + /** * */ @@ -14,5 +16,10 @@ class DEDICATEDSERVERS_API UHTTPRequestManager : public UObject { GENERATED_BODY() +protected: + + UPROPERTY(EditDefaultsOnly) + TObjectPtr APIData; + };