Hi, I am trying to access the Steam players Username and other info. I have been reading the docs as best I can but I don’t think I am taking the right approach. Here you can see my OnCreateSessionComplete
callback function. This part is working OK and the session is being created. Everything after the ServelTravel
call is the part relevant to this question.
Basically, the onlineUser.IsValid()
return value is always false. I have tried this code in a few parts of my GameInstance class.
void UCopsGameInstance::OnCreateSessionComplete(FName sessionName, bool success)
{
UE_LOG(LogTemp, Warning, TEXT("OnCreateSessionComplete()"));
if(MainMenu!=nullptr) MainMenu->Teardown();
GetWorld()->ServerTravel("/Game/maps/Map_Lobby?listen");
Oss=IOnlineSubsystem::Get();
if(Oss!=nullptr)
{
IOnlineUserPtr onlineUser=Oss->GetUserInterface();
if(onlineUser.IsValid())
{
UE_LOG(LogTemp, Warning, TEXT("OnlineUser is valid"));
}
else
{
UE_LOG(LogTemp, Warning, TEXT("OnlineUser is NOT valid"));
}
}
else
{
UE_LOG(LogTemp, Warning, TEXT("OSS is Nullptr"));
}
}
Could anyone help point me in the right direction please? Thank you for any help.