IManagerForApplication.cs 1.3 KB

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