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 ca87f1bb5d
5 changed files with 65 additions and 5 deletions

View file

@ -1579,6 +1579,12 @@ namespace MinecraftClient
if (String.IsNullOrEmpty(text))
return;
if (!CanSendMessage)
{
Log.Warn(Translations.mcc_send_text_not_connected);
return;
}
int maxLength = handler.GetMaxChatMessageLength();
lock (chatQueue)