make mount truely syncronous

This commit is contained in:
TrèsAbhi committed 2026-02-02 18:07:20 -06:00
1 parent 6ebd3063ed
commit 0f355bc2fc
4 files changed
+26 -6

No files matched your search

+14
View File
@@ -20,6 +20,20 @@ public class GameInterface
provider.Initialize();
provider.Mount();
Console.WriteLine("Mounted VFS:");
Console.WriteLine(provider.MountedVfs.Count);
foreach (var vfs in provider.MountedVfs)
{
Console.WriteLine(vfs.Path);
}
Console.WriteLine("Unloaded VFS:");
Console.WriteLine(provider.UnloadedVfs.Count);
foreach (var vfs in provider.UnloadedVfs)
{
Console.WriteLine(vfs.Path);
}
string libraryExtension;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
+2 -2
View File
@@ -1,10 +1,10 @@
using BlitzKit.Game.Synchronous;
using CUE4Parse.FileProvider;
using CUE4Parse.MappingsProvider;
using CUE4Parse.UE4.Versions;
namespace BlitzKit.Game.Models;
public class BlitzFileProvider : SynchronousFileProvider
public class BlitzFileProvider : DefaultFileProvider
{
public BlitzFileProvider(string directory)
: base(
+9 -3
View File
@@ -15,9 +15,10 @@ public class SynchronousFileProvider(
public new int Mount()
{
var countNewMounts = 0;
foreach (var reader in _unloadedVfs.Keys)
{
// VerifyGlobalData(reader);
if (reader.IsEncrypted && CustomEncryption == null || !reader.HasDirectoryIndex)
continue;
@@ -25,9 +26,14 @@ public class SynchronousFileProvider(
{
reader.MountTo(Files, PathComparer);
_unloadedVfs.TryRemove(reader, out _);
countNewMounts++;
_mountedVfs[reader] = null;
Interlocked.Increment(ref countNewMounts);
// return reader;
}
catch (InvalidAesKeyException)
{
// Ignore this
}
catch (InvalidAesKeyException) { }
catch (Exception e)
{
Log.Warning(