1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

prevent exiting immediately on error. updated mvc packages

This commit is contained in:
RaidMax
2018-03-13 19:12:24 -05:00
parent ae4fa23884
commit c3d5f6ac26
6 changed files with 21 additions and 18 deletions

View File

@ -31,16 +31,11 @@ namespace IW4MAdmin
try
{
/*var v1 = SharedLibrary.Helpers.Vector3.Parse("(737, 1117, 268)");
var v2 = SharedLibrary.Helpers.Vector3.Parse("(1510, 672.98, -228.66)");
double angleBetween = v1.AngleBetween(v2);*/
CheckDirectories();
ServerManager = ApplicationManager.GetInstance();
SharedLibrary.Database.Repair.Run(ServerManager.Logger);
ServerManager.Init().Wait();
@ -76,6 +71,11 @@ namespace IW4MAdmin
catch (Exception e)
{
Console.WriteLine($"Fatal Error during initialization: {e.Message}");
while(e.InnerException != null)
{
e = e.InnerException;
Console.WriteLine($"Inner exception: {e.Message}");
}
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
return;

View File

@ -134,6 +134,9 @@ namespace IW4MAdmin
Logger.WriteDebug(e.Message);
Logger.WriteDebug($"Internal Exception: {e.Data["internal_exception"]}");
}
// throw the exception to the main method to stop before instantly exiting
throw e;
}
}

View File

@ -620,8 +620,8 @@ namespace IW4MAdmin
string mainPath = (GameName == Game.IW4 && onelog.Value >=0) ? "userraw" : "main";
string logPath = (game.Value == "" || onelog?.Value == 1) ?
$"{ basepath.Value.Replace("\\", "/")}/{mainPath}/{logfile.Value}" :
$"{basepath.Value.Replace("\\", "/")}/{game.Value}/{logfile.Value}";
$"{basepath.Value.Replace('\\', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{mainPath}{Path.DirectorySeparatorChar}{logfile.Value}" :
$"{basepath.Value.Replace('\\', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{game.Value.Replace('\\', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}{logfile.Value}";
if (!File.Exists(logPath))
{