public void Update() { // do we have a current leaderboard? if (currentLeaderboard != null) { // are we currently waiting for a page request to finish? if (requestedPage != null) { // check if the page request has completed and process accoringly switch (requestedPage.PopulationState) { case ICELandaLib.LeaderboardPopulationState.LPS_PENDING: // nothing to do yet... break; case ICELandaLib.LeaderboardPopulationState.LPS_INVALID: // data request failed - bail out and release requested page so we can try again later! requestedPage = null; break; case ICELandaLib.LeaderboardPopulationState.LPS_POPULATED: // check to see if we recieved less entries than expected if (requestedPage.Size < 20) { // if we recieved less than 20 entries then we must have reached the end of the leaderboard // set no more entries to true so we dont constantly spam the website asking for more entries noMoreEntries = true; } // got the data - copy it to our local list for (uint i = 0; i < requestedPage.Size; i ++) { ICELandaLib.CoLeaderboardRow row = requestedPage.GetRow(i); entries.Add(new leaderboardEntry(row.Rank.ToString() + " - " + row.UserName, row.Score.ToString())); } // increased the number of entries recieved numEntriesReceived += (int)requestedPage.Size; // store the last requested page and release the requested page ready for next time lastRequestedPage = requestedPage; requestedPage = null; break; } } } }