I confirm that after making a second call to OnlineSubsystemEOS::ReadFriendsList()
the GetFriendsList()
function return zero friends. Like below:
EOSInstance->ReadFriendsList(....);
EOSinstance->GetFriendsList(...); // This works fine
EOSInstance->ReadFriendsList(...); // call it again
EOSInstance->GetFriendsList(...); // This returns zero friends
And the reason that the second call returns zero friends is this line in GetFriendsList()
function (line 2209 of UserManagerEOS.cpp):
// If the service hasn't returned the info yet, skip them
else if (Friend->GetDisplayName().IsEmpty())
{
continue;
}
Basically after the second call to ReadFriendsList(...)
for all the friends the DisplayName is empty.
And the reason for that I believe is because at the begginig of ReadFriendsList(...)
only the FriendsList member is reset (line 1958 of UserManagerEOS.cpp) and it’s been forgotten to reset UniqueNetIdToAttributeAccessMap as well.
I changed
GetLocalUserChecked(LocalUserNum).FriendsList->Empty(FriendCount);
by adding this line after:
GetLocalUserChecked(LocalUserNum).FriendsList->Empty(FriendCount);
UniqueNetIdToAttributeAccessMap.Empty(FriendCount);
and it solved the issue.
Thanks