mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
bufix: Fixed a bug in Auto Relog and improved reliability
This commit is contained in:
commit
a1ab366787
1 changed files with 14 additions and 10 deletions
|
|
@ -313,19 +313,23 @@ namespace MinecraftClient
|
|||
}
|
||||
else
|
||||
{
|
||||
// The AutoRelog ChatBot will handle reconnection at this point.
|
||||
// This is important, or else we'll have multiple instances of the client running at the same time.
|
||||
// AutoRelog is enabled - invoke its static handler to trigger reconnection.
|
||||
// Use the same "Connection has been lost" message that OnConnectionLost uses
|
||||
// for ConnectionLost, so it matches the default Kick_Messages.
|
||||
if (AutoRelog.OnDisconnectStatic(ChatBot.DisconnectReason.ConnectionLost, Translations.mcc_disconnect_lost))
|
||||
return; // AutoRelog is triggering a restart
|
||||
|
||||
if (ReconnectionAttemptsLeft == 0)
|
||||
// AutoRelog chose not to reconnect (e.g., message didn't match
|
||||
// kick messages and Ignore_Kick_Message is false, or retry limit reached)
|
||||
if (InternalConfig.InteractiveMode)
|
||||
{
|
||||
if (InternalConfig.InteractiveMode)
|
||||
{
|
||||
ConsoleInteractive.ConsoleReader.StopReadThread();
|
||||
ConsoleInteractive.ConsoleReader.MessageReceived -= ConsoleReaderOnMessageReceived;
|
||||
ConsoleInteractive.ConsoleReader.OnInputChange -= ConsoleIO.AutocompleteHandler;
|
||||
Program.HandleFailure();
|
||||
}
|
||||
ConsoleInteractive.ConsoleReader.StopReadThread();
|
||||
ConsoleInteractive.ConsoleReader.MessageReceived -= ConsoleReaderOnMessageReceived;
|
||||
ConsoleInteractive.ConsoleReader.OnInputChange -= ConsoleIO.AutocompleteHandler;
|
||||
Program.HandleFailure();
|
||||
}
|
||||
|
||||
throw new Exception("Initialization failed.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue