Fix EnumerateFollowingList and rename to GetFollowingList

This commit is contained in:
Russ Treadwell 2020-01-22 22:52:03 -05:00
parent 1a263c09cf
commit e4e3b0dbce
No known key found for this signature in database
GPG Key ID: 7A373FB1F4118C62

View File

@ -310,10 +310,24 @@ public static async Task<int> GetFollowerCount(SteamId steamID)
return r.Value.Count;
}
public static async Task<ulong[]> EnumerateFollowingList(uint StartIndex)
{
var r = await Internal.EnumerateFollowingList(StartIndex);
return r.Value.GSteamID;
}
}
public static async Task<SteamId[]> GetFollowingList()
{
int resultCount = 0;
var steamIds = new List<SteamId>();
FriendsEnumerateFollowingList_t? result;
do
{
if ((result = await Internal.EnumerateFollowingList((uint)resultCount)) != null)
{
resultCount += result.Value.ResultsReturned;
Array.ForEach(result.Value.GSteamID, id => { if (id > 0) steamIds.Add(id); });
}
} while (result != null && resultCount < result.Value.TotalResultCount);
return steamIds.ToArray();
}
}
}