초기커밋

This commit is contained in:
2025-05-01 07:20:41 +09:00
commit 98bb2e3c5c
2747 changed files with 646947 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace ServerCore;
public static class DumpHelper
{
public static DumpConfig DumpConfig;
private static void unhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
{
// 윈도우 덤프 경로: C:\Users\xxxxxx\AppData\Local\CrashDumps
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Exception ex = (Exception)e.ExceptionObject;
MiniDump.write(DumpConfig, ex);
}
}
public static void init(string dumpPath, string name)
{
DumpConfig.DumpFile = $"{dumpPath}\\{name}_{DateTime.Now.Ticks}.dmp";
DumpConfig.TxtFile = $"{dumpPath}\\{name}_{DateTime.Now.Ticks}.txt";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(DumpHelper.unhandledExceptionHandler);
}
else
{
AppDomain.CurrentDomain.UnhandledException += DumpHandler.unhandledExceptionHandler;
}
}
}