Thank you for the help last time, I was wondering if anyone could spot if I’m doing something wrong here…
When attempting to connect to myself near the end of the coop tutorial (JoinSession)
The client successfully finds and “Joins” the server, but seemingly does not load into the server. The server does not see a new client, and the client is stuck in the menu. Any attempt to create a server from said client will then crash the game.
Here is the code for the delegate, where the travel function is called:
void UMultiplayerSessionsSubsystem::OnJoinSessionComplete(FName SessionName, EOnJoinSessionCompleteResult::Type Result)
{
if(Result == EOnJoinSessionCompleteResult::Success) //not boolean due to multiple failure states
{
FString Msg = FString::Printf(TEXT("Successfully joined session %s"), *SessionName.ToString());
PrintString(Msg);
FString Address = "";
bool Success = SessionInterface->GetResolvedConnectString(MySessionName, Address);
if(Success)
{
PrintString(FString::Printf(TEXT("Address: %s"), *Address));
APlayerController *PlayerController = GetGameInstance()->GetFirstLocalPlayerController();
if(PlayerController)
{
PrintString(FString::Printf(TEXT("Travel to address: %s"), *Address));
//Travel to the address of the found server
PlayerController->ClientTravel(Address, ETravelType::TRAVEL_Absolute);//ETravelType cut out for testing
}
else
{
PrintString("Failed to get player controller");
}
}
else
{
PrintString("GetResolvedConnectString returned false");
}
}
else{
PrintString("OnJoinSessionComplete failed");
}
}