mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
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:
parent
142fb107db
commit
9e271a2f06
8 changed files with 668 additions and 327 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue