mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
ScriptScheduler: Add debug messages for issue #431
These messages will only apprear if debugmessages=true in config.
This commit is contained in:
parent
18fd24d2d5
commit
79aaa04775
4 changed files with 63 additions and 9 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue