コード例 #1
0
        private bool CheckErrors(JSONNode inResponse)
        {
            if (inResponse == null)
            {
                NeedsRetry();
                return(false);
            }

            string responseError = inResponse["error"].Value;

            if (responseError != null && !String.IsNullOrEmpty(responseError))
            {
                Logger.Warn("Received error from '{0}' call:\n{1}", Type, inResponse.ToFormattedString());

                if (responseError == "jni")
                {
                    CrashScreen.Create("Unfortunately, the Enlearn adaptive engine has crashed.", true);
                    Assert.Fail("A '{0}' call produced the following error:\n{1}", Type, inResponse.ToFormattedString());
                    State = CallState.Finished;
                }
                else if (responseError.Contains("progress"))
                {
                    NeedsRetry();
                    Delay = 1.5f;
                    return(false);
                }
                else
                {
                    if (Attempts++ < RETRY_LIMIT)
                    {
                        NeedsRetry();
                    }
                    else
                    {
                        if (Required)
                        {
                            CrashScreen.Create("Unfortunately, the Enlearn adaptive engine has crashed.", true);
                            Assert.Fail("A '{0}' call timed out for {1} attempts.", Type, Attempts.ToStringLookup());
                            State = CallState.Finished;
                        }
                        else
                        {
                            Logger.Warn("A non-essential '{0}' call timed out {1} attempts. Discarding...", Type, Attempts.ToStringLookup());
                            State = CallState.Finished;
                        }
                    }
                }

                return(false);
            }

            return(true);
        }
コード例 #2
0
ファイル: Genie.cs プロジェクト: PWLPavan/Pavan
        private void OnGenieNotInstalled()
        {
#if UNITY_ANDROID
            var dialog = new AndroidDialog.AlertDialogBuilder();
            dialog.SetMessage("Genie Services is not installed.\nPlease make sure it is installed before launching this game.");
            dialog.SetPositiveButton("Okay.", (int a) => { AndroidHelper.KillActivity(); });
            dialog.SetTitle("Unable to start.");
            dialog.ShowAndDispose();
#else
            CrashScreen.Create("Genie Services is not installed.\n\nPlease make sure Genie Services is installed on your device\nbefore launching this game.", true);
#endif
        }
コード例 #3
0
 private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
 {
     if (e.Exception is System.Net.WebException)
     {
         e.Handled = true;
     }
     else
     {
         CrashScreen crashScreen = new CrashScreen(e.Exception);
         crashScreen.Show();
         App.Current.MainWindow.Close();
         e.Handled = true;
     }
 }
コード例 #4
0
        static private void CreateCrashScreen(string inMessage)
        {
            // Log a crash to Genie?
            if (Genie.Exists)
            {
                try
                {
                    // Log an event to Genie detailing the crash
                    // OE_MISC? OE_INTERRUPT?
                    Genie.I.LogEvent(new OE_MISC("crash", inMessage));
                }
                catch
                {
                    UnityEngine.Debug.LogWarning("Unable to write crash to Genie.");
                }
            }

            // Create a crash screen of some sort
            CrashScreen.Create(inMessage);

            // Or maybe just quit the application entirely?
            //Application.Quit();
        }