mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Optimize ChatBot loading.
This commit is contained in:
parent
096ea0c70c
commit
87026e1bfb
13 changed files with 264 additions and 249 deletions
|
|
@ -38,7 +38,7 @@ namespace MinecraftClient.Scripting
|
|||
public void SetHandler(McClient handler) { _handler = handler; }
|
||||
protected void SetMaster(ChatBot master) { this.master = master; }
|
||||
protected void LoadBot(ChatBot bot) { Handler.BotUnLoad(bot).Wait(); Handler.BotLoad(bot); }
|
||||
protected List<ChatBot> GetLoadedChatBots() { return Handler.GetLoadedChatBots(); }
|
||||
protected ChatBot[] GetLoadedChatBots() { return Handler.GetLoadedChatBots(); }
|
||||
protected void UnLoadBot(ChatBot bot) { Handler.BotUnLoad(bot).Wait(); }
|
||||
private McClient? _handler = null;
|
||||
private ChatBot? master = null;
|
||||
|
|
@ -945,7 +945,7 @@ namespace MinecraftClient.Scripting
|
|||
ConsoleIO.WriteLogLine(string.Format(Translations.chatbot_reconnect, botName));
|
||||
}
|
||||
McClient.ReconnectionAttemptsLeft = ExtraAttempts;
|
||||
Program.Restart(delaySeconds * 10, keepAccountAndServerSettings);
|
||||
Program.SetRestart(delaySeconds * 10, keepAccountAndServerSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -953,7 +953,7 @@ namespace MinecraftClient.Scripting
|
|||
/// </summary>
|
||||
protected void DisconnectAndExit()
|
||||
{
|
||||
Program.Exit();
|
||||
Program.SetExit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue