Lesson 83 - Travelling To The Server

This commit is contained in:
Norman Lansing
2026-04-05 20:57:35 -04:00
parent 03867600b8
commit b7c4a07d00

View File

@@ -9,6 +9,7 @@
#include "GameFramework/PlayerState.h"
#include "GameplayTags/DedicatedServerTags.h"
#include "Interfaces/IHttpResponse.h"
#include "Kismet/GameplayStatics.h"
#include "UI/HTTP/HTTPRequestTypes.h"
void UPortalManager::JoinGameSession()
@@ -163,5 +164,9 @@ void UPortalManager::FindPlayerSession_Response(FHttpRequestPtr Request, FHttpRe
FJsonObjectConverter::JsonObjectToUStruct(JsonObject.ToSharedRef(), &PlayerSession);
PlayerSession.Dump();
const FString IPAndPort = PlayerSession.IpAddress + TEXT(":") + FString::FromInt(PlayerSession.Port);
const FName Address(*IPAndPort);
UGameplayStatics::OpenLevel(this, Address);
}
}