From 3d59b33d95ea342a99defaaea8979d6055fd6b5e Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Mon, 13 Jan 2020 21:57:48 -0700 Subject: [PATCH] Update to LibHac 0.8.2 This brings support for temporary savedata, ignores case in key names when loading from a file, and prints the rights ID correctly when missing a title key. --- .../HOS/Services/Fs/IFileSystemProxy.cs | 26 +++++++++---------- Ryujinx.HLE/Ryujinx.HLE.csproj | 2 +- Ryujinx/Ui/SaveImporter.cs | 3 +-- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs index 4e96788644..54d0781be3 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs @@ -130,7 +130,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode CreateSaveDataFileSystem(ServiceCtx context) { SaveDataAttribute attribute = context.RequestData.ReadStruct(); - SaveDataCreateInfo createInfo = context.RequestData.ReadStruct(); + SaveDataCreationInfo creationInfo = context.RequestData.ReadStruct(); SaveMetaCreateInfo metaCreateInfo = context.RequestData.ReadStruct(); // TODO: There's currently no program registry for FS to reference. @@ -140,14 +140,14 @@ namespace Ryujinx.HLE.HOS.Services.Fs attribute.TitleId = new TitleId(context.Process.TitleId); } - if (createInfo.OwnerId == TitleId.Zero) + if (creationInfo.OwnerId == TitleId.Zero) { - createInfo.OwnerId = new TitleId(context.Process.TitleId); + creationInfo.OwnerId = new TitleId(context.Process.TitleId); } Logger.PrintInfo(LogClass.ServiceFs, $"Creating save with title ID {attribute.TitleId.Value:x16}"); - Result result = _baseFileSystemProxy.CreateSaveDataFileSystem(ref attribute, ref createInfo, ref metaCreateInfo); + Result result = _baseFileSystemProxy.CreateSaveDataFileSystem(ref attribute, ref creationInfo, ref metaCreateInfo); return (ResultCode)result.Value; } @@ -156,9 +156,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode CreateSaveDataFileSystemBySystemSaveDataId(ServiceCtx context) { SaveDataAttribute attribute = context.RequestData.ReadStruct(); - SaveDataCreateInfo createInfo = context.RequestData.ReadStruct(); + SaveDataCreationInfo creationInfo = context.RequestData.ReadStruct(); - Result result = _baseFileSystemProxy.CreateSaveDataFileSystemBySystemSaveDataId(ref attribute, ref createInfo); + Result result = _baseFileSystemProxy.CreateSaveDataFileSystemBySystemSaveDataId(ref attribute, ref creationInfo); return (ResultCode)result.Value; } @@ -205,10 +205,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs [Command(35)] public ResultCode CreateSaveDataFileSystemWithHashSalt(ServiceCtx context) { - SaveDataAttribute attribute = context.RequestData.ReadStruct(); - SaveDataCreateInfo createInfo = context.RequestData.ReadStruct(); - SaveMetaCreateInfo metaCreateInfo = context.RequestData.ReadStruct(); - HashSalt hashSalt = context.RequestData.ReadStruct(); + SaveDataAttribute attribute = context.RequestData.ReadStruct(); + SaveDataCreationInfo creationInfo = context.RequestData.ReadStruct(); + SaveMetaCreateInfo metaCreateInfo = context.RequestData.ReadStruct(); + HashSalt hashSalt = context.RequestData.ReadStruct(); // TODO: There's currently no program registry for FS to reference. // Workaround that by setting the application ID and owner ID if they're not already set @@ -217,12 +217,12 @@ namespace Ryujinx.HLE.HOS.Services.Fs attribute.TitleId = new TitleId(context.Process.TitleId); } - if (createInfo.OwnerId == TitleId.Zero) + if (creationInfo.OwnerId == TitleId.Zero) { - createInfo.OwnerId = new TitleId(context.Process.TitleId); + creationInfo.OwnerId = new TitleId(context.Process.TitleId); } - Result result = _baseFileSystemProxy.CreateSaveDataFileSystemWithHashSalt(ref attribute, ref createInfo, ref metaCreateInfo, ref hashSalt); + Result result = _baseFileSystemProxy.CreateSaveDataFileSystemWithHashSalt(ref attribute, ref creationInfo, ref metaCreateInfo, ref hashSalt); return (ResultCode)result.Value; } diff --git a/Ryujinx.HLE/Ryujinx.HLE.csproj b/Ryujinx.HLE/Ryujinx.HLE.csproj index 15c0c8c0c1..4fb4835d9c 100644 --- a/Ryujinx.HLE/Ryujinx.HLE.csproj +++ b/Ryujinx.HLE/Ryujinx.HLE.csproj @@ -52,7 +52,7 @@ - + diff --git a/Ryujinx/Ui/SaveImporter.cs b/Ryujinx/Ui/SaveImporter.cs index b0a5f64336..467cc4161d 100644 --- a/Ryujinx/Ui/SaveImporter.cs +++ b/Ryujinx/Ui/SaveImporter.cs @@ -3,7 +3,6 @@ using LibHac.Common; using LibHac.Fs; using LibHac.Fs.Shim; using LibHac.FsSystem; -using LibHac.FsSystem.Save; using LibHac.Ncm; using Ryujinx.HLE.Utilities; using System; @@ -131,7 +130,7 @@ namespace Ryujinx.Ui { SaveDataAttribute attribute = new SaveDataAttribute { - Type = SaveDataType.SaveData, + Type = SaveDataType.Account, UserId = userId, TitleId = new TitleId(titleId) };