diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs b/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs index 4f36d401..3fa1182d 100644 --- a/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs +++ b/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs @@ -31,7 +31,7 @@ namespace Ryujinx.HLE.HOS.Services.Prepo // SaveReport(u64, pid, buffer<u8, 9>, buffer<bytes, 5>) public ResultCode SaveReport(ServiceCtx context) { - if (((int)_permission & 1) == 0) + if ((_permission & PrepoServicePermissionLevel.User) == 0) { return ResultCode.PermissionDenied; } @@ -46,7 +46,7 @@ namespace Ryujinx.HLE.HOS.Services.Prepo // SaveReportWithUser(nn::account::Uid, u64, pid, buffer<u8, 9>, buffer<bytes, 5>) public ResultCode SaveReportWithUser(ServiceCtx context) { - if (((int)_permission & 1) == 0) + if ((_permission & PrepoServicePermissionLevel.User) == 0) { return ResultCode.PermissionDenied; } @@ -80,7 +80,7 @@ namespace Ryujinx.HLE.HOS.Services.Prepo // GetSystemSessionId() -> u64 public ResultCode GetSystemSessionId(ServiceCtx context) { - if (((int)_permission & 1) == 0) + if ((_permission & PrepoServicePermissionLevel.User) == 0) { return ResultCode.PermissionDenied; } @@ -99,6 +99,32 @@ namespace Ryujinx.HLE.HOS.Services.Prepo return ResultCode.Success; } + [CommandHipc(20100)] + // SaveSystemReport(u64, pid, buffer<u8, 9>, buffer<bytes, 5>) + public ResultCode SaveSystemReport(ServiceCtx context) + { + if ((_permission & PrepoServicePermissionLevel.System) != 0) + { + return ResultCode.PermissionDenied; + } + + // We don't care about the differences since we don't use the play report. + return ProcessReport(context, withUserID: false); + } + + [CommandHipc(20101)] + // SaveSystemReportWithUser(nn::account::Uid, u64, pid, buffer<u8, 9>, buffer<bytes, 5>) + public ResultCode SaveSystemReportWithUser(ServiceCtx context) + { + if ((_permission & PrepoServicePermissionLevel.System) != 0) + { + return ResultCode.PermissionDenied; + } + + // We don't care about the differences since we don't use the play report. + return ProcessReport(context, withUserID: true); + } + private ResultCode ProcessReport(ServiceCtx context, bool withUserID) { UserId userId = withUserID ? context.RequestData.ReadStruct<UserId>() : new UserId(); @@ -136,7 +162,7 @@ namespace Ryujinx.HLE.HOS.Services.Prepo private string ReadReportBuffer(byte[] buffer, string room, UserId userId) { - StringBuilder builder = new StringBuilder(); + StringBuilder builder = new StringBuilder(); MessagePackObject deserializedReport = MessagePackSerializer.UnpackMessagePackObject(buffer); builder.AppendLine(); |
