Download

Chech if Steam is online

I’m trying to create a custom blueprint node to display if Steam is open
Here is my actual code but I don’t think I got it working…


FString UMyBlueprintFunctionLibrary::getPlayerOnline(class APlayerController* PlayerController)
{
IOnlineSubsystem* ion = IOnlineSubsystem::Get(FName("Steam"));

if (ion == nullptr)
{
return "Not Logged In";
}

//ELoginStatus::Type l = ion->GetIdentityInterface()->GetLoginStatus(PlayerController->Player->GetControllerId()); //<--------I cant get the player controller ID
ELoginStatus::Type l = ion->GetIdentityInterface()->GetLoginStatus(PlayerController->Player->GetUniqueID());

if (l == ELoginStatus::Type::LoggedIn)
return "Logged In";
else if (l == ELoginStatus::Type::NotLoggedIn)
return "Not Logged In";
else if (l == ELoginStatus::Type::UsingLocalProfile)
return "Local Player";

return "Not Logged In";
}

I cant get the player controller ID cause I get an error (class “UPlayer” has no member “GetControllerId”)
How can I fix this error

NVM I got it working…