Example #1
0
    public void Authenticate(Action <bool> callback, bool silent)
    {
        // make a platform-specific Play Games client
        if (mClient == null)
        {
            Debug.Log("***Creating dummy platform-specific Play Games client.");
            mClient = new DummyPlayGamesClient();
        }

        // authenticate!
        mClient.Authenticate(callback, silent);
    }
Example #2
0
        /// <summary>
        /// Authenticate the local user with the Google Play Games service.
        /// </summary>
        /// <param name='callback'>
        /// The callback to call when authentication finishes. It will be called
        /// with <c>true</c> if authentication was successful, <c>false</c>
        /// otherwise.
        /// </param>
        /// <param name='silent'>
        /// Indicates whether authentication should be silent. If <c>false</c>,
        /// authentication may show popups and interact with the user to obtain
        /// authorization. If <c>true</c>, there will be no popups or interaction with
        /// the user, and the authentication will fail instead if such interaction
        /// is required. A typical pattern is to try silent authentication on startup
        /// and, if that fails, present the user with a "Sign in" button that then
        /// triggers normal (not silent) authentication.
        /// </param>
        public void Authenticate(Action <bool> callback, bool silent)
        {
            // make a platform-specific Play Games client
            if (mClient == null)
            {
                Logger.d("Creating platform-specific Play Games client.");
                mClient = PlayGamesClientFactory.GetPlatformPlayGamesClient(mConfiguration);
            }

            // authenticate!
            mClient.Authenticate(callback, silent);
        }
Example #3
0
        public void Authenticate(Action <bool, string> callback, bool silent, string message)
        {
            // make a platform-specific Play Games client
            if (mClient == null)
            {
                GooglePlayGames.OurUtils.Logger.d(
                    "Creating platform-specific Play Games client.");
                mClient = PlayGamesClientFactory.GetPlatformPlayGamesClient(mConfiguration);
            }

            // authenticate!
            Action <bool> c = (bool a) => callback(a, message);

            mClient.Authenticate(c, silent);
        }
Example #4
0
 internal PlayGamesPlatform(IPlayGamesClient client)
 {
     this.mClient        = Misc.CheckNotNull(client);
     this.mLocalUser     = new PlayGamesLocalUser(this);
     this.mConfiguration = PlayGamesClientConfiguration.DefaultConfiguration;
 }
 internal PlayGamesPlatform(IPlayGamesClient client)
 {
     this.mClient = Misc.CheckNotNull(client);
     this.mLocalUser = new PlayGamesLocalUser(this);
     this.mConfiguration = PlayGamesClientConfiguration.DefaultConfiguration;
 }
        /// <summary>
        /// Authenticate the local user with the Google Play Games service.
        /// </summary>
        /// <param name='callback'>
        /// The callback to call when authentication finishes. It will be called
        /// with <c>true</c> if authentication was successful, <c>false</c>
        /// otherwise.
        /// </param>
        /// <param name='silent'>
        /// Indicates whether authentication should be silent. If <c>false</c>,
        /// authentication may show popups and interact with the user to obtain
        /// authorization. If <c>true</c>, there will be no popups or interaction with
        /// the user, and the authentication will fail instead if such interaction
        /// is required. A typical pattern is to try silent authentication on startup
        /// and, if that fails, present the user with a "Sign in" button that then
        /// triggers normal (not silent) authentication.
        /// </param>
        public void Authenticate(Action<bool> callback, bool silent)
        {
            // make a platform-specific Play Games client
            if (mClient == null)
            {
                GooglePlayGames.OurUtils.Logger.d("Creating platform-specific Play Games client.");
                mClient = PlayGamesClientFactory.GetPlatformPlayGamesClient(mConfiguration);
            }

            // authenticate!
            mClient.Authenticate(callback, silent);
        }
Example #7
0
 internal PlayGamesPlatform(IPlayGamesClient client)
 {
     mClient    = Misc.CheckNotNull(client);
     mLocalUser = new PlayGamesLocalUser(this);
 }
        /// <summary>
        /// Authenticate the local user with the Google Play Games service.
        /// </summary>
        /// <param name='unused'>
        /// Unused. For future compatibility, always pass <c>Social.localUser</c>.
        /// </param>
        /// <param name='callback'>
        /// The callback to call when authentication finishes. It will be called
        /// with <c>true</c> if authentication was successful, <c>false</c>
        /// otherwise.
        /// </param>
        /// <param name='silent'>
        /// Indicates whether authentication should be silent. If <c>false</c>,
        /// authentication may show popups and interact with the user to obtain
        /// authorization. If <c>true</c>, there will be no popups or interaction with
        /// the user, and the authentication will fail instead if such interaction
        /// is required. A typical pattern is to try silent authentication on startup
        /// and, if that fails, present the user with a "Sign in" button that then
        /// triggers normal (not silent) authentication.
        /// </param>
        public void Authenticate(ILocalUser unused, Action<bool> callback, bool silent) {
            // make a platform-specific Play Games client
            mClient = PlayGamesClientFactory.GetPlatformPlayGamesClient();

            // authenticate!
            mClient.Authenticate(callback, silent);
        }
 internal PlayGamesPlatform(IPlayGamesClient client) {
     mClient = Misc.CheckNotNull(client);
     mLocalUser = new PlayGamesLocalUser(this);
 }
        public void LoadScores(ILeaderboard board, Action <bool> callback)
        {
            //IL_004e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0053: Unknown result type (might be due to invalid IL or missing references)
            //IL_0054: Unknown result type (might be due to invalid IL or missing references)
            //IL_0055: Expected I4, but got Unknown
            //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
            //IL_0100: Unknown result type (might be due to invalid IL or missing references)
            //IL_011f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0125: Invalid comparison between Unknown and I4
            if (!IsAuthenticated())
            {
                Logger.e("LoadScores can only be called after authentication.");
                if (callback != null)
                {
                    callback(false);
                }
            }
            else
            {
                TimeScope           timeScope = board.get_timeScope();
                LeaderboardTimeSpan timeSpan;
                switch ((int)timeScope)
                {
                case 2:
                    timeSpan = LeaderboardTimeSpan.AllTime;
                    break;

                case 1:
                    timeSpan = LeaderboardTimeSpan.Weekly;
                    break;

                case 0:
                    timeSpan = LeaderboardTimeSpan.Daily;
                    break;

                default:
                    timeSpan = LeaderboardTimeSpan.AllTime;
                    break;
                }
                ((PlayGamesLeaderboard)board).loading = true;
                Logger.d("LoadScores, board=" + board + " callback is " + callback);
                IPlayGamesClient playGamesClient = mClient;
                string           id    = board.get_id();
                Range            range = board.get_range();
                int rowCount;
                if (range.count > 0)
                {
                    Range range2 = board.get_range();
                    rowCount = range2.count;
                }
                else
                {
                    rowCount = mClient.LeaderboardMaxResults();
                }
                playGamesClient.LoadScores(id, LeaderboardStart.PlayerCentered, rowCount, ((int)board.get_userScope() != 1) ? LeaderboardCollection.Public : LeaderboardCollection.Social, timeSpan, delegate(LeaderboardScoreData scoreData)
                {
                    HandleLoadingScores((PlayGamesLeaderboard)board, scoreData, callback);
                });
            }
        }