aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2022-12-07 23:19:22 +0100
committerGitHub <noreply@github.com>2022-12-07 23:19:22 +0100
commit1f3b860f0601074b2d459bef316c9b910a233096 (patch)
treed7dc9d1277204cd03e2ff173f0787cb993dcb902
parentabe3c02ab4f48a7980ace33413b579b17d7f3f24 (diff)
acc: Stub CheckNetworkServiceAvailabilityAsync (#4052)1.1.448
-rw-r--r--Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs26
-rw-r--r--Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs14
2 files changed, 40 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs
index 7b474f0e..d9f9864a 100644
--- a/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs
+++ b/Ryujinx.HLE/HOS/Services/Account/Acc/ApplicationServiceServer.cs
@@ -1,8 +1,12 @@
using Ryujinx.Common;
using Ryujinx.Common.Logging;
using Ryujinx.Cpu;
+using Ryujinx.HLE.HOS.Kernel.Threading;
using Ryujinx.HLE.HOS.Services.Account.Acc.AccountService;
+using Ryujinx.HLE.HOS.Services.Account.Acc.AsyncContext;
using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
namespace Ryujinx.HLE.HOS.Services.Account.Acc
{
@@ -142,6 +146,28 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return ResultCode.Success;
}
+ public ResultCode CheckNetworkServiceAvailabilityAsync(ServiceCtx context, out IAsyncContext asyncContext)
+ {
+ KEvent asyncEvent = new(context.Device.System.KernelContext);
+ AsyncExecution asyncExecution = new(asyncEvent);
+
+ asyncExecution.Initialize(1000, CheckNetworkServiceAvailabilityAsyncImpl);
+
+ asyncContext = new IAsyncContext(asyncExecution);
+
+ // return ResultCode.NullObject if the IAsyncContext pointer is null. Doesn't occur in our case.
+
+ return ResultCode.Success;
+ }
+
+ private async Task CheckNetworkServiceAvailabilityAsyncImpl(CancellationToken token)
+ {
+ Logger.Stub?.PrintStub(LogClass.ServiceAcc);
+
+ // TODO: Use a real function instead, with the CancellationToken.
+ await Task.CompletedTask;
+ }
+
public ResultCode StoreSaveDataThumbnail(ServiceCtx context)
{
ResultCode resultCode = CheckUserId(context, out UserId _);
diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs
index 92082322..059aba17 100644
--- a/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs
+++ b/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs
@@ -124,6 +124,20 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
return ResultCode.Success;
}
+ [CommandHipc(103)] // 4.0.0+
+ // CheckNetworkServiceAvailabilityAsync() -> object<nn::account::detail::IAsyncContext>
+ public ResultCode CheckNetworkServiceAvailabilityAsync(ServiceCtx context)
+ {
+ ResultCode resultCode = _applicationServiceServer.CheckNetworkServiceAvailabilityAsync(context, out IAsyncContext asyncContext);
+
+ if (resultCode == ResultCode.Success)
+ {
+ MakeObject(context, asyncContext);
+ }
+
+ return resultCode;
+ }
+
[CommandHipc(110)]
// StoreSaveDataThumbnail(nn::account::Uid, buffer<bytes, 5>)
public ResultCode StoreSaveDataThumbnail(ServiceCtx context)