IEnumerator VerifyBuild()
        {
            BuildState = Reason.InProgress;
            if (Singleton.Instance.IsWebApp == true)
            {
                // Grab the web checker
                if (domainVerifier != null)
                {
                    // Wait until the webchecker is done
                    yield return(StartCoroutine(domainVerifier.VerifyWebDomain()));

                    // Check the state
                    switch (domainVerifier.CurrentState)
                    {
                    case WebDomainVerifier.State.DomainMatched:
                    case WebDomainVerifier.State.NotUsed:
                        BuildState = Reason.None;
                        break;

                    case WebDomainVerifier.State.DomainDidntMatch:
                        BuildState = Reason.IsIncorrectDomain;
                        break;

                    case WebDomainVerifier.State.EncounteredError:
                    default:
                        BuildState = Reason.CannotConfirmDomain;
                        break;
                    }
                }
            }
            else if ((Application.genuineCheckAvailable == true) && (Application.genuine == false))
            {
                BuildState = Reason.IsNotGenuine;
            }
            else
            {
                BuildState = Reason.None;
            }

            // Check if we're simulating failure
            if (Singleton.Instance.IsSimulatingMalformedGame == true)
            {
                // Indicate as such
                BuildState = Reason.JustTesting;
            }

            // Check if the build state is valid
            if (BuildState != Reason.None)
            {
                UpdateReason(BuildState);
                Show();
            }

            // Udpate flag
            IsBuildVerified = true;
        }
Exemple #2
0
        // Use this for initialization
        IEnumerator Start()
        {
            // By default, set the label to indicate this isn't a web build.
            infoLabel.text = ForWebGlMessage;

            // Check if this is a web build
            if ((domainVerifier != null) && (Application.platform == RuntimePlatform.WebGLPlayer))
            {
                // Print that we're loading
                infoLabel.text = LoadingMessage;

                // Start the verification process
                yield return(StartCoroutine(domainVerifier.VerifyWebDomain()));

                // Update the reason for this dialog to appear
                infoLabel.text = DebugWebDomainInfo.GetDebugMessage(domainVerifier, new StringBuilder());
            }
        }
Exemple #3
0
        // Use this for initialization
        IEnumerator Start()
        {
            // By default, set the label to indicate this isn't a web build.
            coroutineStatusLabel.text = ForWebGlMessage;
            eventsStatusLabel.text    = ForWebGlMessage;

            // Check if this is a web build
            if ((domainVerifier != null) && (Application.platform == RuntimePlatform.WebGLPlayer))
            {
                // Bind to the appropriate events
                domainVerifier.OnBeforeVerifyWebDomain += IndicateVerificationStarted;
                domainVerifier.OnAfterVerifyWebDomain  += IndicateVerificationEnded;
                domainVerifier.OnAfterStateChange      += IndicateStatusChanged;

                // Start building text that we started the verification process
                coroutineText.AppendLine(VerificationStartMessage);
                coroutineText.Append(StatusMessage);
                coroutineText.Append(domainVerifier.CurrentState);

                // Update the label
                coroutineStatusLabel.text = coroutineText.ToString();

                // Start the verification process
                yield return(StartCoroutine(domainVerifier.VerifyWebDomain()));

                // Append verification finished
                coroutineText.AppendLine();
                coroutineText.AppendLine(VerificationEndMessage);
                coroutineText.Append(StatusMessage);
                coroutineText.Append(domainVerifier.CurrentState);

                // Update the label
                coroutineStatusLabel.text = coroutineText.ToString();
            }

            // For the purpose of saving memory, clear out the string builders
            coroutineText.Clear();
            eventsText.Clear();
        }