fix: resolve AutoRelog reconnect errors (#3036)

- Reset _BotRecoAttempts on successful game join so retry counter
  does not carry stale state across sessions
- Display "unlimited" instead of near-int.MaxValue retry count when
  Retries is set to -1 (infinite)
- Guard SendText with CanSendMessage check to prevent
  NullReferenceException when bots call send after disconnect
- Catch SocketException/IOException in Protocol18 Updater thread so
  a closed socket triggers OnConnectionLost gracefully instead of an
  unhandled exception

Made-with: Cursor
This commit is contained in:
BruceChen 2026-04-03 01:26:59 +08:00
parent 2441c67178
commit 2003786608
5 changed files with 65 additions and 5 deletions

View file

@ -324,6 +324,12 @@ namespace MinecraftClient.Protocol.Handlers
catch (NullReferenceException)
{
}
catch (SocketException)
{
}
catch (System.IO.IOException)
{
}
if (cancelToken.IsCancellationRequested)
return;