diff options
| author | Ac_K <Acoustik666@gmail.com> | 2018-10-13 23:16:02 +0000 |
|---|---|---|
| committer | Thomas Guillemard <thog@protonmail.com> | 2018-10-14 01:16:02 +0200 |
| commit | 3561062bc67cde7423d64237170845a206a441c6 (patch) | |
| tree | 5448136a6e8e2708d48e7c10a577a02d12861846 | |
| parent | 824d4b74d068b4dbdd167c37efe1df9afa493822 (diff) | |
Update IAccountService and IManagerForApplication (#454)
* Update IAccountService and IManagerForApplication
`IAccountService`:
- Add symbols.
- Fix some mistake.
- Add `IsUserRegistrationRequestPermitted` and `TrySelectUserWithoutInteraction`.
`IManagerForApplication`:
- Add symbols.
- Add Uuid args.
- Little improvement of `GetAccountId`
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs | 48 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Acc/IManagerForApplication.cs | 15 |
2 files changed, 57 insertions, 6 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs b/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs index 347f2e20..08c4c88c 100644 --- a/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs +++ b/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs @@ -24,11 +24,14 @@ namespace Ryujinx.HLE.HOS.Services.Acc { 3, ListOpenUsers }, { 4, GetLastOpenedUser }, { 5, GetProfile }, + { 50, IsUserRegistrationRequestPermitted }, + { 51, TrySelectUserWithoutInteraction }, { 100, InitializeApplicationInfo }, { 101, GetBaasAccountManagerForApplication } }; } + // GetUserCount() -> i32 public long GetUserCount(ServiceCtx Context) { Context.ResponseData.Write(Context.Device.System.State.GetUserCount()); @@ -36,22 +39,25 @@ namespace Ryujinx.HLE.HOS.Services.Acc return 0; } + // GetUserExistence(nn::account::Uid) -> bool public long GetUserExistence(ServiceCtx Context) { UInt128 Uuid = new UInt128( Context.RequestData.ReadInt64(), Context.RequestData.ReadInt64()); - Context.ResponseData.Write(Context.Device.System.State.TryGetUser(Uuid, out _) ? 1 : 0); + Context.ResponseData.Write(Context.Device.System.State.TryGetUser(Uuid, out _)); return 0; } + // ListAllUsers() -> array<nn::account::Uid, 0xa> public long ListAllUsers(ServiceCtx Context) { return WriteUserList(Context, Context.Device.System.State.GetAllUsers()); } + // ListOpenUsers() -> array<nn::account::Uid, 0xa> public long ListOpenUsers(ServiceCtx Context) { return WriteUserList(Context, Context.Device.System.State.GetOpenUsers()); @@ -78,6 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.Acc return 0; } + // GetLastOpenedUser() -> nn::account::Uid public long GetLastOpenedUser(ServiceCtx Context) { UserProfile LastOpened = Context.Device.System.State.LastOpenUser; @@ -87,6 +94,7 @@ namespace Ryujinx.HLE.HOS.Services.Acc return 0; } + // GetProfile(nn::account::Uid) -> object<nn::account::profile::IProfile> public long GetProfile(ServiceCtx Context) { UInt128 Uuid = new UInt128( @@ -105,16 +113,50 @@ namespace Ryujinx.HLE.HOS.Services.Acc return 0; } + // IsUserRegistrationRequestPermitted(u64, pid) -> bool + public long IsUserRegistrationRequestPermitted(ServiceCtx Context) + { + long Unknown = Context.RequestData.ReadInt64(); + + Context.Device.Log.PrintStub(LogClass.ServiceAcc, $"Stubbed. Unknown: {Unknown}"); + + Context.ResponseData.Write(false); + + return 0; + } + + // TrySelectUserWithoutInteraction(bool) -> nn::account::Uid + public long TrySelectUserWithoutInteraction(ServiceCtx Context) + { + bool Unknown = Context.RequestData.ReadBoolean(); + + Context.Device.Log.PrintStub(LogClass.ServiceAcc, $"Stubbed. Unknown: {Unknown}"); + + UserProfile Profile = Context.Device.System.State.LastOpenUser; + + Profile.Uuid.Write(Context.ResponseData); + + return 0; + } + + // InitializeApplicationInfo(u64, pid) public long InitializeApplicationInfo(ServiceCtx Context) { - Context.Device.Log.PrintStub(LogClass.ServiceAcc, "Stubbed."); + long Unknown = Context.RequestData.ReadInt64(); + + Context.Device.Log.PrintStub(LogClass.ServiceAcc, $"Stubbed. Unknown: {Unknown}"); return 0; } + // GetBaasAccountManagerForApplication(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication> public long GetBaasAccountManagerForApplication(ServiceCtx Context) { - MakeObject(Context, new IManagerForApplication()); + UInt128 Uuid = new UInt128( + Context.RequestData.ReadInt64(), + Context.RequestData.ReadInt64()); + + MakeObject(Context, new IManagerForApplication(Uuid)); return 0; } diff --git a/Ryujinx.HLE/HOS/Services/Acc/IManagerForApplication.cs b/Ryujinx.HLE/HOS/Services/Acc/IManagerForApplication.cs index 813a1b17..ed0e6efb 100644 --- a/Ryujinx.HLE/HOS/Services/Acc/IManagerForApplication.cs +++ b/Ryujinx.HLE/HOS/Services/Acc/IManagerForApplication.cs @@ -1,24 +1,30 @@ using Ryujinx.HLE.HOS.Ipc; using Ryujinx.HLE.Logging; +using Ryujinx.HLE.Utilities; using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Acc { class IManagerForApplication : IpcService { + private UInt128 Uuid; + private Dictionary<int, ServiceProcessRequest> m_Commands; public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; - public IManagerForApplication() + public IManagerForApplication(UInt128 Uuid) { m_Commands = new Dictionary<int, ServiceProcessRequest>() { { 0, CheckAvailability }, { 1, GetAccountId } }; + + this.Uuid = Uuid; } + // CheckAvailability() public long CheckAvailability(ServiceCtx Context) { Context.Device.Log.PrintStub(LogClass.ServiceAcc, "Stubbed."); @@ -26,11 +32,14 @@ namespace Ryujinx.HLE.HOS.Services.Acc return 0; } + // GetAccountId() -> nn::account::NetworkServiceAccountId public long GetAccountId(ServiceCtx Context) { - Context.Device.Log.PrintStub(LogClass.ServiceAcc, "Stubbed."); + long NetworkServiceAccountId = 0xcafe; + + Context.Device.Log.PrintStub(LogClass.ServiceAcc, $"Stubbed. NetworkServiceAccountId: {NetworkServiceAccountId}"); - Context.ResponseData.Write(0xcafeL); + Context.ResponseData.Write(NetworkServiceAccountId); return 0; } |
