示例#1
0
        private void FriendsScoresDidLoad(List <OKScore> scores, OKException e)
        {
            if (Cancelled)
            {
                return;
            }

            if (e != null)
            {
                _response.Status = OKIOStatus.FailedWithError;
                _response.Err    = new OKException("GhostScoresError: Failed to get Social Scores.");
                DoDidFinish();
                return;
            }

            foreach (OKScore score in scores)
            {
                if (score.MetadataBuffer == null && score.MetadataLocation != null)
                {
                    _pendingBufferLoad.Add(score);
                    score.LoadMetadataBuffer(ScoreDidLoadMetadata);
                }
            }

            _response.scores = scores;
            if (_pendingBufferLoad.Count == 0)
            {
                DoDidFinish();
            }
        }
        private void FriendsListDidLoad(List<string> ids, OKException e)
        {
            if (Cancelled)		// delegate protection
                return;

            if (e != null) {
                _response.Status = OKIOStatus.FailedWithError;
                _response.Err = new OKException("GhostScoresError: Failed to get FB Friends List.");
                DoDidFinish();
                return;
            }

            // No request handle:
            Leaderboard.GetFacebookFriendsScores(ids, FriendsScoresDidLoad);
        }
示例#3
0
        private void FriendsListDidLoad(List <string> ids, OKException e)
        {
            if (Cancelled)                      // delegate protection
            {
                return;
            }

            if (e != null)
            {
                _response.Status = OKIOStatus.FailedWithError;
                _response.Err    = new OKException("GhostScoresError: Failed to get FB Friends List.");
                DoDidFinish();
                return;
            }

            // No request handle:
            Leaderboard.GetFacebookFriendsScores(ids, FriendsScoresDidLoad);
        }
        private void FriendsScoresDidLoad(List<OKScore> scores, OKException e)
        {
            if (Cancelled)
                return;

            if (e != null) {
                _response.Status = OKIOStatus.FailedWithError;
                _response.Err = new OKException("GhostScoresError: Failed to get Social Scores.");
                DoDidFinish();
                return;
            }

            foreach (OKScore score in scores) {
                if (score.MetadataBuffer == null && score.MetadataLocation != null) {
                    _pendingBufferLoad.Add(score);
                    score.LoadMetadataBuffer(ScoreDidLoadMetadata);
                }
            }

            _response.scores = scores;
            if (_pendingBufferLoad.Count == 0) {
                DoDidFinish();
            }
        }
示例#5
0
 private void FacebookFriendsScoresDidLoad(List<OKScore> scoresList, OKException e)
 {
     if(e == null) {
         _scores = scoresList;
         foreach (OKScore score in _scores) {
             if (score.MetadataBuffer == null && score.MetadataLocation != null) {
                 _pending.Add(score);
                 score.LoadMetadataBuffer(this.ScoreDidLoadMetadata);
             }
         }
         Debug.Log("Number of social scores: " + _scores.Count);
         Debug.Log("Number we need to pull metadata of: " + _pending.Count);
         if (_pending.Count == 0) {
             _handler(this);
         }
     } else {
         Debug.Log("Failed to get social scores: " + e.Message);
     }
 }