static void OnCrash(string logPath, string gameName, string minimumRequirementsPage, bool requiresDX11, Exception e) { try { MyRenderException renderException = e as MyRenderException; if (renderException != null) { MyErrorReporter.ReportRendererCrash(logPath, gameName, minimumRequirementsPage, renderException.Type); } //else if (requiresDX11 && IsUnsupportedGpu(e)) //{ // MyErrorReporter.ReportNotDX11GPUCrash(gameName, logPath, minimumRequirementsPage); //} else if (/*IsUnsupportedGpu(e) || */ MyVideoSettingsManager.GpuUnderMinimum) // Uncomment this too { MyErrorReporter.ReportGpuUnderMinimumCrash(gameName, logPath, minimumRequirementsPage); } else if (!MySandboxGame.IsDedicated && IsOutOfMemory(e)) { MyErrorReporter.ReportOutOfMemory(gameName, logPath, minimumRequirementsPage); } else if (!MySandboxGame.IsDedicated && IsOutOfVideoMemory(e)) { MyErrorReporter.ReportOutOfVideoMemory(gameName, logPath, minimumRequirementsPage); } else { #if !XB1 bool isSilentException = false; if (e.Data.Contains("Silent")) { bool.TryParse((string)e.Data["Silent"], out isSilentException); } string arg = (requiresDX11 && IsUnsupportedGpu(e)) ? "reporX" : "report"; if (!isSilentException) { ProcessStartInfo pi = new ProcessStartInfo(); pi.Arguments = string.Format("-{2} \"{0}\" \"{1}\"", logPath, gameName, arg); pi.FileName = Assembly.GetEntryAssembly().Location; pi.UseShellExecute = false; pi.WindowStyle = ProcessWindowStyle.Hidden; pi.RedirectStandardInput = true; var p = Process.Start(pi); p.StandardInput.Close(); } #else // XB1 System.Diagnostics.Debug.Assert(false, "XB1 TODO?"); #endif // XB1 } MyAnalyticsTracker.ReportError(MyAnalyticsTracker.SeverityEnum.Critical, e, async: false); } catch { // When cannot start reporter, do nothing } }
public bool CheckSingleInstance() { MySingleProgramInstance spi = new MySingleProgramInstance(MyFileSystem.MainAssemblyName); if (spi.IsSingleInstance == false) { MyErrorReporter.ReportAppAlreadyRunning(GameInfo.GameName); return(false); } return(true); }
public bool PerformReporting() { if (m_args.Contains("-report")) { MyErrorReporter.Report(m_args[1], m_args[2], GameInfo.GameAcronym, MyErrorReporter.APP_ERROR_MESSAGE); return(true); } else if (m_args.Contains("-reporX")) // Temporary message for two more days to log unsupported GPUs { string error = String.Format(MyErrorReporter.APP_ERROR_MESSAGE_DX11_NOT_AVAILABLE, m_args[1], m_args[2], GameInfo.MinimumRequirementsWeb); MyErrorReporter.Report(m_args[1], m_args[2], GameInfo.GameAcronym, error); return(true); } return(false); }