AutoRelog McClient.cs

This commit is contained in:
Somersault 2026-06-29 00:46:52 +03:00 committed by GitHub
parent b0f003fd58
commit 745678e869
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -551,8 +551,33 @@ namespace MinecraftClient
if (!consoleReadThreadOwned) if (!consoleReadThreadOwned)
{ {
ConsoleIO.Backend.BeginReadThread(); try
consoleReadThreadOwned = true; {
ConsoleIO.Backend.BeginReadThread();
consoleReadThreadOwned = true;
}
catch (Exception ex)
{
try
{
ConsoleIO.Backend.StopReadThread();
}
catch (Exception stopEx)
{
ConsoleIO.WriteLineFormatted($"§c[MCC] Failed to stop stale console input thread during reconnect: {stopEx.Message}");
}
try
{
ConsoleIO.Backend.BeginReadThread();
consoleReadThreadOwned = true;
}
catch (Exception retryEx)
{
ConsoleIO.WriteLineFormatted($"§c[MCC] Failed to start console input thread after reconnect retry: {retryEx.Message}");
consoleReadThreadOwned = false;
}
}
} }
if (!consoleHandlersAttached) if (!consoleHandlersAttached)