IParentalControlService.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Ryujinx.HLE.Logging;
  2. using Ryujinx.HLE.OsHle.Ipc;
  3. using System.Collections.Generic;
  4. namespace Ryujinx.HLE.OsHle.Services.Pctl
  5. {
  6. class IParentalControlService : IpcService
  7. {
  8. private Dictionary<int, ServiceProcessRequest> m_Commands;
  9. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  10. private bool Initialized = false;
  11. private bool NeedInitialize;
  12. public IParentalControlService(bool NeedInitialize = true)
  13. {
  14. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  15. {
  16. { 1, Initialize }
  17. };
  18. this.NeedInitialize = NeedInitialize;
  19. }
  20. public long Initialize(ServiceCtx Context)
  21. {
  22. if (NeedInitialize && !Initialized)
  23. {
  24. Initialized = true;
  25. }
  26. else
  27. {
  28. Context.Ns.Log.PrintWarning(LogClass.ServicePctl, "Service is already initialized!");
  29. }
  30. return 0;
  31. }
  32. }
  33. }