account: Services Refactoring (#1833)
* account: Services Refactoring * Remove extra empty space * Fix IProfile::Get * address gdkchan feedback
This commit is contained in:
parent
4f01c13f50
commit
b001040c2f
17 changed files with 844 additions and 317 deletions
|
@ -1,8 +1,107 @@
|
|||
namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
||||
using Ryujinx.Common;
|
||||
using Ryujinx.HLE.HOS.Services.Account.Acc.AccountService;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
||||
{
|
||||
[Service("acc:u1")]
|
||||
[Service("acc:u1", AccountServiceFlag.SystemService)] // Max Sessions: 16
|
||||
class IAccountServiceForSystemService : IpcService
|
||||
{
|
||||
public IAccountServiceForSystemService(ServiceCtx context) { }
|
||||
private ApplicationServiceServer _applicationServiceServer;
|
||||
|
||||
public IAccountServiceForSystemService(ServiceCtx context, AccountServiceFlag serviceFlag)
|
||||
{
|
||||
_applicationServiceServer = new ApplicationServiceServer(serviceFlag);
|
||||
}
|
||||
|
||||
[Command(0)]
|
||||
// GetUserCount() -> i32
|
||||
public ResultCode GetUserCount(ServiceCtx context)
|
||||
{
|
||||
return _applicationServiceServer.GetUserCountImpl(context);
|
||||
}
|
||||
|
||||
[Command(1)]
|
||||
// GetUserExistence(nn::account::Uid) -> bool
|
||||
public ResultCode GetUserExistence(ServiceCtx context)
|
||||
{
|
||||
return _applicationServiceServer.GetUserExistenceImpl(context);
|
||||
}
|
||||
|
||||
[Command(2)]
|
||||
// ListAllUsers() -> array<nn::account::Uid, 0xa>
|
||||
public ResultCode ListAllUsers(ServiceCtx context)
|
||||
{
|
||||
return _applicationServiceServer.ListAllUsers(context);
|
||||
}
|
||||
|
||||
[Command(3)]
|
||||
// ListOpenUsers() -> array<nn::account::Uid, 0xa>
|
||||
public ResultCode ListOpenUsers(ServiceCtx context)
|
||||
{
|
||||
return _applicationServiceServer.ListOpenUsers(context);
|
||||
}
|
||||
|
||||
[Command(4)]
|
||||
// GetLastOpenedUser() -> nn::account::Uid
|
||||
public ResultCode GetLastOpenedUser(ServiceCtx context)
|
||||
{
|
||||
return _applicationServiceServer.GetLastOpenedUser(context);
|
||||
}
|
||||
|
||||
[Command(5)]
|
||||
// GetProfile(nn::account::Uid) -> object<nn::account::profile::IProfile>
|
||||
public ResultCode GetProfile(ServiceCtx context)
|
||||
{
|
||||
ResultCode resultCode = _applicationServiceServer.GetProfile(context, out IProfile iProfile);
|
||||
|
||||
if (resultCode == ResultCode.Success)
|
||||
{
|
||||
MakeObject(context, iProfile);
|
||||
}
|
||||
|
||||
return resultCode;
|
||||
}
|
||||
|
||||
[Command(50)]
|
||||
// IsUserRegistrationRequestPermitted(pid) -> bool
|
||||
public ResultCode IsUserRegistrationRequestPermitted(ServiceCtx context)
|
||||
{
|
||||
// NOTE: pid is unused.
|
||||
|
||||
return _applicationServiceServer.IsUserRegistrationRequestPermitted(context);
|
||||
}
|
||||
|
||||
[Command(51)]
|
||||
// TrySelectUserWithoutInteraction(bool) -> nn::account::Uid
|
||||
public ResultCode TrySelectUserWithoutInteraction(ServiceCtx context)
|
||||
{
|
||||
return _applicationServiceServer.TrySelectUserWithoutInteraction(context);
|
||||
}
|
||||
|
||||
[Command(102)]
|
||||
// GetBaasAccountManagerForSystemService(nn::account::Uid) -> object<nn::account::baas::IManagerForApplication>
|
||||
public ResultCode GetBaasAccountManagerForSystemService(ServiceCtx context)
|
||||
{
|
||||
UserId userId = context.RequestData.ReadStruct<UserId>();
|
||||
|
||||
if (userId.IsNull)
|
||||
{
|
||||
return ResultCode.NullArgument;
|
||||
}
|
||||
|
||||
MakeObject(context, new IManagerForSystemService(userId));
|
||||
|
||||
// Doesn't occur in our case.
|
||||
// return ResultCode.NullObject;
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[Command(140)] // 6.0.0+
|
||||
// ListQualifiedUsers() -> array<nn::account::Uid, 0xa>
|
||||
public ResultCode ListQualifiedUsers(ServiceCtx context)
|
||||
{
|
||||
return _applicationServiceServer.ListQualifiedUsers(context);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue