diff options
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncNetworkServiceLicenseKindContext.cs')
| -rw-r--r-- | src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncNetworkServiceLicenseKindContext.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncNetworkServiceLicenseKindContext.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncNetworkServiceLicenseKindContext.cs new file mode 100644 index 00000000..1fa5cf2a --- /dev/null +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncNetworkServiceLicenseKindContext.cs @@ -0,0 +1,38 @@ +using Ryujinx.HLE.HOS.Services.Account.Acc.AsyncContext; + +namespace Ryujinx.HLE.HOS.Services.Account.Acc +{ + class IAsyncNetworkServiceLicenseKindContext : IAsyncContext + { + private NetworkServiceLicenseKind? _serviceLicenseKind; + + public IAsyncNetworkServiceLicenseKindContext(AsyncExecution asyncExecution, NetworkServiceLicenseKind? serviceLicenseKind) : base(asyncExecution) + { + _serviceLicenseKind = serviceLicenseKind; + } + + [CommandCmif(100)] + // GetNetworkServiceLicenseKind() -> nn::account::NetworkServiceLicenseKind + public ResultCode GetNetworkServiceLicenseKind(ServiceCtx context) + { + if (!AsyncExecution.IsInitialized) + { + return ResultCode.AsyncExecutionNotInitialized; + } + + if (!AsyncExecution.SystemEvent.ReadableEvent.IsSignaled()) + { + return ResultCode.Unknown41; + } + + if (!_serviceLicenseKind.HasValue) + { + return ResultCode.MissingNetworkServiceLicenseKind; + } + + context.ResponseData.Write((uint)_serviceLicenseKind.Value); + + return ResultCode.Success; + } + } +} |
