mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #1808 from wabbajack-tools/retry-steam-calls
Add retry logic to GetAppManifest
This commit is contained in:
2
.github/workflows/tests.yaml
vendored
2
.github/workflows/tests.yaml
vendored
@ -7,7 +7,7 @@ on:
|
|||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
VERSION: 3.0.0.0-beta5
|
VERSION: 3.0.0.0-beta6
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -376,24 +376,29 @@ public class Client : IDisposable
|
|||||||
public async Task<DepotManifest> GetAppManifest(uint appId, uint depotId, ulong manifestId)
|
public async Task<DepotManifest> GetAppManifest(uint appId, uint depotId, ulong manifestId)
|
||||||
{
|
{
|
||||||
await LoadCDNServers();
|
await LoadCDNServers();
|
||||||
var client = _cdnServers.First();
|
|
||||||
|
var manifest = await CircuitBreaker.WithAutoRetryAsync<DepotManifest, HttpRequestException>(_logger, async () =>
|
||||||
var uri = new UriBuilder()
|
|
||||||
{
|
{
|
||||||
Host = client.Host,
|
|
||||||
Port = client.Port,
|
var client = _cdnServers.First();
|
||||||
Scheme = client.Protocol.ToString(),
|
var uri = new UriBuilder
|
||||||
Path = $"depot/{depotId}/manifest/{manifestId}/5"
|
{
|
||||||
}.Uri;
|
Host = client.Host,
|
||||||
|
Port = client.Port,
|
||||||
|
Scheme = client.Protocol.ToString(),
|
||||||
|
Path = $"depot/{depotId}/manifest/{manifestId}/5"
|
||||||
|
}.Uri;
|
||||||
|
|
||||||
|
var rawData = await _httpClient.GetByteArrayAsync(uri);
|
||||||
|
|
||||||
var rawData = await _httpClient.GetByteArrayAsync(uri);
|
using var zip = new ZipArchive(new MemoryStream(rawData));
|
||||||
|
var firstEntry = zip.Entries.First();
|
||||||
|
var data = new MemoryStream();
|
||||||
|
await using var entryStream = firstEntry.Open();
|
||||||
|
await entryStream.CopyToAsync(data);
|
||||||
|
return DepotManifest.Deserialize(data.ToArray());
|
||||||
|
});
|
||||||
|
|
||||||
using var zip = new ZipArchive(new MemoryStream(rawData));
|
|
||||||
var firstEntry = zip.Entries.First();
|
|
||||||
var data = new MemoryStream();
|
|
||||||
await using var entryStream = firstEntry.Open();
|
|
||||||
await entryStream.CopyToAsync(data);
|
|
||||||
var manifest = DepotManifest.Deserialize(data.ToArray());
|
|
||||||
|
|
||||||
if (manifest.FilenamesEncrypted)
|
if (manifest.FilenamesEncrypted)
|
||||||
manifest.DecryptFilenames(await GetDepotKey(depotId, appId));
|
manifest.DecryptFilenames(await GetDepotKey(depotId, appId));
|
||||||
|
Reference in New Issue
Block a user