From 0f355bc2fcfc521172f0da7ff5cb9a0c130f15e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Mon, 2 Feb 2026 18:07:20 -0600 Subject: [PATCH] make mount truely syncronous --- packages/cue4parse | 2 +- packages/game/JSExport/GameInterface.cs | 14 ++++++++++++++ packages/game/Models/BlitzFileProvider.cs | 4 ++-- packages/game/Synchronous/FileProvider.cs | 12 +++++++++--- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/packages/cue4parse b/packages/cue4parse index d2f6ce6e6..c0da9b2af 160000 --- a/packages/cue4parse +++ b/packages/cue4parse @@ -1 +1 @@ -Subproject commit d2f6ce6e618576dbbe7f6dd9ed3171f14513182a +Subproject commit c0da9b2aff454d67a940e768205f3a9cd97563f5 diff --git a/packages/game/JSExport/GameInterface.cs b/packages/game/JSExport/GameInterface.cs index 4def359e0..ab98ff5ff 100644 --- a/packages/game/JSExport/GameInterface.cs +++ b/packages/game/JSExport/GameInterface.cs @@ -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)) { diff --git a/packages/game/Models/BlitzFileProvider.cs b/packages/game/Models/BlitzFileProvider.cs index fc3a3f812..cf4f142d6 100644 --- a/packages/game/Models/BlitzFileProvider.cs +++ b/packages/game/Models/BlitzFileProvider.cs @@ -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( diff --git a/packages/game/Synchronous/FileProvider.cs b/packages/game/Synchronous/FileProvider.cs index ccb401020..f460beb85 100644 --- a/packages/game/Synchronous/FileProvider.cs +++ b/packages/game/Synchronous/FileProvider.cs @@ -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(