예제 #1
0
        protected override void OnInitFail()
        {
            // Update properties
            m_userInfo = null;

            // Reset needless data
            m_authResponseData = null;

            base.OnInitFail();
        }
예제 #2
0
        protected override void OnInitSuccess()
        {
            IDictionary _infoDict = m_authResponseData.GetIfAvailable <IDictionary>(kLocalPlayerInfoKey);

            // Update properties
            m_userInfo = new iOSUser(_infoDict);

            // Reset needless data
            m_authResponseData = null;

            base.OnInitSuccess();
        }
예제 #3
0
		public static iOSUser[] ConvertToUserList (IUserProfile[] _userList)
		{
			if (_userList == null)
				return null;

			int				_count				= _userList.Length;
			iOSUser[]		_iosUsersList		= new iOSUser[_count];
			
			for (int _iter = 0; _iter < _count; _iter++)
				_iosUsersList[_iter]			= new iOSUser(_userList[_iter]);

			return _iosUsersList;
		}
예제 #4
0
		public static iOSUser[] ConvertUsersList (IList _usersJSONList)
		{
			if (_usersJSONList == null)
				return null;
			
			int 			_count			= _usersJSONList.Count;
			iOSUser[]		_usersList		= new iOSUser[_count];
			
			for (int _iter = 0; _iter < _count; _iter++)
				_usersList[_iter]			= new iOSUser((IDictionary)_usersJSONList[_iter]);
			
			return _usersList;
		}
예제 #5
0
		public iOSScore (IDictionary _dataDict) : base ()
		{
			// Parse data dictionary values
			string		_leaderboardID	= _dataDict.GetIfAvailable<string>(kLeaderboardIdentifierKey);
			IDictionary _userDataDict	= _dataDict.GetIfAvailable<IDictionary>(kPlayerKey);

			LeaderboardGlobalID		= GameServicesIDHandler.GetLeaderboardGID(_leaderboardID);
			LeaderboardID			= _leaderboardID;
			Value					= _dataDict.GetIfAvailable<long>(kValueKey);
			Date					= _dataDict.GetIfAvailable<string>(kDateKey).ToZuluFormatDateTimeLocal();
			Rank					= _dataDict.GetIfAvailable<int>(kRankKey);

			if (_userDataDict != null)
				User				= new iOSUser(_userDataDict);
		}
예제 #6
0
        public iOSScore(IDictionary _dataDict) : base()
        {
            // Parse data dictionary values
            string      _leaderboardID = _dataDict.GetIfAvailable <string>(kLeaderboardIdentifierKey);
            IDictionary _userDataDict  = _dataDict.GetIfAvailable <IDictionary>(kPlayerKey);

            LeaderboardGlobalID = GameServicesUtils.GetLeaderboardGID(_leaderboardID);
            LeaderboardID       = _leaderboardID;
            Value = _dataDict.GetIfAvailable <long>(kValueKey);
            Date  = _dataDict.GetIfAvailable <string>(kDateKey).ToZuluFormatDateTimeLocal();
            Rank  = _dataDict.GetIfAvailable <int>(kRankKey);

            if (_userDataDict != null)
            {
                User = new iOSUser(_userDataDict);
            }
        }
예제 #7
0
        protected override void AuthenticationFinished(IDictionary _dataDict)
        {
            string _error = _dataDict.GetIfAvailable <string>(GameServicesIOS.kNativeMessageErrorKey);

            if (_error == null)
            {
                m_authResponseData = _dataDict;
            }
            else
            {
                // Update properties
                Friends    = null;
                m_userInfo = null;
            }

            AuthenticationFinished(_error);
        }
예제 #8
0
파일: iOSUser.cs 프로젝트: georgex1/rednit
        public static iOSUser[] ConvertToUserList(IUserProfile[] _userList)
        {
            if (_userList == null)
            {
                return(null);
            }

            int _count = _userList.Length;

            iOSUser[] _iosUsersList = new iOSUser[_count];

            for (int _iter = 0; _iter < _count; _iter++)
            {
                _iosUsersList[_iter] = new iOSUser(_userList[_iter]);
            }

            return(_iosUsersList);
        }
예제 #9
0
        public static iOSUser[] ConvertUsersList(IList _usersJSONList)
        {
            if (_usersJSONList == null)
            {
                return(null);
            }

            int _count = _usersJSONList.Count;

            iOSUser[] _usersList = new iOSUser[_count];

            for (int _iter = 0; _iter < _count; _iter++)
            {
                _usersList[_iter] = new iOSUser((IDictionary)_usersJSONList[_iter]);
            }

            return(_usersList);
        }
예제 #10
0
        protected override void LoadFriendsFinished(IDictionary _dataDict)
        {
            string _error          = _dataDict.GetIfAvailable <string>(GameServicesIOS.kNativeMessageErrorKey);
            IList  _friendJSONList = _dataDict.GetIfAvailable <IList>(kFriendPlayersKey);

            if (_friendJSONList != null)
            {
                int       _count   = _friendJSONList.Count;
                iOSUser[] _friends = new iOSUser[_count];

                for (int _iter = 0; _iter < _count; _iter++)
                {
                    _friends[_iter] = new iOSUser((IDictionary)_friendJSONList[_iter]);
                }

                // Update property
                Friends = _friends;
            }

            LoadFriendsFinished(Friends, _error);
        }
예제 #11
0
        protected override void AuthenticationFinished(IDictionary _dataDict)
        {
            // Update properties using received information
            bool _isAuthenticated = IsAuthenticated;

            if (_isAuthenticated)
            {
                IDictionary _infoDict = _dataDict.GetIfAvailable <IDictionary>(kLocalPlayerInfoKey);

                m_userInfo = new iOSUser(_infoDict);
                Friends    = null;
            }
            else
            {
                m_userInfo = null;
                Friends    = null;
            }

            // Invoke auth finished handler
            string _error = _dataDict.GetIfAvailable <string>(GameServicesIOS.kNativeMessageErrorKey);

            AuthenticationFinished(_isAuthenticated, _error);
        }
		protected override void OnInitFail ()
		{
			// Update properties
			m_userInfo				= null;

			// Reset needless data
			m_authResponseData		= null;

			base.OnInitFail ();
		}
		protected override void OnInitSuccess ()
		{
			IDictionary _infoDict	= m_authResponseData.GetIfAvailable<IDictionary>(kLocalPlayerInfoKey);

			// Update properties
			m_userInfo				= new iOSUser(_infoDict);

			// Reset needless data
			m_authResponseData		= null;

			base.OnInitSuccess ();
		}
		protected override void LoadFriendsFinished (IDictionary _dataDict)
		{
			string		_error			= _dataDict.GetIfAvailable<string>(GameServicesIOS.kNativeMessageErrorKey);
			IList		_friendJSONList	= _dataDict.GetIfAvailable<IList>(kFriendPlayersKey);

			if (_friendJSONList != null)
			{
				int 		_count		= _friendJSONList.Count;
				iOSUser[]	_friends	= new iOSUser[_count];

				for (int _iter = 0; _iter < _count; _iter++)
					_friends[_iter]		= new iOSUser((IDictionary)_friendJSONList[_iter]);

				// Update property
				Friends					= _friends;
			}

			LoadFriendsFinished(Friends, _error);
		}
		protected override void AuthenticationFinished (IDictionary _dataDict)
		{
			string		_error		= _dataDict.GetIfAvailable<string>(GameServicesIOS.kNativeMessageErrorKey);

			if (_error == null)
			{
				m_authResponseData	= _dataDict;
			}
			else
			{
				// Update properties
				Friends				= null;
				m_userInfo			= null;
			}

			AuthenticationFinished(_error);
 		}