fortnite hd texture download

This commit is contained in:
4sval 2023-05-09 14:27:11 +02:00
parent 2bf6c245d9
commit 42ad5ddb7a
3 changed files with 52 additions and 10 deletions

@ -1 +1 @@
Subproject commit 17b227c197575849910cc7c9e71a6761859d551d
Subproject commit a6f5517b7c44f0cac3817b1b1ea7f6ce6bc48666

View File

@ -69,8 +69,9 @@ public partial class MainWindow
await _applicationView.CUE4Parse.InitInformation();
#endif
await Task.WhenAll(
Task.Run(() => _applicationView.CUE4Parse.VerifyCva()),
Task.Run(() => _applicationView.CUE4Parse.VerifyVfc()),
Task.Run(() => _applicationView.CUE4Parse.VerifyConsoleVariables()),
Task.Run(() => _applicationView.CUE4Parse.VerifyVirtualCache()),
Task.Run(() => _applicationView.CUE4Parse.VerifyContentBuildManifest()),
_applicationView.CUE4Parse.InitMappings(),
_applicationView.InitImGuiSettings(newOrUpdated),
_applicationView.InitVgmStream(),
@ -83,9 +84,9 @@ public partial class MainWindow
).ConfigureAwait(false);
#if DEBUG
// await _threadWorkerView.Begin(cancellationToken =>
// _applicationView.CUE4Parse.Extract(cancellationToken,
// "fortnitegame/Content/Characters/Player/Female/Medium/Bodies/F_MED_Dieselpunk_01/Meshes/F_MED_Dieselpunk_01.uasset"));
await _threadWorkerView.Begin(cancellationToken =>
_applicationView.CUE4Parse.Extract(cancellationToken,
"fortnitegame/Content/Characters/Player/Female/Medium/Bodies/F_MED_Ballerina/Meshes/F_MED_Ballerina.uasset"));
#endif
}

View File

@ -31,6 +31,7 @@ using CUE4Parse.UE4.Versions;
using CUE4Parse.UE4.Wwise;
using CUE4Parse_Conversion;
using CUE4Parse_Conversion.Sounds;
using CUE4Parse.FileProvider.Objects;
using EpicManifestParser.Objects;
using FModel.Creator;
using FModel.Extensions;
@ -428,7 +429,7 @@ public class CUE4ParseViewModel : ViewModel
}
private bool _cvaVerifDone { get; set; }
public void VerifyCva()
public void VerifyConsoleVariables()
{
if (_cvaVerifDone) return;
_cvaVerifDone = true;
@ -443,14 +444,54 @@ public class CUE4ParseViewModel : ViewModel
}
private int _vfcCount { get; set; }
public void VerifyVfc()
public void VerifyVirtualCache()
{
if (_vfcCount > 0) return;
_vfcCount = Provider.LoadVirtualCache();
if (_vfcCount > 0)
FLogger.Append(ELog.Information, () =>
FLogger.Text($"VFC loaded {_vfcCount} cached packages", Constants.WHITE, true));
FLogger.Append(ELog.Information,
() => FLogger.Text($"{_vfcCount} cached packages loaded", Constants.WHITE, true));
}
public void VerifyContentBuildManifest()
{
if (!Provider.GameName.Equals("fortnitegame", StringComparison.OrdinalIgnoreCase)) return;
var persistentDownloadDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "FortniteGame/Saved/PersistentDownloadDir");
if (!Directory.Exists(persistentDownloadDir)) return;
var cachedManifest = new DirectoryInfo(Path.Combine(persistentDownloadDir, "ManifestCache")).GetFiles("*.manifest");
if (cachedManifest.Length <= 0)
return;
var manifest = new Manifest(File.ReadAllBytes(cachedManifest[0].FullName), new ManifestOptions
{
ChunkBaseUri = new Uri("http://epicgames-download1.akamaized.net/Builds/Fortnite/Content/CloudDir/ChunksV4/", UriKind.Absolute),
ChunkCacheDirectory = Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, ".data"))
});
var onDemandFiles = new Dictionary<string, GameFile>();
foreach (var fileManifest in manifest.FileManifests)
{
if (Provider.Files.TryGetValue(fileManifest.Name, out _)) continue;
var onDemandFile = new StreamedGameFile(fileManifest.Name, fileManifest.GetStream(), Provider.Versions);
if (Provider.IsCaseInsensitive) onDemandFiles[onDemandFile.Path.ToLowerInvariant()] = onDemandFile;
else onDemandFiles[onDemandFile.Path] = onDemandFile;
}
(Provider.Files as FileProviderDictionary)?.AddFiles(onDemandFiles);
if (onDemandFiles.Count > 0)
FLogger.Append(ELog.Information,
() => FLogger.Text($"{onDemandFiles.Count} streamed packages loaded", Constants.WHITE, true));
#if DEBUG
var missing = manifest.FileManifests.Count - onDemandFiles.Count;
if (missing != _vfcCount) // false positive if Provider.LoadVirtualCache takes too much time???
FLogger.Append(ELog.Warning,
() => FLogger.Text($"{missing} packages went missing while loading VFC & CBM", Constants.WHITE, true));
#endif
}
public int LocalizedResourcesCount { get; set; }