From 7d4b95f3428d9d0cfb1bf97fbc67f3394a1d8fcd Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 24 Nov 2025 07:22:47 +0000 Subject: [PATCH] Improve serveradmin.xml error logging - show all attempted paths --- Harmony/CHRANIBotTNG.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Harmony/CHRANIBotTNG.cs b/Harmony/CHRANIBotTNG.cs index d74793b..b7c4b37 100644 --- a/Harmony/CHRANIBotTNG.cs +++ b/Harmony/CHRANIBotTNG.cs @@ -170,6 +170,8 @@ public static class AdminManager private static string FindServerAdminXml() { + List attemptedPaths = new List(); + try { // Try common locations @@ -185,19 +187,32 @@ public static class AdminManager try { string fullPath = Path.GetFullPath(path); + attemptedPaths.Add(fullPath); + if (File.Exists(fullPath)) { Console.WriteLine($"[AdminManager] Found serveradmin.xml: {fullPath}"); return fullPath; } } - catch { } + catch (Exception e) + { + attemptedPaths.Add($"{path} (Error: {e.Message})"); + } } } catch (Exception e) { Console.WriteLine($"[AdminManager] Error finding serveradmin.xml: {e.Message}"); } + + // Log all attempted paths + Console.WriteLine("[AdminManager] serveradmin.xml not found. Attempted paths:"); + foreach (var path in attemptedPaths) + { + Console.WriteLine($" - {path}"); + } + return null; }