IManagerForApplication.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Ryujinx.Common.Logging;
  2. using Ryujinx.HLE.HOS.Ipc;
  3. using Ryujinx.HLE.HOS.Services.Arp;
  4. using Ryujinx.HLE.Utilities;
  5. using System.Collections.Generic;
  6. namespace Ryujinx.HLE.HOS.Services.Acc
  7. {
  8. class IManagerForApplication : IpcService
  9. {
  10. private UInt128 _userId;
  11. private ApplicationLaunchProperty _applicationLaunchProperty;
  12. private Dictionary<int, ServiceProcessRequest> _commands;
  13. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
  14. public IManagerForApplication(UInt128 userId, ApplicationLaunchProperty applicationLaunchProperty)
  15. {
  16. _commands = new Dictionary<int, ServiceProcessRequest>
  17. {
  18. { 0, CheckAvailability },
  19. { 1, GetAccountId }
  20. };
  21. _userId = userId;
  22. _applicationLaunchProperty = applicationLaunchProperty;
  23. }
  24. // CheckAvailability()
  25. public long CheckAvailability(ServiceCtx context)
  26. {
  27. Logger.PrintStub(LogClass.ServiceAcc);
  28. return 0;
  29. }
  30. // GetAccountId() -> nn::account::NetworkServiceAccountId
  31. public long GetAccountId(ServiceCtx context)
  32. {
  33. long networkServiceAccountId = 0xcafe;
  34. Logger.PrintStub(LogClass.ServiceAcc, new { networkServiceAccountId });
  35. context.ResponseData.Write(networkServiceAccountId);
  36. return 0;
  37. }
  38. }
  39. }