diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Pctl')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Pctl/IParentalControlService.cs | 41 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs | 35 |
2 files changed, 76 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlService.cs b/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlService.cs new file mode 100644 index 00000000..d484d312 --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlService.cs @@ -0,0 +1,41 @@ +using Ryujinx.HLE.HOS.Ipc; +using Ryujinx.HLE.Logging; +using System.Collections.Generic; + +namespace Ryujinx.HLE.HOS.Services.Pctl +{ + class IParentalControlService : IpcService + { + private Dictionary<int, ServiceProcessRequest> m_Commands; + + public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; + + private bool Initialized = false; + + private bool NeedInitialize; + + public IParentalControlService(bool NeedInitialize = true) + { + m_Commands = new Dictionary<int, ServiceProcessRequest>() + { + { 1, Initialize } + }; + + this.NeedInitialize = NeedInitialize; + } + + public long Initialize(ServiceCtx Context) + { + if (NeedInitialize && !Initialized) + { + Initialized = true; + } + else + { + Context.Device.Log.PrintWarning(LogClass.ServicePctl, "Service is already initialized!"); + } + + return 0; + } + } +}
\ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs b/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs new file mode 100644 index 00000000..157d594d --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs @@ -0,0 +1,35 @@ +using Ryujinx.HLE.HOS.Ipc; +using System.Collections.Generic; + +namespace Ryujinx.HLE.HOS.Services.Pctl +{ + class IParentalControlServiceFactory : IpcService + { + private Dictionary<int, ServiceProcessRequest> m_Commands; + + public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; + + public IParentalControlServiceFactory() + { + m_Commands = new Dictionary<int, ServiceProcessRequest>() + { + { 0, CreateService }, + { 1, CreateServiceWithoutInitialize } + }; + } + + public long CreateService(ServiceCtx Context) + { + MakeObject(Context, new IParentalControlService()); + + return 0; + } + + public long CreateServiceWithoutInitialize(ServiceCtx Context) + { + MakeObject(Context, new IParentalControlService(false)); + + return 0; + } + } +}
\ No newline at end of file |
