Always allow opening directory savedata

This commit is contained in:
Alex Barney 2020-02-10 14:09:55 -07:00
parent ecf7bcd8ad
commit ea8cc33003
2 changed files with 7 additions and 2 deletions

View file

@ -38,8 +38,7 @@ namespace LibHac.FsService.Creators
switch (entryType) switch (entryType)
{ {
case DirectoryEntryType.Directory: case DirectoryEntryType.Directory:
// Actual FS does this check if (!allowDirectorySaveData) return ResultFs.InvalidSaveDataEntryType.Log();
// if (!allowDirectorySaveData) return ResultFs.InvalidSaveDataEntryType.Log();
rc = SubdirectoryFileSystem.CreateNew(out SubdirectoryFileSystem subDirFs, sourceFileSystem, saveDataPath.ToU8String()); rc = SubdirectoryFileSystem.CreateNew(out SubdirectoryFileSystem subDirFs, sourceFileSystem, saveDataPath.ToU8String());
if (rc.IsFailure()) return rc; if (rc.IsFailure()) return rc;

View file

@ -222,9 +222,14 @@ namespace LibHac.FsService
Result rc = OpenSaveDataDirectory(out IFileSystem saveDirFs, spaceId, saveDataRootPath, true); Result rc = OpenSaveDataDirectory(out IFileSystem saveDirFs, spaceId, saveDataRootPath, true);
if (rc.IsFailure()) return rc; if (rc.IsFailure()) return rc;
// ReSharper disable once RedundantAssignment
bool allowDirectorySaveData = AllowDirectorySaveData(spaceId, saveDataRootPath); bool allowDirectorySaveData = AllowDirectorySaveData(spaceId, saveDataRootPath);
bool useDeviceUniqueMac = Util.UseDeviceUniqueSaveMac(spaceId); bool useDeviceUniqueMac = Util.UseDeviceUniqueSaveMac(spaceId);
// Always allow directory savedata because we don't support transaction with file savedata yet
allowDirectorySaveData = true;
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
if (allowDirectorySaveData) if (allowDirectorySaveData)
{ {
rc = saveDirFs.EnsureDirectoryExists(GetSaveDataIdPath(saveDataId)); rc = saveDirFs.EnsureDirectoryExists(GetSaveDataIdPath(saveDataId));
@ -233,6 +238,7 @@ namespace LibHac.FsService
// Missing save FS cache lookup // Missing save FS cache lookup
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
rc = FsCreators.SaveDataFileSystemCreator.Create(out IFileSystem saveFs, out _, saveDirFs, saveDataId, rc = FsCreators.SaveDataFileSystemCreator.Create(out IFileSystem saveFs, out _, saveDirFs, saveDataId,
allowDirectorySaveData, useDeviceUniqueMac, type, null); allowDirectorySaveData, useDeviceUniqueMac, type, null);