public async Task <Manifest> GetManifestAsync(AppId appId, DepotId depotId, ManifestId manifestId, CancellationToken cancellationToken = default) { await SteamClient.AwaitReadyAsync(cancellationToken); Exception lastEx = null; for (int i = 0; i < 30; i++) { SteamCdnClient steamCdnClient; try { steamCdnClient = await SteamCdnServerPool.GetClientAsync(); //await cdnClientWrapper.CdnClient.AuthenticateDepotAsync(depotId); var manifest = await steamCdnClient.DownloadManifestAsync(appId, depotId, manifestId); if (manifest.FilenamesEncrypted) { var depotKey = await steamCdnClient.GetDepotKeyAsync(depotId, appId); manifest.DecryptFilenames(depotKey); } return(manifest); } catch (SteamDepotAccessDeniedException) { throw; } catch (HttpRequestException ex) { lastEx = ex; } catch (Exception ex) { lastEx = ex; } } throw new SteamManifestDownloadException(lastEx); }
public async Task <Manifest> GetManifestAsync(AppId appId, DepotId depotId, ManifestId manifestId, CancellationToken cancellationToken = default) { await SteamClient.AwaitReadyAsync(cancellationToken); var pool = new SteamCdnServerPool(this, appId); try { var server = await pool.GetServerAsync(cancellationToken); var depotKey = await GetDepotKeyAsync(depotId, appId); var cdnKey = await pool.AuthenticateWithServerAsync(depotId, server); var manifest = await pool.CdnClient.DownloadManifestAsync(depotId, manifestId, server, cdnKey, depotKey, proxyServer : null); if (manifest.FilenamesEncrypted) { manifest.DecryptFilenames(depotKey); } pool.ReturnServer(server, isFaulty: false); return(manifest); } catch (SteamDepotAccessDeniedException) { throw; } catch (HttpRequestException ex) { throw new SteamManifestDownloadException(ex); } catch (Exception ex) { throw new SteamManifestDownloadException(ex); } }