mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
make mount truely syncronous
This commit is contained in:
1 parent
6ebd3063ed
commit
0f355bc2fc
4 files changed
+26
-6
No files matched your search
+1
-1
Submodule packages/cue4parse updated: d2f6ce6e61...c0da9b2aff.
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user