Lesson 59 - Game Sessions API Data Asset

This commit is contained in:
Norman Lansing
2026-03-29 19:56:25 -04:00
parent a487c71b44
commit 62243acf46
9 changed files with 103 additions and 23 deletions

View File

@@ -118,10 +118,8 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="91dd7ef3-692f-484d-9bd1-060b29650efd" name="Changes" comment=""> <list default="true" id="91dd7ef3-692f-484d-9bd1-060b29650efd" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.FPSTemplate.dir/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.FPSTemplate.dir/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/.idea.FPSTemplate.dir/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.FPSTemplate.dir/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/DedicatedServers/APITest/UI/WBP_APITestOverlay.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/DedicatedServers/APITest/UI/WBP_APITestOverlay.uasset" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Source/DedicatedServers/DedicatedServers.build.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Source/DedicatedServers/DedicatedServers.build.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/DedicatedServers/Private/UI/APITest/APITestOverlay.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/DedicatedServers/Private/UI/APITest/APITestOverlay.cpp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Source/DedicatedServers/Public/UI/HTTP/HTTPRequestManager.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/DedicatedServers/Public/UI/HTTP/HTTPRequestManager.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/DedicatedServers/Public/UI/API/ListFleets/ListFleetsBox.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/DedicatedServers/Public/UI/API/ListFleets/ListFleetsBox.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/DedicatedServers/Public/UI/APITest/APITestOverlay.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/DedicatedServers/Public/UI/APITest/APITestOverlay.h" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -141,13 +139,17 @@
</component> </component>
<component name="HighlightingSettingsPerFile"> <component name="HighlightingSettingsPerFile">
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/DedicatedServers.Build.cs" root0="SKIP_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Source/DedicatedServers/DedicatedServers.Build.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/Data/API/APIData.cpp" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/Game/DS_GameMode.cpp" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/Game/DS_GameMode.cpp" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/GameplayTags/DedicatedServerTags.cpp" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/UI/API/ListFleets/FleetId.cpp" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/UI/API/ListFleets/FleetId.cpp" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/UI/API/ListFleets/ListFleetsBox.cpp" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/UI/API/ListFleets/ListFleetsBox.cpp" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/UI/APITest/APITestHUD.cpp" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/UI/APITest/APITestHUD.cpp" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/UI/APITest/APITestManager.cpp" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/UI/APITest/APITestManager.cpp" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/UI/HTTP/HTTPRequestManager.cpp" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Private/UI/HTTP/HTTPRequestManager.cpp" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Public/Data/API/APIData.h" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Public/Game/DS_GameMode.h" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Public/Game/DS_GameMode.h" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Public/GameplayTags/DedicatedServerTags.h" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Public/UI/API/ListFleets/FleetId.h" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Public/UI/API/ListFleets/FleetId.h" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Public/UI/API/ListFleets/ListFleetsBox.h" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Public/UI/API/ListFleets/ListFleetsBox.h" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Public/UI/APITest/APITestHUD.h" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/Source/DedicatedServers/Public/UI/APITest/APITestHUD.h" root0="FORCE_HIGHLIGHTING" />
@@ -175,25 +177,25 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"ModuleVcsDetector.initialDetectionPerformed": "true", &quot;ModuleVcsDetector.initialDetectionPerformed&quot;: &quot;true&quot;,
"RunOnceActivity.MCP Project settings loaded": "true", &quot;RunOnceActivity.MCP Project settings loaded&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.git.unshallow": "true", &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
"RunOnceActivity.typescript.service.memoryLimit.init": "true", &quot;RunOnceActivity.typescript.service.memoryLimit.init&quot;: &quot;true&quot;,
"Uproject.FPSTemplate.executor": "Run", &quot;Uproject.FPSTemplate.executor&quot;: &quot;Run&quot;,
"git-widget-placeholder": "new/API__Gateway__v2", &quot;git-widget-placeholder&quot;: &quot;new/API__Gateway__v2&quot;,
"ignore.virus.scanning.warn.message": "true", &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"settings.editor.selected.configurable": "ml.llm.AcpAgentsConfigurable", &quot;settings.editor.selected.configurable&quot;: &quot;ml.llm.AcpAgentsConfigurable&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="RunManager" selected="Uproject.FPSTemplate"> <component name="RunManager" selected="Uproject.FPSTemplate">
<configuration name="UnrealAndroidFileTool: UAFT-linux-x64" type="DotNetMsBuildPublish" factoryName="Publish to IIS"> <configuration name="UnrealAndroidFileTool: UAFT-linux-x64" type="DotNetMsBuildPublish" factoryName="Publish to IIS">
<riderPublish publish_profile="UAFT-linux-x64.pubxml" pubxml_path="$PROJECT_DIR$/../../UE_5_7_3/Engine/Source/Programs/UnrealAndroidFileTool/Properties/PublishProfiles/UAFT-linux-x64.pubxml" uuid_high="7955553615007426355" uuid_low="1901880150328835101" /> <riderPublish publish_profile="UAFT-linux-x64.pubxml" pubxml_path="$PROJECT_DIR$/../../UE_5_7_3/Engine/Source/Programs/UnrealAndroidFileTool/Properties/PublishProfiles/UAFT-linux-x64.pubxml" uuid_high="7955553615007426355" uuid_low="1901880150328835101" />
@@ -64922,7 +64924,8 @@
<workItem from="1773536227018" duration="61902000" /> <workItem from="1773536227018" duration="61902000" />
<workItem from="1774233517830" duration="18186000" /> <workItem from="1774233517830" duration="18186000" />
<workItem from="1774317832300" duration="32871000" /> <workItem from="1774317832300" duration="32871000" />
<workItem from="1774531822750" duration="17428000" /> <workItem from="1774531822750" duration="19882000" />
<workItem from="1774817723065" duration="6192000" />
</task> </task>
<task id="LOCAL-00001" summary="Added in EC2 support and adjusted Anywhere if statement to allow EC2 and to clean uip variable placement."> <task id="LOCAL-00001" summary="Added in EC2 support and adjusted Anywhere if statement to allow EC2 and to clean uip variable placement.">
<option name="closed" value="true" /> <option name="closed" value="true" />

View File

@@ -13,6 +13,7 @@ public class DedicatedServers : ModuleRules
"CoreUObject", "CoreUObject",
"Engine", "Engine",
"OpenSSL", "OpenSSL",
"GameplayTags"
}); });
PrivateDependencyModuleNames.AddRange(new string[] PrivateDependencyModuleNames.AddRange(new string[]

View File

@@ -0,0 +1,10 @@
// 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;
}

View File

@@ -0,0 +1,9 @@
#include "GameplayTags/DedicatedServerTags.h"
namespace DedicatedServersTags
{
namespace GameSessionsAPI
{
UE_DEFINE_GAMEPLAY_TAG_COMMENT(ListFleets, "DedicatedServersTags.GameSessionsAPI.ListFleets", "List Fleets resource on the GameSessions API")
}
}

View File

@@ -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/DedicatedServerTags.h"
#include "APIData.generated.h"
/**
*
*/
UCLASS()
class DEDICATEDSERVERS_API UAPIData : public UDataAsset
{
GENERATED_BODY()
public:
FString GetAPIEndPoint(const FGameplayTag& APIEndPoint);
protected:
// Name of this API - for labeling in the Data Asset; This is nto used by any code.
UPROPERTY(EditDefaultsOnly)
FString Name;
UPROPERTY(EditDefaultsOnly)
FString InvokeUrl;
UPROPERTY(EditDefaultsOnly)
FString Stage;
UPROPERTY(EditDefaultsOnly)
TMap<FGameplayTag, FString> Resources;
};

View File

@@ -0,0 +1,12 @@
#pragma once
#include "CoreMinimal.h"
#include "NativeGameplayTags.h"
namespace DedicatedServersTags
{
namespace GameSessionsAPI
{
UE_DECLARE_GAMEPLAY_TAG_EXTERN(ListFleets);
}
}

View File

@@ -6,6 +6,8 @@
#include "UObject/Object.h" #include "UObject/Object.h"
#include "HTTPRequestManager.generated.h" #include "HTTPRequestManager.generated.h"
class UAPIData;
/** /**
* *
*/ */
@@ -13,4 +15,9 @@ UCLASS(Blueprintable)
class DEDICATEDSERVERS_API UHTTPRequestManager : public UObject class DEDICATEDSERVERS_API UHTTPRequestManager : public UObject
{ {
GENERATED_BODY() GENERATED_BODY()
protected:
UPROPERTY(EditDefaultsOnly)
TObjectPtr<UAPIData> APIData;
}; };