Added command for reloading settings, chat bots, listing chat bots and unloading a chat bot manually by name.

This commit is contained in:
Milutinke 2022-09-25 16:00:43 +02:00
parent ef79ca1fe8
commit 9b407dbdad
7 changed files with 198 additions and 46 deletions

View file

@ -46,6 +46,7 @@ namespace MinecraftClient
private static Tuple<Thread, CancellationTokenSource>? offlinePrompt = null;
private static bool useMcVersionOnce = false;
private static string? settingsIniPath = null;
/// <summary>
/// The main entry point of Minecraft Console Client
@ -104,10 +105,13 @@ namespace MinecraftClient
ConsoleIO.DebugReadInput();
}
settingsIniPath = "MinecraftClient.ini";
//Process ini configuration file
if (args.Length >= 1 && System.IO.File.Exists(args[0]) && Settings.ToLowerIfNeed(Path.GetExtension(args[0])) == ".ini")
{
Settings.LoadFile(args[0]);
settingsIniPath = args[0];
//remove ini configuration file from arguments array
List<string> args_tmp = args.ToList<string>();
@ -529,6 +533,15 @@ namespace MinecraftClient
}
}
/// <summary>
/// Reloads settings
/// </summary>
public static void ReloadSettings()
{
if (settingsIniPath != null)
Settings.LoadFile(settingsIniPath);
}
/// <summary>
/// Disconnect the current client from the server and restart it
/// </summary>