ScriptScheduler: Add debug messages for issue #431

These messages will only apprear if debugmessages=true in config.
This commit is contained in:
ORelio 2018-05-08 19:27:19 +02:00
parent 18fd24d2d5
commit 79aaa04775
4 changed files with 63 additions and 9 deletions

View file

@ -6,6 +6,7 @@ using System.Threading;
using Microsoft.CSharp;
using System.CodeDom.Compiler;
using System.Reflection;
using System.Diagnostics;
namespace MinecraftClient.ChatBots
{
@ -108,6 +109,20 @@ namespace MinecraftClient.ChatBots
}
}
if (Settings.DebugMessages)
{
string caller = "Script";
try
{
StackFrame frame = new StackFrame(1);
MethodBase method = frame.GetMethod();
Type type = method.DeclaringType;
caller = type.Name;
}
catch { }
ConsoleIO.WriteLineFormatted(String.Format("§8[MCC] [{0}] Cannot find script file: {1}", caller, filename));
}
return false;
}