0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.HLE/HOS/Services/Account/Acc/IAsyncNetworkServiceLicenseKindContext.cs
2023-04-14 20:00:34 -03:00

38 lines
1.2 KiB
C#

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;
}
}
}