diff --git a/CUE4Parse b/CUE4Parse index 7beda1c3..2fc54d28 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 7beda1c3aee5c7f29b89ab98b33054f580f3f491 +Subproject commit 2fc54d28909d7ea8329b02cfcc545c4385e44f9a diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 7921c537..dc7fac8f 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -218,8 +218,17 @@ public class CUE4ParseViewModel : ViewModel public async Task Initialize() { + await _apiEndpointView.EpicApi.VerifyAuth(CancellationToken.None); await _threadWorkerView.Begin(cancellationToken => { + Provider.OnDemandOptions = new IoStoreOnDemandOptions + { + ChunkHostUri = new Uri("https://download.epicgames.com/", UriKind.Absolute), + ChunkCacheDirectory = Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, ".data")), + Authorization = new AuthenticationHeaderValue("Bearer", UserSettings.Default.LastAuthResponse.AccessToken), + Timeout = TimeSpan.FromSeconds(30) + }; + switch (Provider) { case StreamedFileProvider p: @@ -478,14 +487,7 @@ public class CUE4ParseViewModel : ViewModel var ioStoreOnDemandPath = Path.Combine(UserSettings.Default.GameDirectory, "..\\..\\..\\Cloud", inst[0].Value.SubstringAfterLast("/").SubstringBefore("\"")); if (!File.Exists(ioStoreOnDemandPath)) return; - await _apiEndpointView.EpicApi.VerifyAuth(CancellationToken.None); - await Provider.RegisterVfs(new IoChunkToc(ioStoreOnDemandPath), new IoStoreOnDemandOptions - { - ChunkBaseUri = new Uri("https://download.epicgames.com/ias/fortnite/", UriKind.Absolute), - ChunkCacheDirectory = Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, ".data")), - Authorization = new AuthenticationHeaderValue("Bearer", UserSettings.Default.LastAuthResponse.AccessToken), - Timeout = TimeSpan.FromSeconds(30) - }); + await Provider.RegisterVfsAsync(new IoChunkToc(ioStoreOnDemandPath)); var onDemandCount = await Provider.MountAsync(); FLogger.Append(ELog.Information, () => FLogger.Text($"{onDemandCount} on-demand archive{(onDemandCount > 1 ? "s" : "")} streamed via epicgames.com", Constants.WHITE, true));