From fd25a3f0b7465c201cf11db8c97a990518e8acdb Mon Sep 17 00:00:00 2001 From: Starlet Date: Sat, 30 Jun 2018 16:23:27 -0400 Subject: [PATCH 1/2] 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 From 6b0840d2adadf16bfb58cff83c9826a2fcf4acca Mon Sep 17 00:00:00 2001 From: Starlet Date: Sat, 30 Jun 2018 16:50:35 -0400 Subject: [PATCH 2/2] Fix stubs #2 --- .gitignore | 3 +++ .../Acc/IAccountServiceForApplication.cs | 10 ++++++++++ Ryujinx.HLE/OsHle/Services/Acc/IProfile.cs | 2 +- .../OsHle/Services/Friend/IFriendService.cs | 18 +++++++++++++++++- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 82d9719b59..3051ef8827 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,6 @@ $RECYCLE.BIN/ # Mac desktop service store files .DS_Store + +# VS Launch Settings +launchSettings.json \ No newline at end of file diff --git a/Ryujinx.HLE/OsHle/Services/Acc/IAccountServiceForApplication.cs b/Ryujinx.HLE/OsHle/Services/Acc/IAccountServiceForApplication.cs index d82bbfdb34..9e5f805eb1 100644 --- a/Ryujinx.HLE/OsHle/Services/Acc/IAccountServiceForApplication.cs +++ b/Ryujinx.HLE/OsHle/Services/Acc/IAccountServiceForApplication.cs @@ -45,6 +45,11 @@ namespace Ryujinx.HLE.OsHle.Services.Acc public long ListAllUsers(ServiceCtx Context) { + long Position = Context.Request.RecvListBuff[0].Position; + + Context.Memory.WriteInt64(Position, 1L); + Context.Memory.WriteInt64(Position + 8, 0L); + Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed."); return 0; @@ -52,6 +57,11 @@ namespace Ryujinx.HLE.OsHle.Services.Acc public long ListOpenUsers(ServiceCtx Context) { + long Position = Context.Request.RecvListBuff[0].Position; + + Context.Memory.WriteInt64(Position, 1L); + Context.Memory.WriteInt64(Position + 8, 0L); + Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed."); return 0; diff --git a/Ryujinx.HLE/OsHle/Services/Acc/IProfile.cs b/Ryujinx.HLE/OsHle/Services/Acc/IProfile.cs index 080072f3d7..04c4885397 100644 --- a/Ryujinx.HLE/OsHle/Services/Acc/IProfile.cs +++ b/Ryujinx.HLE/OsHle/Services/Acc/IProfile.cs @@ -46,7 +46,7 @@ namespace Ryujinx.HLE.OsHle.Services.Acc for (int Index = 0; Index < ByteArr.Length; Index++) { - if (Index > CharArr.Length) + if (Index > CharArr.Length - 1) { ByteArr[Index] = 0x0; } diff --git a/Ryujinx.HLE/OsHle/Services/Friend/IFriendService.cs b/Ryujinx.HLE/OsHle/Services/Friend/IFriendService.cs index d5843ffbd2..4ddbb9a1db 100644 --- a/Ryujinx.HLE/OsHle/Services/Friend/IFriendService.cs +++ b/Ryujinx.HLE/OsHle/Services/Friend/IFriendService.cs @@ -1,3 +1,4 @@ +using Ryujinx.HLE.Logging; using Ryujinx.HLE.OsHle.Ipc; using System.Collections.Generic; @@ -13,8 +14,23 @@ namespace Ryujinx.HLE.OsHle.Services.Friend { m_Commands = new Dictionary() { - //... + { 10601, DeclareCloseOnlinePlaySession }, + { 10610, UpdateUserPresence } }; } + + public long DeclareCloseOnlinePlaySession(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceFriend, "Stubbed."); + + return 0; + } + + public long UpdateUserPresence(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceFriend, "Stubbed."); + + return 0; + } } } \ No newline at end of file