aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Horizon/Prepo/Ipc
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2024-01-25 23:06:53 +0100
committerGitHub <noreply@github.com>2024-01-25 23:06:53 +0100
commitcd37c75b82f97ad5d3bf6317ffcde62c06a6e920 (patch)
treedb4f6e9630878a4b32c8880ef95f7c877e20aab0 /src/Ryujinx.Horizon/Prepo/Ipc
parent43705c2320c2ff7c8f6dca1141f3bf56033966d4 (diff)
Horizon: Implement arp:r and arp:w services (#5802)
* Horizon: Implement arp:r and arp:w services * Fix formatting * Remove HLE arp services * Revert "Remove HLE arp services" This reverts commit c576fcccadb963db56b96bacabd1c1ac7abfb1ab. * Keep LibHac impl since it's used in bcat * Addresses gdkchan's feedback * ArpApi in PrepoIpcServer and remove LmApi * Fix 2 * Fixes ArpApi init * Fix encoding * Update PrepoService.cs * Fix prepo
Diffstat (limited to 'src/Ryujinx.Horizon/Prepo/Ipc')
-rw-r--r--src/Ryujinx.Horizon/Prepo/Ipc/PrepoService.cs21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/Ryujinx.Horizon/Prepo/Ipc/PrepoService.cs b/src/Ryujinx.Horizon/Prepo/Ipc/PrepoService.cs
index c165f46f..4ed7dd48 100644
--- a/src/Ryujinx.Horizon/Prepo/Ipc/PrepoService.cs
+++ b/src/Ryujinx.Horizon/Prepo/Ipc/PrepoService.cs
@@ -5,6 +5,7 @@ using Ryujinx.Common.Utilities;
using Ryujinx.Horizon.Common;
using Ryujinx.Horizon.Prepo.Types;
using Ryujinx.Horizon.Sdk.Account;
+using Ryujinx.Horizon.Sdk.Arp;
using Ryujinx.Horizon.Sdk.Prepo;
using Ryujinx.Horizon.Sdk.Sf;
using Ryujinx.Horizon.Sdk.Sf.Hipc;
@@ -22,14 +23,16 @@ namespace Ryujinx.Horizon.Prepo.Ipc
System,
}
+ private readonly ArpApi _arp;
private readonly PrepoServicePermissionLevel _permissionLevel;
private ulong _systemSessionId;
private bool _immediateTransmissionEnabled;
private bool _userAgreementCheckEnabled = true;
- public PrepoService(PrepoServicePermissionLevel permissionLevel)
+ public PrepoService(ArpApi arp, PrepoServicePermissionLevel permissionLevel)
{
+ _arp = arp;
_permissionLevel = permissionLevel;
}
@@ -165,7 +168,7 @@ namespace Ryujinx.Horizon.Prepo.Ipc
return PrepoResult.PermissionDenied;
}
- private static Result ProcessPlayReport(PlayReportKind playReportKind, ReadOnlySpan<byte> gameRoomBuffer, ReadOnlySpan<byte> reportBuffer, ulong pid, Uid userId, bool withUserId = false, ApplicationId applicationId = default)
+ private Result ProcessPlayReport(PlayReportKind playReportKind, ReadOnlySpan<byte> gameRoomBuffer, ReadOnlySpan<byte> reportBuffer, ulong pid, Uid userId, bool withUserId = false, ApplicationId applicationId = default)
{
if (withUserId)
{
@@ -199,8 +202,8 @@ namespace Ryujinx.Horizon.Prepo.Ipc
builder.AppendLine("PlayReport log:");
builder.AppendLine($" Kind: {playReportKind}");
- // NOTE: The service calls arp:r using the pid to get the application id, if it fails PrepoResult.InvalidPid is returned.
- // Reports are stored internally and an event is signaled to transmit them.
+ // NOTE: Reports are stored internally and an event is signaled to transmit them.
+
if (pid != 0)
{
builder.AppendLine($" Pid: {pid}");
@@ -210,6 +213,16 @@ namespace Ryujinx.Horizon.Prepo.Ipc
builder.AppendLine($" ApplicationId: {applicationId}");
}
+ Result result = _arp.GetApplicationInstanceId(out ulong applicationInstanceId, pid);
+ if (result.IsFailure)
+ {
+ return PrepoResult.InvalidPid;
+ }
+
+ _arp.GetApplicationLaunchProperty(out ApplicationLaunchProperty applicationLaunchProperty, applicationInstanceId).AbortOnFailure();
+
+ builder.AppendLine($" ApplicationVersion: {applicationLaunchProperty.Version}");
+
if (!userId.IsNull)
{
builder.AppendLine($" UserId: {userId}");