aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Horizon/Prepo/Ipc/PrepoService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Horizon/Prepo/Ipc/PrepoService.cs')
-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}");