mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-22 22:45:48 +00:00
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`
This commit is contained in:
parent
824d4b74d0
commit
3561062bc6
2 changed files with 58 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
public long InitializeApplicationInfo(ServiceCtx Context)
|
||||
// IsUserRegistrationRequestPermitted(u64, pid) -> bool
|
||||
public long IsUserRegistrationRequestPermitted(ServiceCtx Context)
|
||||
{
|
||||
Context.Device.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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.ResponseData.Write(0xcafeL);
|
||||
Context.Device.Log.PrintStub(LogClass.ServiceAcc, $"Stubbed. NetworkServiceAccountId: {NetworkServiceAccountId}");
|
||||
|
||||
Context.ResponseData.Write(NetworkServiceAccountId);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue