2026-03-29 07:54:19 -04:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "UI/APITest/APITestManager.h"
|
2026-03-29 20:20:59 -04:00
|
|
|
#include "HttpModule.h"
|
|
|
|
|
#include "Data/API/APIData.h"
|
|
|
|
|
#include "GameplayTags/DedicatedServerTags.h"
|
2026-03-29 07:54:19 -04:00
|
|
|
|
|
|
|
|
void UAPITestManager::ListFleetsButtonClicked()
|
|
|
|
|
{
|
2026-03-29 20:20:59 -04:00
|
|
|
check(APIData);
|
|
|
|
|
|
|
|
|
|
TSharedPtr<IHttpRequest> Request = FHttpModule::Get().CreateRequest();
|
|
|
|
|
Request->OnProcessRequestComplete().BindUObject(this, &UAPITestManager::ListFleets_Response);
|
|
|
|
|
|
|
|
|
|
const FString APIUrl = APIData->GetAPIEndPoint(DedicatedServersTags::GameSessionsAPI::ListFleets);
|
|
|
|
|
|
|
|
|
|
Request->SetURL(APIUrl);
|
|
|
|
|
Request->SetVerb("GET");
|
|
|
|
|
Request->SetHeader("Content-Type", "application/json");
|
|
|
|
|
Request->ProcessRequest();
|
|
|
|
|
|
|
|
|
|
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "List Fleets Request Made");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UAPITestManager::ListFleets_Response(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
|
|
|
|
|
{
|
|
|
|
|
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "List Fleets Response Received");
|
2026-03-29 07:54:19 -04:00
|
|
|
}
|