public override void LoadMoreScores(eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
        {
            base.LoadMoreScores(_pageDirection, _onCompletion);

            // Calculate score set to be retrieved
            Range _curRange   = m_range;
            int   _maxResults = MaxResults;
            Range _newRange   = new Range(0, _maxResults);

            if (_pageDirection == eLeaderboardPageDirection.PREVIOUS)
            {
                if (_curRange.from == 1)
                {
                    LoadScoresFinished(null, null, "The operation could not be completed because there are no entries available to load.");
                    return;
                }

                _newRange.from = Mathf.Max(1, _curRange.from - _maxResults);
            }
            else if (_pageDirection == eLeaderboardPageDirection.NEXT)
            {
                _newRange.from = Mathf.Max(1, _curRange.from + _curRange.count);
            }

            // Initiate request to load specified score set
            LoadScores(_newRange);
        }
Example #2
0
        public override void LoadMoreScores(eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
        {
            // Check if user has requested for initial score info
            Range _curRange = m_range;

            if (_curRange.from == 0)
            {
                LoadTopScores(_onCompletion);
                return;
            }

            // Based on page direction, compute range of score to be loaded
            int   _maxResults = MaxResults;
            Range _newRange   = new Range(0, _maxResults);

            if (_pageDirection == eLeaderboardPageDirection.PREVIOUS)
            {
                if (_curRange.from == 1)
                {
                    LoadScoresFinished(null, null, "The operation could not be completed because there are no entries available to load.");
                    return;
                }

                // Set range start value
                _newRange.from = Mathf.Max(1, _curRange.from - _maxResults);
            }
            else if (_pageDirection == eLeaderboardPageDirection.NEXT)
            {
                // Set range start value
                _newRange.from = _curRange.from + _maxResults;
            }

            // Load scores
            LoadScores(_newRange, _onCompletion);
        }
        public void LoadMoreScores(EditorLeaderboard _leaderboard, eLeaderboardPageDirection _pageDirection)
        {
            string _instanceID = _leaderboard.GetInstanceID();

            // Check if user has logged in
            if (!VerifyUser())
            {
                OnLoadScoresFinished(_instanceID, null, Constants.kGameServicesUserAuthMissingError);
                return;
            }

            // Get leaderboard
            EGCLeaderboard _gcLeaderboard = GetLeaderboardWithID(_leaderboard.Identifier);

            if (_gcLeaderboard == null)
            {
                OnLoadScoresFinished(_instanceID, null, Constants.kGameServicesIdentifierInfoNotFoundError);
                return;
            }

            // Load scores
            string _error;

            _gcLeaderboard.LoadMoreScores(_leaderboard.TimeScope, _leaderboard.UserScope, _leaderboard.MaxResults, _pageDirection, out _error);
            OnLoadScoresFinished(_instanceID, _gcLeaderboard, _error);
        }
        public override void LoadMoreScores(eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
        {
            base.LoadMoreScores(_pageDirection, _onCompletion);

            // Load scores
            EditorGameCenter.Instance.LoadMoreScores(this, _pageDirection);
        }
Example #5
0
        public override void LoadMoreScores(eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
        {
            // Cache callback
            m_loadScoreCompletionCallback = _onCompletion;

            // Load scores
            EditorGameCenter.Instance.LoadMoreScores(this, _pageDirection, LoadScoreRequestFinished);
        }
Example #6
0
        private void LoadMoreScores(string _leaderboardID, eLeaderboardPageDirection _direction)
        {
            if (m_curLeaderboard == null)
            {
                AddNewResult("Failed to load scores. Create leaderboard instance before requesting score load.");
                return;
            }

            // Load scores
            m_curLeaderboard.LoadMoreScores(_direction, OnLoadScoresFinished);
        }
Example #7
0
        private void LoadMoreScores(eLeaderboardPageDirection _direction)
        {
            if (m_curLeaderboard == null)
            {
                AddNewResult("The requested operation could not be completed because leaderboard instance is null. Please create new leaderboard instance.");
                return;
            }

            // Load scores
            m_curLeaderboard.LoadMoreScores(_direction, OnLoadScoresFinished);
        }
Example #8
0
        public override void LoadMoreScores(eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
        {
            Range _curRange = m_leaderboardData.range;

            if (_curRange.from == 0)
            {
                LoadTopScores(_onCompletion);
                return;
            }

            // Based on page direction, compute range of score to be loaded
            int   _maxResults = MaxResults;
            Range _newRange   = new Range(0, _maxResults);

            if (_pageDirection == eLeaderboardPageDirection.PREVIOUS)
            {
                if (_curRange.from == 1)
                {
                    if (_onCompletion != null)
                    {
                        _onCompletion(null, null);
                    }

                    return;
                }

                // Set range start value
                _newRange.from = Mathf.Max(1, _curRange.from - _maxResults);
            }
            else if (_pageDirection == eLeaderboardPageDirection.NEXT)
            {
                // Set range start value
                _newRange.from = _curRange.from + _maxResults;
            }

            // Load scores
            LoadScores(_newRange, _onCompletion);
        }
		public override	void LoadMoreScores (eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
		{
			// Check if user has requested for initial score info
			Range		_curRange		= m_range;

			if (_curRange.from == 0)
			{
				LoadTopScores(_onCompletion);
				return;
			}
			
			// Based on page direction, compute range of score to be loaded
			int			_maxResults		= MaxResults;
			Range		_newRange		= new Range(0, _maxResults);
			
			if (_pageDirection == eLeaderboardPageDirection.PREVIOUS)
			{
				if (_curRange.from == 1)
				{
					LoadScoresFinished(null, null, "The operation could not be completed because there are no entries available to load.");
					return;
				}
				
				// Set range start value
				_newRange.from	= Mathf.Max(1, _curRange.from - _maxResults);
			}
			else if (_pageDirection == eLeaderboardPageDirection.NEXT)
			{
				// Set range start value
				_newRange.from	= _curRange.from + _maxResults;
			}
			
			// Load scores
			LoadScores(_newRange, _onCompletion);
		} 
		/// <summary>
		/// Asynchronously loads an additional score data.
		/// </summary>
		/// <param name="_pageDirection">The direction of pagination.</param>
		/// <param name="_onCompletion">Callback to be called when score results are retrieved from the game service server.</param>
		public abstract	void LoadMoreScores (eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion);
Example #11
0
 /// <summary>
 /// Asynchronously loads an additional score data.
 /// </summary>
 /// <param name="_pageDirection">The direction of pagination.</param>
 /// <param name="_onCompletion">Callback to be called when score results are retrieved from the game service server.</param>
 public abstract void LoadMoreScores(eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion);
Example #12
0
        public void LoadMoreScores(Leaderboard _leaderboard, eLeaderboardPageDirection _pageDirection, Action <EditorScore[], EditorScore> _onCompletion)
        {
            // Check if user has logged in
            if (!VerifyUser())
            {
                if (_onCompletion != null)
                {
                    _onCompletion(null, null);
                }

                return;
            }

            // Get leaderboard
            EGCLeaderboard _gcLeaderboard = GetLeaderboardWithID(_leaderboard.Identifier);

            if (_gcLeaderboard == null)
            {
                if (_onCompletion != null)
                {
                    _onCompletion(null, null);
                }

                return;
            }

            // Compute score fetch range
            Range _curRange = _gcLeaderboard.Range;

            if (_curRange.from == 0)
            {
                LoadTopScores(_leaderboard, _onCompletion);
                return;
            }

            // Based on page direction, compute range of score to be loaded
            int   _maxResults = _leaderboard.MaxResults;
            Range _newRange   = new Range(0, _maxResults);

            if (_pageDirection == eLeaderboardPageDirection.PREVIOUS)
            {
                if (_curRange.from == 1)
                {
                    if (_onCompletion != null)
                    {
                        _onCompletion(null, null);
                    }

                    return;
                }

                _newRange.from = Mathf.Max(1, _curRange.from - _maxResults);
            }
            else if (_pageDirection == eLeaderboardPageDirection.NEXT)
            {
                _newRange.from = _curRange.from + _maxResults;

                if (_newRange.from > _gcLeaderboard.Scores.Count)
                {
                    if (_onCompletion != null)
                    {
                        _onCompletion(null, null);
                    }

                    return;
                }
            }

            // Set score fetch range
            _gcLeaderboard.Range = _newRange;

            // Load scores
            LoadScores(_gcLeaderboard, _leaderboard.TimeScope, _leaderboard.UserScope, _onCompletion);
        }
		public override	void LoadMoreScores (eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
		{
			base.LoadMoreScores(_pageDirection, _onCompletion);

			// Load scores
			EditorGameCenter.Instance.LoadMoreScores(this, _pageDirection);
		}
		private void LoadMoreScores(string _leaderboardID, eLeaderboardPageDirection _direction)
		{
			if (m_curLeaderboard == null)
			{
				AddNewResult("Failed to load scores. Create leaderboard instance before requesting score load.");
				return;
			}
			
			// Load scores
			m_curLeaderboard.LoadMoreScores(_direction, OnLoadScoresFinished);
		}
Example #15
0
 /// <summary>
 /// Asynchronously loads an additional set of scores.
 /// </summary>
 /// <param name="_pageDirection">The direction of pagination over leaderboard score sets.</param>
 /// <param name="_onCompletion">Callback that will be called after operation is completed.</param>
 public virtual void LoadMoreScores(eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
 {
     // Cache callback information
     LoadScoreFinishedEvent = _onCompletion;
 }
		public override	void LoadMoreScores (eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
		{
			AndroidLeaderboardsManager _leaderboardsManager = GetLeaderboardManager();
			_leaderboardsManager.LoadMoreScores(this, MaxResults, _pageDirection, _onCompletion);
		
		}
Example #17
0
 public override void LoadMoreScores(eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
 {
     base.LoadMoreScores(_pageDirection, _onCompletion);
     GameServicesAndroid.Plugin.Call(GameServicesAndroid.Native.Methods.LOAD_MORE_SCORES, GetInstanceID(), Identifier, (int)_pageDirection, MaxResults);
 }
Example #18
0
        public void LoadMoreScores(eLeaderboardTimeScope _timeScope, eLeaderboardUserScope _userScope, int _maxResults, eLeaderboardPageDirection _pageDirection, out string _error)
        {
            // Initial value
            _error = null;

            // Compute score fetch range
            Range _curRange = Range;

            if (_curRange.from == 0)
            {
                LoadTopScores(_timeScope, _userScope, _maxResults, out _error);
                return;
            }

            // Based on page direction, compute range of score to be loaded
            Range _newRange = new Range(0, _maxResults);

            if (_pageDirection == eLeaderboardPageDirection.PREVIOUS)
            {
                if (_curRange.from == 1)
                {
                    _error = "The operation could not be completed because there are no more score records.";
                    return;
                }

                _newRange.from = Mathf.Max(1, _curRange.from - _maxResults);
            }
            else if (_pageDirection == eLeaderboardPageDirection.NEXT)
            {
                _newRange.from = _curRange.from + _maxResults;

                if (_newRange.from > m_scores.Count)
                {
                    _error = "The operation could not be completed because there are no more score records.";
                    return;
                }
            }

            // Filter existing score list
            FilterScoreList(_timeScope, _userScope, _newRange);
        }
		public void LoadMoreScores (AndroidLeaderboard _leaderboard, int _maxResults, eLeaderboardPageDirection _direction, Leaderboard.LoadScoreCompletion _onCompletion)
		{
			OnLoadMoreScoresFinished = _onCompletion;
			Plugin.Call(AndroidNativeInfo.Methods.LOAD_MORE_SCORES, _leaderboard.Identifier, (int)_direction, _maxResults);
		}
		public override	void LoadMoreScores (eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
		{
			Range		_curRange		= m_leaderboardData.range;

			if (_curRange.from == 0)
			{
				LoadTopScores(_onCompletion);
				return;
			}
			
			// Based on page direction, compute range of score to be loaded
			int			_maxResults		= MaxResults;
			Range		_newRange		= new Range(0, _maxResults);
			
			if (_pageDirection == eLeaderboardPageDirection.PREVIOUS)
			{
				if (_curRange.from == 1)
				{
					if (_onCompletion != null)
						_onCompletion(null, null);

					return;
				}
				
				// Set range start value
				_newRange.from	= Mathf.Max(1, _curRange.from - _maxResults);
			}
			else if (_pageDirection == eLeaderboardPageDirection.NEXT)
			{
				// Set range start value
				_newRange.from	= _curRange.from + _maxResults;
			}
			
			// Load scores
			LoadScores(_newRange, _onCompletion);
		} 
Example #21
0
 public void LoadMoreScores(AndroidLeaderboard _leaderboard, int _maxResults, eLeaderboardPageDirection _direction, Leaderboard.LoadScoreCompletion _onCompletion)
 {
     OnLoadMoreScoresFinished = _onCompletion;
     Plugin.Call(AndroidNativeInfo.Methods.LOAD_MORE_SCORES, _leaderboard.Identifier, (int)_direction, _maxResults);
 }
Example #22
0
        public override void LoadMoreScores(eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
        {
            AndroidLeaderboardsManager _leaderboardsManager = GetLeaderboardManager();

            _leaderboardsManager.LoadMoreScores(this, MaxResults, _pageDirection, _onCompletion);
        }
		private void LoadMoreScores (eLeaderboardPageDirection _direction)
		{
			if (m_curLeaderboard == null)
			{
				AddNewResult("The requested operation could not be completed because leaderboard instance is null. Please create new leaderboard instance.");
				return;
			}
			
			// Load scores
			m_curLeaderboard.LoadMoreScores(_direction, OnLoadScoresFinished);
		}
		public override	void LoadMoreScores (eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
		{
			base.LoadMoreScores(_pageDirection, _onCompletion);
			GameServicesAndroid.Plugin.Call(GameServicesAndroid.Native.Methods.LOAD_MORE_SCORES, GetInstanceID(), Identifier, (int)_pageDirection, MaxResults);	
		}
		public override	void LoadMoreScores (eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
		{
			// Cache callback
			m_loadScoreCompletionCallback	= _onCompletion;
			
			// Load scores
			EditorGameCenter.Instance.LoadMoreScores(this, _pageDirection, LoadScoreRequestFinished);
		}
		/// <summary>
		/// Asynchronously loads an additional score data.
		/// </summary>
		/// <param name="_pageDirection">The direction of pagination.</param>
		/// <param name="_onCompletion">Callback to be called when score results are retrieved from the game service server.</param>
		public virtual void LoadMoreScores (eLeaderboardPageDirection _pageDirection, LoadScoreCompletion _onCompletion)
		{
			// Cache callback information
			LoadScoreFinishedEvent	= _onCompletion;
		}