Refactoring commands handling (#728)

* Refactoring commands handling

- Use Reflection to handle commands ID.
- Add all symbols (from SwIPC so not all time accurate).
- Re-sort some services commands methods.
- Some cleanup.
- Keep some empty constructor for consistency.

* Fix order in IProfile
This commit is contained in:
Ac_K 2019-07-12 03:13:43 +02:00 committed by gdkchan
parent f723f6f39a
commit 560ccbeb2d
99 changed files with 1035 additions and 1983 deletions

View file

@ -1,33 +1,21 @@
using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Services.Arp;
using Ryujinx.HLE.Utilities;
using System.Collections.Generic;
namespace Ryujinx.HLE.HOS.Services.Acc
{
class IManagerForApplication : IpcService
{
private UInt128 _userId;
private UInt128 _userId;
private ApplicationLaunchProperty _applicationLaunchProperty;
private Dictionary<int, ServiceProcessRequest> _commands;
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
public IManagerForApplication(UInt128 userId, ApplicationLaunchProperty applicationLaunchProperty)
{
_commands = new Dictionary<int, ServiceProcessRequest>
{
{ 0, CheckAvailability },
{ 1, GetAccountId }
};
_userId = userId;
_applicationLaunchProperty = applicationLaunchProperty;
}
[Command(0)]
// CheckAvailability()
public long CheckAvailability(ServiceCtx context)
{
@ -36,6 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Acc
return 0;
}
[Command(1)]
// GetAccountId() -> nn::account::NetworkServiceAccountId
public long GetAccountId(ServiceCtx context)
{