Prevent closing the server if an exception happens
This commit is contained in:
@@ -26,6 +26,23 @@ namespace SPTarkov.Server;
|
||||
public static class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
await StartServer(args);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("=========================================================================================================");
|
||||
Console.WriteLine("The server has unexpectedly stopped, please check your log files and reach out to #spt-support in discord");
|
||||
Console.WriteLine(e);
|
||||
Console.WriteLine("=========================================================================================================");
|
||||
Console.WriteLine("Press any key to exit...");
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task StartServer(string[] args)
|
||||
{
|
||||
Console.OutputEncoding = Encoding.UTF8;
|
||||
|
||||
@@ -95,6 +112,7 @@ public static class Program
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
serverExceptionLogger.LogCritical(ex, "Critical exception, stopping server...");
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user