Problems:

1) The AutoRelog ChatBot stopped trying to log in after the 3rd attempt.
2) The AutoRelog ChatBot stopped trying to log in after the internet connection was interrupted. MCC froze.

2 problems have been solved.
This commit is contained in:
Somersault 2026-07-18 21:37:52 +03:00
parent 142fb107db
commit 9e271a2f06
8 changed files with 668 additions and 327 deletions

View file

@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Net.Sockets;
using MinecraftClient.Crypto;
@ -61,10 +62,31 @@ namespace MinecraftClient.Protocol.Handlers
int read = 0;
while (read < offset)
{
if (encrypted)
read += s!.Read(buffer, start + read, offset - read);
else
read += c.Client.Receive(buffer, start + read, offset - read, f);
int received;
try
{
if (encrypted)
received = s!.Read(buffer, start + read, offset - read);
else
received = c.Client.Receive(buffer, start + read, offset - read, f);
}
catch (SocketException)
{
throw;
}
catch (ObjectDisposedException)
{
throw;
}
catch (IOException)
{
throw;
}
if (received <= 0)
throw new IOException("Socket closed while reading from the server.");
read += received;
}
}