Ejemplo n.º 1
0
    public static void CreateDialog(ExampleAccountType exampleAccountType)
    {
        GameObject dialogObject         = new GameObject("Dialog");
        AnonymousDowngradeDialog dialog = dialogObject.AddComponent <AnonymousDowngradeDialog>();

        dialog.m_exampleAccountType = exampleAccountType;
    }
    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;
        }
        }
    }