diff options
| author | Ac_K <Acoustik666@gmail.com> | 2021-01-02 23:34:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-02 23:34:28 +0100 |
| commit | b001040c2f005da21f91713ba1145083a01d0b01 (patch) | |
| tree | 26a5967abe4ff29bf9c47f0364b87e34d9421ca8 /Ryujinx.HLE/HOS/Services/Account/Acc/IProfile.cs | |
| parent | 4f01c13f5054e3af775fc956584b553da934d476 (diff) | |
account: Services Refactoring (#1833)
* account: Services Refactoring
* Remove extra empty space
* Fix IProfile::Get
* address gdkchan feedback
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Account/Acc/IProfile.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Account/Acc/IProfile.cs | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/IProfile.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/IProfile.cs deleted file mode 100644 index 4b134c6f..00000000 --- a/Ryujinx.HLE/HOS/Services/Account/Acc/IProfile.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Ryujinx.Common.Logging; -using Ryujinx.Cpu; -using Ryujinx.HLE.Utilities; -using System.IO; -using System.Reflection; -using System.Text; - -namespace Ryujinx.HLE.HOS.Services.Account.Acc -{ - class IProfile : IpcService - { - private UserProfile _profile; - private Stream _profilePictureStream; - - public IProfile(UserProfile profile) - { - _profile = profile; - _profilePictureStream = Assembly.GetCallingAssembly().GetManifestResourceStream("Ryujinx.HLE.RyujinxProfileImage.jpg"); - } - - [Command(0)] - // Get() -> (nn::account::profile::ProfileBase, buffer<nn::account::profile::UserData, 0x1a>) - public ResultCode Get(ServiceCtx context) - { - Logger.Stub?.PrintStub(LogClass.ServiceAcc); - - context.Response.PtrBuff[0] = context.Response.PtrBuff[0].WithSize(0x80L); - - long position = context.Request.ReceiveBuff[0].Position; - - MemoryHelper.FillWithZeros(context.Memory, position, 0x80); - - context.Memory.Write((ulong)position, 0); - context.Memory.Write((ulong)position + 4, 1); - context.Memory.Write((ulong)position + 8, 1L); - - return GetBase(context); - } - - [Command(1)] - // GetBase() -> nn::account::profile::ProfileBase - public ResultCode GetBase(ServiceCtx context) - { - _profile.UserId.Write(context.ResponseData); - - context.ResponseData.Write(_profile.LastModifiedTimestamp); - - byte[] username = StringUtils.GetFixedLengthBytes(_profile.Name, 0x20, Encoding.UTF8); - - context.ResponseData.Write(username); - - return ResultCode.Success; - } - - [Command(10)] - // GetImageSize() -> u32 - public ResultCode GetImageSize(ServiceCtx context) - { - context.ResponseData.Write(_profilePictureStream.Length); - - return ResultCode.Success; - } - - [Command(11)] - // LoadImage() -> (u32, buffer<bytes, 6>) - public ResultCode LoadImage(ServiceCtx context) - { - long bufferPosition = context.Request.ReceiveBuff[0].Position; - long bufferLen = context.Request.ReceiveBuff[0].Size; - - byte[] profilePictureData = new byte[bufferLen]; - - _profilePictureStream.Read(profilePictureData, 0, profilePictureData.Length); - - context.Memory.Write((ulong)bufferPosition, profilePictureData); - - context.ResponseData.Write(_profilePictureStream.Length); - - return ResultCode.Success; - } - } -}
\ No newline at end of file |
