IParentalControlService.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. };
  18. _needInitialize = needInitialize;
  19. }
  20. public long Initialize(ServiceCtx context)
  21. {
  22. if (_needInitialize && !_initialized)
  23. {
  24. _initialized = true;
  25. }
  26. else
  27. {
  28. Logger.PrintWarning(LogClass.ServicePctl, "Service is already initialized!");
  29. }
  30. return 0;
  31. }
  32. }
  33. }