2022-08-30 20:52:45 +02:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-15 01:00:34 +02:00
|
|
|
|
[CommandCmif(100)]
|
2022-08-30 20:52:45 +02:00
|
|
|
|
// GetNetworkServiceLicenseKind() -> nn::account::NetworkServiceLicenseKind
|
|
|
|
|
public ResultCode GetNetworkServiceLicenseKind(ServiceCtx context)
|
|
|
|
|
{
|
2022-08-31 19:41:43 +02:00
|
|
|
|
if (!AsyncExecution.IsInitialized)
|
2022-08-30 20:52:45 +02:00
|
|
|
|
{
|
|
|
|
|
return ResultCode.AsyncExecutionNotInitialized;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-31 19:41:43 +02:00
|
|
|
|
if (!AsyncExecution.SystemEvent.ReadableEvent.IsSignaled())
|
2022-08-30 20:52:45 +02:00
|
|
|
|
{
|
|
|
|
|
return ResultCode.Unknown41;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!_serviceLicenseKind.HasValue)
|
|
|
|
|
{
|
|
|
|
|
return ResultCode.MissingNetworkServiceLicenseKind;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
context.ResponseData.Write((uint)_serviceLicenseKind.Value);
|
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|