Download

LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)

Im trying to set up local server in game.
When trying to join Im getting error showed in Topic and black screen.
It happens only when typing correct address.

Host() and Join() are UPROPERTY(exec)


void UPuzzleGameInstance::Host()

{

UEngine* Engine = GetEngine();

if (!ensure(Engine != nullptr)) return;

Engine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Hostin"));




UWorld* World = GetWorld();

if (!ensure(World != nullptr)) return;

Engine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("Creating world"));

World->ServerTravel("/Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap?listen -server");

}




void UPuzzleGameInstance::Join(const FString& Address)

{

UEngine* Engine = GetEngine();

if (!ensure(Engine != nullptr)) return;

Engine->AddOnScreenDebugMessage(0, 5.f, FColor::Red, FString::Printf(TEXT("Joining %s"), *Address));




APlayerController* PlayerController = GetFirstLocalPlayerController();

if (!ensure(PlayerController != nullptr)) return;

PlayerController->ClientTravel(Address, ETravelType::TRAVEL_Absolute);

}

Please help.


World->ServerTravel("/Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap?listen -server");

I don’t think this line makes sense. As far as I know, -server is a command line argument that is used to start a headless version of your game, which will be used as your master server. But you are hosting the map in a listen server environment via ?listen. Also, this online session log is just a warning, not an error message. So, remove -server and see what happens.

Thanks for help, I later changed this line and it worked, but forgot to say about it.