초기커밋

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,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ServerCore;
public struct DumpConfig
{
public string DumpFile;
public string TxtFile;
}
public static class DumpHandler
{
public static void unhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
{
var exception = e.ExceptionObject as Exception;
File.WriteAllText("unhandled_exception.log", exception?.ToString());
writeTxt(DumpHelper.DumpConfig, exception);
}
public static void writeTxt(DumpConfig dumpCopnfig, Exception? e)
{
using (var fs = new FileStream(dumpCopnfig.TxtFile, FileMode.Create, FileAccess.ReadWrite, FileShare.Write))
{
using (StreamWriter writer = new StreamWriter(fs))
{
writer.WriteLine("================================================================================================");
writer.WriteLine("Date : " + DateTime.Now.ToString());
writer.WriteLine();
Exception? exception = e;
while (exception != null)
{
writer.WriteLine($"{exception}");
writer.WriteLine("================================================================================================");
exception = exception.InnerException;
}
}
}
}
}