From 3393e7e40212025ed88015b19538c0a844891d07 Mon Sep 17 00:00:00 2001 From: TheSnoozer Date: Sun, 22 Sep 2019 10:16:43 +0200 Subject: [PATCH] report the full path when loading any files which might help in troubleshooting files not found properly --- MinecraftClient/ChatBot.cs | 2 +- MinecraftClient/ChatBots/AutoRelog.cs | 4 ++-- MinecraftClient/ChatBots/AutoRespond.cs | 5 ++++- MinecraftClient/ChatBots/Script.cs | 2 +- MinecraftClient/ChatBots/ScriptScheduler.cs | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/MinecraftClient/ChatBot.cs b/MinecraftClient/ChatBot.cs index ab595369..4f027e30 100644 --- a/MinecraftClient/ChatBot.cs +++ b/MinecraftClient/ChatBot.cs @@ -663,7 +663,7 @@ namespace MinecraftClient } else { - LogToConsole("File not found: " + Settings.Alerts_MatchesFile); + LogToConsole("File not found: " + System.IO.Path.GetFullPath(file)); return new string[0]; } } diff --git a/MinecraftClient/ChatBots/AutoRelog.cs b/MinecraftClient/ChatBots/AutoRelog.cs index 12a45d34..2f1dcf1b 100644 --- a/MinecraftClient/ChatBots/AutoRelog.cs +++ b/MinecraftClient/ChatBots/AutoRelog.cs @@ -36,7 +36,7 @@ namespace MinecraftClient.ChatBots if (System.IO.File.Exists(Settings.AutoRelog_KickMessagesFile)) { if (Settings.DebugMessages) - LogToConsole("Loading messages from file: " + Settings.AutoRelog_KickMessagesFile); + LogToConsole("Loading messages from file: " + System.IO.Path.GetFullPath(Settings.AutoRelog_KickMessagesFile)); dictionary = System.IO.File.ReadAllLines(Settings.AutoRelog_KickMessagesFile); @@ -49,7 +49,7 @@ namespace MinecraftClient.ChatBots } else { - LogToConsole("File not found: " + Settings.AutoRelog_KickMessagesFile); + LogToConsole("File not found: " + System.IO.Path.GetFullPath(Settings.AutoRelog_KickMessagesFile)); if (Settings.DebugMessages) LogToConsole(" Current directory was: " + System.IO.Directory.GetCurrentDirectory()); diff --git a/MinecraftClient/ChatBots/AutoRespond.cs b/MinecraftClient/ChatBots/AutoRespond.cs index c1c0b559..a11413bf 100644 --- a/MinecraftClient/ChatBots/AutoRespond.cs +++ b/MinecraftClient/ChatBots/AutoRespond.cs @@ -132,6 +132,9 @@ namespace MinecraftClient.ChatBots bool ownersOnly = false; respondRules = new List(); + if (Settings.DebugMessages) + LogToConsole("Loading matches from file: " + System.IO.Path.GetFullPath(matchesFile)); + foreach (string lineRAW in File.ReadAllLines(matchesFile)) { string line = lineRAW.Split('#')[0].Trim(); @@ -175,7 +178,7 @@ namespace MinecraftClient.ChatBots } else { - LogToConsole("File not found: '" + matchesFile + "'"); + LogToConsole("File not found: '" + System.IO.Path.GetFullPath(matchesFile) + "'"); UnloadBot(); //No need to keep the bot active } } diff --git a/MinecraftClient/ChatBots/Script.cs b/MinecraftClient/ChatBots/Script.cs index df8d8a49..84209238 100644 --- a/MinecraftClient/ChatBots/Script.cs +++ b/MinecraftClient/ChatBots/Script.cs @@ -140,7 +140,7 @@ namespace MinecraftClient.ChatBots } else { - LogToConsole("File not found: '" + file + "'"); + LogToConsole("File not found: '" + System.IO.Path.GetFullPath(file) + "'"); if (owner != null) SendPrivateMessage(owner, "File not found: '" + file + "'"); diff --git a/MinecraftClient/ChatBots/ScriptScheduler.cs b/MinecraftClient/ChatBots/ScriptScheduler.cs index 0821d384..ce7c4bbb 100644 --- a/MinecraftClient/ChatBots/ScriptScheduler.cs +++ b/MinecraftClient/ChatBots/ScriptScheduler.cs @@ -45,7 +45,7 @@ namespace MinecraftClient.ChatBots if (System.IO.File.Exists(tasksfile)) { if (Settings.DebugMessages) - LogToConsole("Loading tasks from '" + tasksfile + "'"); + LogToConsole("Loading tasks from '" + System.IO.Path.GetFullPath(tasksfile) + "'"); TaskDesc current_task = null; String[] lines = System.IO.File.ReadAllLines(tasksfile); foreach (string lineRAW in lines) @@ -87,7 +87,7 @@ namespace MinecraftClient.ChatBots } else { - LogToConsole("File not found: '" + tasksfile + "'"); + LogToConsole("File not found: '" + System.IO.Path.GetFullPath(tasksfile) + "'"); UnloadBot(); //No need to keep the bot active } }