mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Make AutoRelog more reliable
Makes AutoRelog more hands on with the relogging rather than have the general relogging handler handle it. Fallback to the general handler only when the AutoRelog module is disabled.
This commit is contained in:
parent
c78245c056
commit
a72a8cf833
2 changed files with 42 additions and 20 deletions
|
|
@ -137,9 +137,10 @@ namespace MinecraftClient.ChatBots
|
|||
{
|
||||
double delay = random.NextDouble() * (Config.Delay.max - Config.Delay.min) + Config.Delay.min;
|
||||
LogDebugToConsole(string.Format(string.IsNullOrEmpty(msg) ? Translations.bot_autoRelog_reconnect_always : Translations.bot_autoRelog_reconnect, msg));
|
||||
LogToConsole(string.Format(Translations.bot_autoRelog_wait, delay));
|
||||
System.Threading.Thread.Sleep((int)Math.Floor(delay * 1000));
|
||||
ReconnectToTheServer();
|
||||
|
||||
// TODO: Change this translation string to add the retries left text
|
||||
LogToConsole(string.Format(Translations.bot_autoRelog_wait, delay) + $" ({Config.Retries - Configs._BotRecoAttempts} retries left)");
|
||||
ReconnectToTheServer(Config.Retries - Configs._BotRecoAttempts, (int)Math.Floor(delay), true);
|
||||
}
|
||||
|
||||
public static bool OnDisconnectStatic(DisconnectReason reason, string message)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue