public RequestAllMemberLists ( string groupName, int retryWait, int retryCount = 10 ) : List |
||
groupName | string | The name of the group to request information about. |
retryWait | int | The number of miliseconds to wait between each retry. |
retryCount | int | The number of times to retry before inserting a null MemberList object. |
Результат | List |
public List<MemberList> RequestAllMemberLists(string groupName, int retryWait, int retryCount = 10)
{
var membersList = new List<MemberList>();
groupName = groupName.Replace(" ", string.Empty);
const string url = "http://steamcommunity.com/groups/{0}/memberslistxml/?xml=1&p={1}";
int count = 1;
int totalPages = 1;
bool firstRequest = false;
do
{
string temp = string.Format(url, groupName, count);
try
{
IResponse fetched = _web.Fetch(temp, "GET", null, null, true, "", false, retryWait, retryCount);
var populatedList = fetched.DeserializeXml<MemberList>();
membersList.Add(populatedList);
if (!firstRequest)
{
firstRequest = true;
totalPages = populatedList.TotalPages;
}
}
catch (WebException)
{
membersList.Add(null);
}
catch (NullReferenceException)
{
membersList.Add(null);
}
Thread.Sleep(1000);
count++;
} while (totalPages >= count);
return membersList;
}
CommunityHandler::RequestAllMemberLists ( ulong groupId, int retryWait, int retryCount = 10 ) : List |