Fixed bug where files over 5kb were written incorrectly

This commit is contained in:
EntenKoeniq
2022-04-06 10:43:32 +02:00
parent ce00f07e89
commit 5991aba8fc
4 changed files with 13 additions and 19 deletions

View File

@ -74,7 +74,7 @@ namespace CoopClient
return false;
}
public static void Write(byte id, byte[] data)
public static void Write(byte id, byte[] chunk)
{
lock (_filesFinished)
{
@ -94,7 +94,7 @@ namespace CoopClient
return;
}
fs.Write(data, 0, data.Length);
fs.Write(chunk, 0, chunk.Length);
lock (_downloadFiles)
{
@ -105,7 +105,7 @@ namespace CoopClient
return;
}
file.FileWritten += data.Length;
file.FileWritten += chunk.Length;
if (file.FileWritten >= file.FileLength)
{

View File

@ -467,8 +467,6 @@ namespace CoopClient
{
GTA.UI.Notification.Show("~r~~h~Packet Error");
Logger.Write($"[{packetType}] {ex.Message}", Logger.LogLevel.Server);
Logger.Write($"[{packetType}] {ex.Source}", Logger.LogLevel.Server);
Logger.Write($"[{packetType}] {ex.StackTrace}", Logger.LogLevel.Server);
Client.Disconnect($"Packet Error [{packetType}]");
}
}