I’m trying to retrieve a steam friend list from a logged in user, but I keep getting false for both the ReadFriendsList() and GetFriendsList()
auto OnlineSub = IOnlineSubsystem::Get();
//Make sure it exists
if (OnlineSub != nullptr)
{
auto userFriendsPtr = OnlineSub->GetFriendsInterface();
auto userIdentityPtr = OnlineSub->GetIdentityInterface();
if (!userFriendsPtr.IsValid())
{
friendNames.Add(" Invalid Friend Ptr ");
return false;
}
if (!userIdentityPtr.IsValid())
{
friendNames.Add(" Invalid Identity Ptr ");
return false;
}
friendNames.Add(FString::Printf(TEXT(" Login Status: %s "), ELoginStatus::ToString(userIdentityPtr->GetLoginStatus(localUserID))));
friendNames.Add(userIdentityPtr->GetPlayerNickname(localUserID));
if (userFriendsPtr->ReadFriendsList(localUserID, EFriendsLists::ToString(EFriendsLists::Default)))
{
friendNames.Add(" FriendList not found ");
}
}
The above will output:
Friend: Login Status: LoggedIn
Friend: AlliedGames Multiplayer Test Acc
Friend: FriendList not found
So, it knows I am logged in, it knows who I am, but it cannot retrieve my friend list. This is using the STEAM OnlineSubsystem.
Tracing through the code it looks like one of the following checks is failing, but I’m not sure which (I don’t have the engine source and the breakpoints don’t seem to do anything in OnlineFriendsInterfaceSteam.cpp)
LocalUserNum < MAX_LOCAL_PLAYERS &&
SteamUserPtr != NULL &&
SteamUserPtr->BLoggedOn() &&
SteamFriendsPtr != NULL
I’m using the default steam SDK that 4.10.1 comes with, if that makes a difference.