mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
SynchronousOodleHelper
This commit is contained in:
1 parent
204fbbff59
commit
b070cad92a
3 files changed
+74
-6
No files matched your search
@@ -0,0 +1,42 @@
|
||||
using CUE4Parse.FileProvider;
|
||||
using CUE4Parse.UE4.Exceptions;
|
||||
using CUE4Parse.UE4.Versions;
|
||||
using CUE4Parse.Utils;
|
||||
|
||||
namespace BlitzKit.Game.Synchronous;
|
||||
|
||||
public class SynchronousFileProvider(
|
||||
string directory,
|
||||
SearchOption searchOption,
|
||||
VersionContainer? versions = null,
|
||||
StringComparer? pathComparer = null
|
||||
) : DefaultFileProvider(directory, searchOption, versions, pathComparer)
|
||||
{
|
||||
public new int Mount()
|
||||
{
|
||||
var countNewMounts = 0;
|
||||
|
||||
foreach (var reader in _unloadedVfs.Keys)
|
||||
{
|
||||
if (reader.IsEncrypted && CustomEncryption == null || !reader.HasDirectoryIndex)
|
||||
continue;
|
||||
|
||||
try
|
||||
{
|
||||
reader.MountTo(Files, PathComparer);
|
||||
_unloadedVfs.TryRemove(reader, out _);
|
||||
countNewMounts++;
|
||||
}
|
||||
catch (InvalidAesKeyException) { }
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Warning(
|
||||
e,
|
||||
$"Uncaught exception while loading file {reader.Path.SubstringAfterLast('/')}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return countNewMounts;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user