diff options
author | Thog <me@thog.eu> | 2020-01-24 17:01:21 +0100 |
---|---|---|
committer | Ac_K <Acoustik666@gmail.com> | 2020-01-24 17:01:21 +0100 |
commit | 1d8da1833429acd4a9cbea7597c0699c2e3c80bf (patch) | |
tree | 2f71091e2efd47bfe347ade4f0987d5000bb217f /Ryujinx.HLE/FileSystem/VirtualFileSystem.cs | |
parent | 4232a15187c73316c2a6b410fc2b390308c42836 (diff) |
Make VirtualFileSystem only instanciable once (#901)
This fix a regression caused by #888 on temporary saves for SNES Online.
(and probably other games)
Diffstat (limited to 'Ryujinx.HLE/FileSystem/VirtualFileSystem.cs')
-rw-r--r-- | Ryujinx.HLE/FileSystem/VirtualFileSystem.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs index 070ec3bc..884f4197 100644 --- a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs +++ b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs @@ -20,12 +20,14 @@ namespace Ryujinx.HLE.FileSystem public static string SystemNandPath = Path.Combine(NandPath, "system"); public static string UserNandPath = Path.Combine(NandPath, "user"); + private static bool _isInitialized = false; + public Keyset KeySet { get; private set; } public FileSystemServer FsServer { get; private set; } public FileSystemClient FsClient { get; private set; } public EmulatedGameCard GameCard { get; private set; } - public VirtualFileSystem() + private VirtualFileSystem() { Reload(); } @@ -272,5 +274,17 @@ namespace Ryujinx.HLE.FileSystem Unload(); } } + + public static VirtualFileSystem CreateInstance() + { + if (_isInitialized) + { + throw new InvalidOperationException($"VirtualFileSystem can only be instanciated once!"); + } + + _isInitialized = true; + + return new VirtualFileSystem(); + } } }
\ No newline at end of file |