public void OnError_DetachIdentity(int statusCode, int reasonCode, string statusMessage, object cbObject)
    {
        m_state    = ResponseState.Error;
        m_response = reasonCode + ":" + statusMessage;

        Debug.LogError("OnError_DetachIdentity: " + statusMessage);

        if (ErrorHandling.SharedErrorHandling(statusCode, reasonCode, statusMessage, cbObject, gameObject))
        {
            return;
        }

        switch (reasonCode)
        {
        case ReasonCodes.DOWNGRADING_TO_ANONYMOUS_ERROR:
        {
            // Display to the user that removing this identity would make there account
            // anonymous. Ask them if they are sure they want to perform this action
            Destroy(gameObject);
            AnonymousDowngradeDialog.CreateDialog(m_exampleAccountType);

            break;
        }

        case ReasonCodes.MISSING_IDENTITY_ERROR:
        {
            Destroy(gameObject);
            ErrorDialog.DisplayErrorDialog(
                string.Format("You can't detach an {0} identity when you don't have one.",
                              UtilExampleAccountType.getTypeName(m_exampleAccountType)), reasonCode + ":" + statusMessage);

            break;
        }

        case ReasonCodes.SECURITY_ERROR:
        {
            Destroy(gameObject);
            ErrorDialog.DisplayErrorDialog(
                string.Format("You can't detach an {0} identity that doesn't belong to you.",
                              UtilExampleAccountType.getTypeName(m_exampleAccountType)), reasonCode + ":" + statusMessage);

            break;
        }


        default:
        {
            // log the reasonCode to your own internal error checking
            ErrorHandling.UncaughtError(statusCode, reasonCode, statusMessage, cbObject, gameObject);

            break;
        }
        }
    }
Ejemplo n.º 2
0
    public void OnSuccess_Authenticate(string responseData, object cbObject)
    {
        ErrorHandlingApp.getInstance().m_user.OnLoginResponse(responseData);

        m_state    = ResponseState.Success;
        m_response = responseData;
        Debug.Log("OnSuccess_Authenticate: " + responseData);

        App.Bc
        .SetStoredAuthenticationType(UtilExampleAccountType.getTypeName(m_exampleAccountType));
    }
Ejemplo n.º 3
0
    public void OnError_AttachIdentity(int statusCode, int reasonCode, string statusMessage, object cbObject)
    {
        m_state    = ResponseState.Error;
        m_response = reasonCode + ":" + statusMessage;

        Debug.LogError("OnError_AttachIdentity: " + statusMessage);

        if (ErrorHandling.SharedErrorHandling(statusCode, reasonCode, statusMessage, cbObject, gameObject))
        {
            return;
        }

        switch (reasonCode)
        {
        case ReasonCodes.DUPLICATE_IDENTITY_TYPE:
        {
            //Users cannot attach an identity of a type that is already on there account
            // decide how this will be handled, such as prompting the user remove the current
            // identity before attaching one of the same type
            Destroy(gameObject);
            ErrorDialog.DisplayErrorDialog(
                string.Format("Account already has an identity of this {0} type, please detach first.",
                              UtilExampleAccountType.getTypeName(m_exampleAccountType)), m_response);

            break;
        }

        case ReasonCodes.MERGE_PROFILES:
        case ReasonCodes.SWITCHING_PROFILES:
        {
            //User cannot attach an identity that is already in use by another user
            // decide how this will be handled, such as prompting the user to merge the
            //  two user accounts
            Destroy(gameObject);
            MergeIdentityDialog.MergIdentityRequestDialog(m_exampleAccountType);

            break;
        }

        default:
        {
            // log the reasonCode to your own internal error checking
            ErrorHandling.UncaughtError(statusCode, reasonCode, statusMessage, cbObject, gameObject);

            break;
        }
        }
    }