Unstable v0.1300.0.0 (February 19th 2021)
This commit is contained in:
@@ -42,6 +42,14 @@ namespace Barotrauma
|
||||
#endif
|
||||
Console.WriteLine("Barotrauma Dedicated Server " + GameMain.Version +
|
||||
" (" + AssemblyInfo.BuildString + ", branch " + AssemblyInfo.GitBranch + ", revision " + AssemblyInfo.GitRevision + ")");
|
||||
if(Console.IsOutputRedirected)
|
||||
{
|
||||
Console.WriteLine("Output redirection detected; colored text and command input will be disabled.");
|
||||
}
|
||||
if(Console.IsInputRedirected)
|
||||
{
|
||||
Console.WriteLine("Redirected input is detected but is not supported by this application. Input will be ignored.");
|
||||
}
|
||||
|
||||
string executableDir = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
|
||||
Directory.SetCurrentDirectory(executableDir);
|
||||
@@ -123,9 +131,12 @@ namespace Barotrauma
|
||||
sb.AppendLine("\n");
|
||||
sb.AppendLine("Exception: " + exception.Message + " (" + exception.GetType().ToString() + ")");
|
||||
sb.AppendLine("Target site: " +exception.TargetSite.ToString());
|
||||
sb.AppendLine("Stack trace: ");
|
||||
sb.AppendLine(exception.StackTrace.CleanupStackTrace());
|
||||
sb.AppendLine("\n");
|
||||
if (exception.StackTrace != null)
|
||||
{
|
||||
sb.AppendLine("Stack trace: ");
|
||||
sb.AppendLine(exception.StackTrace.CleanupStackTrace());
|
||||
sb.AppendLine("\n");
|
||||
}
|
||||
|
||||
if (exception.InnerException != null)
|
||||
{
|
||||
@@ -134,8 +145,11 @@ namespace Barotrauma
|
||||
{
|
||||
sb.AppendLine("Target site: " + exception.InnerException.TargetSite.ToString());
|
||||
}
|
||||
sb.AppendLine("Stack trace: ");
|
||||
sb.AppendLine(exception.InnerException.StackTrace.CleanupStackTrace());
|
||||
if (exception.InnerException.StackTrace != null)
|
||||
{
|
||||
sb.AppendLine("Stack trace: ");
|
||||
sb.AppendLine(exception.InnerException.StackTrace.CleanupStackTrace());
|
||||
}
|
||||
}
|
||||
|
||||
sb.AppendLine("Last debug messages:");
|
||||
@@ -146,7 +160,11 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
string crashReport = sb.ToString();
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
|
||||
if (!Console.IsOutputRedirected)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
}
|
||||
Console.Write(crashReport);
|
||||
|
||||
File.WriteAllText(filePath,sb.ToString());
|
||||
|
||||
Reference in New Issue
Block a user