From fd25a3f0b7465c201cf11db8c97a990518e8acdb Mon Sep 17 00:00:00 2001 From: Starlet Date: Sat, 30 Jun 2018 16:23:27 -0400 Subject: [PATCH] Fix stubs #1 --- .../Acc/IAccountServiceForApplication.cs | 2 +- .../Services/Acc/IManagerForApplication.cs | 2 +- Ryujinx.HLE/OsHle/Services/Acc/IProfile.cs | 38 ++++++++++++++++--- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/Ryujinx.HLE/OsHle/Services/Acc/IAccountServiceForApplication.cs b/Ryujinx.HLE/OsHle/Services/Acc/IAccountServiceForApplication.cs index 35c4cd8280..d82bbfdb34 100644 --- a/Ryujinx.HLE/OsHle/Services/Acc/IAccountServiceForApplication.cs +++ b/Ryujinx.HLE/OsHle/Services/Acc/IAccountServiceForApplication.cs @@ -27,7 +27,7 @@ namespace Ryujinx.HLE.OsHle.Services.Acc public long GetUserCount(ServiceCtx Context) { - Context.ResponseData.Write(0); + Context.ResponseData.Write(1); Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed."); diff --git a/Ryujinx.HLE/OsHle/Services/Acc/IManagerForApplication.cs b/Ryujinx.HLE/OsHle/Services/Acc/IManagerForApplication.cs index ce3865f485..f46b3d357a 100644 --- a/Ryujinx.HLE/OsHle/Services/Acc/IManagerForApplication.cs +++ b/Ryujinx.HLE/OsHle/Services/Acc/IManagerForApplication.cs @@ -30,7 +30,7 @@ namespace Ryujinx.HLE.OsHle.Services.Acc { Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed."); - Context.ResponseData.Write(0xcafeL); + Context.ResponseData.Write(1L); return 0; } diff --git a/Ryujinx.HLE/OsHle/Services/Acc/IProfile.cs b/Ryujinx.HLE/OsHle/Services/Acc/IProfile.cs index 24daa3d570..080072f3d7 100644 --- a/Ryujinx.HLE/OsHle/Services/Acc/IProfile.cs +++ b/Ryujinx.HLE/OsHle/Services/Acc/IProfile.cs @@ -1,5 +1,6 @@ using Ryujinx.HLE.Logging; using Ryujinx.HLE.OsHle.Ipc; +using System; using System.Collections.Generic; namespace Ryujinx.HLE.OsHle.Services.Acc @@ -22,15 +23,40 @@ namespace Ryujinx.HLE.OsHle.Services.Acc { Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed."); + //UserID + Context.ResponseData.Write(1L); + + //Padding? + Context.ResponseData.Write(0); + Context.ResponseData.Write(0); + + //Timestamp Context.ResponseData.Write(0L); - Context.ResponseData.Write(0L); - Context.ResponseData.Write(0L); - Context.ResponseData.Write(0L); - Context.ResponseData.Write(0L); - Context.ResponseData.Write(0L); - Context.ResponseData.Write(0L); + + //Username + Context.ResponseData.Write(GetUsernameBytes("Ryujinx")); return 0; } + + private byte[] GetUsernameBytes(string Username) + { + char[] CharArr = Username.ToCharArray(); + byte[] ByteArr = new byte[0x20]; + + for (int Index = 0; Index < ByteArr.Length; Index++) + { + if (Index > CharArr.Length) + { + ByteArr[Index] = 0x0; + } + else + { + ByteArr[Index] = Convert.ToByte(CharArr[Index]); + } + } + + return ByteArr; + } } } \ No newline at end of file