Another fix

pull/477/head
minecraftitsover90@gmail.com 2 years ago
parent 7f4c372120
commit 51c26a1880

@ -5,6 +5,7 @@ using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using SteamKit2;
using SteamKit2.CDN;
namespace DepotDownloader
@ -154,6 +155,24 @@ namespace DepotDownloader
return availableServerEndpoints.Take(token);
}
public async Task<DepotChunk> DownloadDepotChunkAsync(uint depotId, DepotManifest.ChunkData chunkData, Server connection, byte[] depotKey)
{
try
{
// Call the DownloadDepotChunkAsync method of CDNClient
var chunk = await CDNClient.DownloadDepotChunkAsync(depotId, chunkData, connection, depotKey);
// Return the downloaded chunk
return chunk;
}
catch (Exception ex)
{
// Handle any exceptions that occur during chunk download
Console.WriteLine($"Error downloading chunk: {ex.Message}");
return null;
}
}
public Server GetConnection(CancellationToken token)
{
if (!activeConnectionPool.TryPop(out var connection))

Loading…
Cancel
Save