Exemplo n.º 1
0
        // UI thread
        private void OnAchievementsLoaded(int statusCode, AndroidJavaObject buffer)
        {
            if (mAuthState == AuthState.LoadingAchs)
            {
                Logger.d("AUTH: Initial achievement load finished.");

                if (statusCode == JavaConsts.STATUS_OK ||
                    statusCode == JavaConsts.STATUS_STALE_DATA ||
                    statusCode == JavaConsts.STATUS_DEFERRED)
                {
                    // successful load (either from network or local cache)
                    Logger.d("Processing achievement buffer.");
                    mAchievementBank.ProcessBuffer(buffer);

                    Logger.d("Closing achievement buffer.");
                    buffer.Call("close");

                    Logger.d("AUTH: Auth process complete!");
                    mAuthState = AuthState.Done;
                    InvokeAuthCallback(true);

                    // inform the RTMP client and TBMP clients that sign in suceeded
                    CheckForConnectionExtras();
                    mRtmpClient.OnSignInSucceeded();
                    mTbmpClient.OnSignInSucceeded();
                }
                else
                {
                    Logger.w("AUTH: Failed to load achievements, status code " + statusCode);
                    mAuthState = AuthState.NoAuth;
                    InvokeAuthCallback(false);
                }
            }
            else
            {
                Logger.w("OnAchievementsLoaded called unexpectedly in auth state " + mAuthState);
            }
        }
Exemplo n.º 2
0
        private void OnLoadSucceeded(LoadingState loadState)
        {
            if (mAuthState == AuthState.Loading)
            {
                mLoadState &= ~loadState;

                if (mLoadState == LoadingState.NoLoading)
                {
                    Logger.d("AUTH: Auth process complete!");
                    mAuthState = AuthState.Done;
                    InvokeAuthCallback(true);

                    // inform the RTMP client and TBMP clients that sign in suceeded
                    CheckForConnectionExtras();
                    mRtmpClient.OnSignInSucceeded();
                    mTbmpClient.OnSignInSucceeded();
                }
            }
            else
            {
                Logger.w("OnLoadStart called unexpectedly in auth state " + mAuthState);
            }
        }