IParentalControlService.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Ryujinx.Common.Logging;
  2. using Ryujinx.HLE.HOS.Ipc;
  3. using System.Collections.Generic;
  4. namespace Ryujinx.HLE.HOS.Services.Pctl
  5. {
  6. class IParentalControlService : IpcService
  7. {
  8. private Dictionary<int, ServiceProcessRequest> _commands;
  9. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
  10. private bool _initialized = false;
  11. private bool _needInitialize;
  12. public IParentalControlService(bool needInitialize = true)
  13. {
  14. _commands = new Dictionary<int, ServiceProcessRequest>
  15. {
  16. { 1, Initialize },
  17. { 1001, CheckFreeCommunicationPermission }
  18. };
  19. _needInitialize = needInitialize;
  20. }
  21. public long Initialize(ServiceCtx context)
  22. {
  23. if (_needInitialize && !_initialized)
  24. {
  25. _initialized = true;
  26. }
  27. else
  28. {
  29. Logger.PrintWarning(LogClass.ServicePctl, "Service is already initialized!");
  30. }
  31. return 0;
  32. }
  33. public long CheckFreeCommunicationPermission(ServiceCtx context)
  34. {
  35. Logger.PrintStub(LogClass.ServicePctl);
  36. return 0;
  37. }
  38. }
  39. }