IParentalControlService.cs 1.3 KB

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