mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
Crash Report Changes
- removed the dumplog as it is never used.
This commit is contained in:
parent
5fff2abc91
commit
08b93429a5
2 changed files with 5 additions and 91 deletions
|
|
@ -2,11 +2,9 @@
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using ServerManagerTool.Common.Utils;
|
using ServerManagerTool.Common.Utils;
|
||||||
using ServerManagerTool.Lib;
|
|
||||||
|
|
||||||
namespace ServerManagerTool
|
namespace ServerManagerTool
|
||||||
{
|
{
|
||||||
|
|
@ -18,23 +16,17 @@ namespace ServerManagerTool
|
||||||
// Write out a log file with all the details so users can send us the info...
|
// Write out a log file with all the details so users can send us the info...
|
||||||
|
|
||||||
var file = Path.GetTempFileName();
|
var file = Path.GetTempFileName();
|
||||||
var crashFile = file + ".dmp";
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
MiniDumpToFile(crashFile);
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var details = new StringBuilder();
|
var details = new StringBuilder();
|
||||||
details.AppendLine("ARK Server Manager Crash Report");
|
details.AppendLine("Server Manager Crash Report");
|
||||||
details.AppendLine($"Please report this crash to the Server Manager discord - {Config.Default.DiscordUrl}");
|
details.AppendLine($"Please report this crash to the Server Manager discord - {Config.Default.DiscordUrl}");
|
||||||
details.AppendLine();
|
details.AppendLine();
|
||||||
|
|
||||||
details.AppendLine($"Assembly: {Assembly.GetExecutingAssembly()}");
|
details.AppendLine($"Assembly: {Assembly.GetExecutingAssembly()}");
|
||||||
details.AppendLine($"Version: {App.Instance.Version}");
|
details.AppendLine($"Version: {App.Instance.Version}");
|
||||||
|
details.AppendLine($"Code: {Config.Default.ServerManagerCode}");
|
||||||
details.AppendLine($"IsAdministrator: {SecurityUtils.IsAdministrator()}");
|
details.AppendLine($"IsAdministrator: {SecurityUtils.IsAdministrator()}");
|
||||||
details.AppendLine();
|
details.AppendLine();
|
||||||
|
|
||||||
|
|
@ -42,9 +34,6 @@ namespace ServerManagerTool
|
||||||
details.AppendLine($"Windows Version: {Environment.OSVersion.VersionString}");
|
details.AppendLine($"Windows Version: {Environment.OSVersion.VersionString}");
|
||||||
details.AppendLine();
|
details.AppendLine();
|
||||||
|
|
||||||
details.AppendLine($"Crash Dump: {crashFile}");
|
|
||||||
details.AppendLine();
|
|
||||||
|
|
||||||
var exception = e.ExceptionObject as Exception;
|
var exception = e.ExceptionObject as Exception;
|
||||||
if (exception != null)
|
if (exception != null)
|
||||||
{
|
{
|
||||||
|
|
@ -61,13 +50,12 @@ namespace ServerManagerTool
|
||||||
var message = new StringBuilder();
|
var message = new StringBuilder();
|
||||||
message.AppendLine("OOPS! ARK Server Manager has suffered from an internal error and must shut down, this is probably a bug and should be reported. The error files are:");
|
message.AppendLine("OOPS! ARK Server Manager has suffered from an internal error and must shut down, this is probably a bug and should be reported. The error files are:");
|
||||||
message.AppendLine($"Error File: {file}");
|
message.AppendLine($"Error File: {file}");
|
||||||
message.AppendLine($"Crash Dump: {crashFile}");
|
|
||||||
details.AppendLine();
|
details.AppendLine();
|
||||||
details.AppendLine();
|
details.AppendLine();
|
||||||
message.AppendLine($"Please report this crash to the Server Manager discord - {Config.Default.DiscordUrl}");
|
message.AppendLine($"Please report this crash to the Server Manager discord - {Config.Default.DiscordUrl}");
|
||||||
message.AppendLine("The crash log will now be opened in notepad.");
|
message.AppendLine("The crash log will now be opened in notepad.");
|
||||||
|
|
||||||
var result = MessageBox.Show(message.ToString(), "ARK Server Manager crashed", MessageBoxButton.OK, MessageBoxImage.Exclamation);
|
var result = MessageBox.Show(message.ToString(), "Server Manager crashed", MessageBoxButton.OK, MessageBoxImage.Exclamation);
|
||||||
if (result == MessageBoxResult.OK)
|
if (result == MessageBoxResult.OK)
|
||||||
{
|
{
|
||||||
Process.Start("notepad.exe", file);
|
Process.Start("notepad.exe", file);
|
||||||
|
|
@ -82,36 +70,5 @@ namespace ServerManagerTool
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal enum MinidumpType
|
|
||||||
{
|
|
||||||
MiniDumpNormal = 0x00000000,
|
|
||||||
MiniDumpWithDataSegs = 0x00000001,
|
|
||||||
MiniDumpWithFullMemory = 0x00000002,
|
|
||||||
MiniDumpWithHandleData = 0x00000004,
|
|
||||||
MiniDumpFilterMemory = 0x00000008,
|
|
||||||
MiniDumpScanMemory = 0x00000010,
|
|
||||||
MiniDumpWithUnloadedModules = 0x00000020,
|
|
||||||
MiniDumpWithIndirectlyReferencedMemory = 0x00000040,
|
|
||||||
MiniDumpFilterModulePaths = 0x00000080,
|
|
||||||
MiniDumpWithProcessThreadData = 0x00000100,
|
|
||||||
MiniDumpWithPrivateReadWriteMemory = 0x00000200,
|
|
||||||
MiniDumpWithoutOptionalData = 0x00000400,
|
|
||||||
MiniDumpWithFullMemoryInfo = 0x00000800,
|
|
||||||
MiniDumpWithThreadInfo = 0x00001000,
|
|
||||||
MiniDumpWithCodeSegs = 0x00002000
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport("dbghelp.dll")]
|
|
||||||
static extern bool MiniDumpWriteDump(IntPtr hProcess, Int32 ProcessId, IntPtr hFile, MinidumpType DumpType, IntPtr ExceptionParam, IntPtr UserStreamParam, IntPtr CallackParam);
|
|
||||||
|
|
||||||
public static void MiniDumpToFile(String fileToDump)
|
|
||||||
{
|
|
||||||
var fsToDump = File.Create(fileToDump);
|
|
||||||
|
|
||||||
Process thisProcess = Process.GetCurrentProcess();
|
|
||||||
MiniDumpWriteDump(thisProcess.Handle, thisProcess.Id, fsToDump.SafeFileHandle.DangerousGetHandle(), MinidumpType.MiniDumpWithFullMemory, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
|
|
||||||
fsToDump.Close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
using ServerManagerTool.Common.Utils;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using ServerManagerTool.Common.Utils;
|
||||||
|
|
||||||
namespace ServerManagerTool
|
namespace ServerManagerTool
|
||||||
{
|
{
|
||||||
|
|
@ -17,13 +16,6 @@ namespace ServerManagerTool
|
||||||
// Write out a log file with all the details so users can send us the info...
|
// Write out a log file with all the details so users can send us the info...
|
||||||
|
|
||||||
var file = Path.GetTempFileName();
|
var file = Path.GetTempFileName();
|
||||||
var crashFile = file + ".dmp";
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
MiniDumpToFile(crashFile);
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -42,9 +34,6 @@ namespace ServerManagerTool
|
||||||
details.AppendLine($"Windows Version: {Environment.OSVersion.VersionString}");
|
details.AppendLine($"Windows Version: {Environment.OSVersion.VersionString}");
|
||||||
details.AppendLine();
|
details.AppendLine();
|
||||||
|
|
||||||
details.AppendLine($"Crash Dump: {crashFile}");
|
|
||||||
details.AppendLine();
|
|
||||||
|
|
||||||
var exception = e.ExceptionObject as Exception;
|
var exception = e.ExceptionObject as Exception;
|
||||||
if (exception != null)
|
if (exception != null)
|
||||||
{
|
{
|
||||||
|
|
@ -61,7 +50,6 @@ namespace ServerManagerTool
|
||||||
var message = new StringBuilder();
|
var message = new StringBuilder();
|
||||||
message.AppendLine("OOPS! The Server Manager has suffered from an internal error and must shut down, this is probably a bug and should be reported. The error files are:");
|
message.AppendLine("OOPS! The Server Manager has suffered from an internal error and must shut down, this is probably a bug and should be reported. The error files are:");
|
||||||
message.AppendLine($"Error File: {file}");
|
message.AppendLine($"Error File: {file}");
|
||||||
message.AppendLine($"Crash Dump: {crashFile}");
|
|
||||||
details.AppendLine();
|
details.AppendLine();
|
||||||
details.AppendLine();
|
details.AppendLine();
|
||||||
message.AppendLine($"Please report this crash to the Server Manager discord - {Config.Default.DiscordUrl}");
|
message.AppendLine($"Please report this crash to the Server Manager discord - {Config.Default.DiscordUrl}");
|
||||||
|
|
@ -82,36 +70,5 @@ namespace ServerManagerTool
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal enum MinidumpType
|
|
||||||
{
|
|
||||||
MiniDumpNormal = 0x00000000,
|
|
||||||
MiniDumpWithDataSegs = 0x00000001,
|
|
||||||
MiniDumpWithFullMemory = 0x00000002,
|
|
||||||
MiniDumpWithHandleData = 0x00000004,
|
|
||||||
MiniDumpFilterMemory = 0x00000008,
|
|
||||||
MiniDumpScanMemory = 0x00000010,
|
|
||||||
MiniDumpWithUnloadedModules = 0x00000020,
|
|
||||||
MiniDumpWithIndirectlyReferencedMemory = 0x00000040,
|
|
||||||
MiniDumpFilterModulePaths = 0x00000080,
|
|
||||||
MiniDumpWithProcessThreadData = 0x00000100,
|
|
||||||
MiniDumpWithPrivateReadWriteMemory = 0x00000200,
|
|
||||||
MiniDumpWithoutOptionalData = 0x00000400,
|
|
||||||
MiniDumpWithFullMemoryInfo = 0x00000800,
|
|
||||||
MiniDumpWithThreadInfo = 0x00001000,
|
|
||||||
MiniDumpWithCodeSegs = 0x00002000
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport("dbghelp.dll")]
|
|
||||||
static extern bool MiniDumpWriteDump(IntPtr hProcess, Int32 ProcessId, IntPtr hFile, MinidumpType DumpType, IntPtr ExceptionParam, IntPtr UserStreamParam, IntPtr CallackParam);
|
|
||||||
|
|
||||||
public static void MiniDumpToFile(String fileToDump)
|
|
||||||
{
|
|
||||||
var fsToDump = File.Create(fileToDump);
|
|
||||||
|
|
||||||
Process thisProcess = Process.GetCurrentProcess();
|
|
||||||
MiniDumpWriteDump(thisProcess.Handle, thisProcess.Id, fsToDump.SafeFileHandle.DangerousGetHandle(), MinidumpType.MiniDumpWithFullMemory, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
|
|
||||||
fsToDump.Close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue