diff --git a/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs b/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs index 67344061a8..c28574479f 100644 --- a/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs +++ b/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs @@ -1,3 +1,4 @@ +using MsgPack; using MsgPack.Serialization; using Ryujinx.Common; using Ryujinx.Common.Logging; @@ -83,35 +84,21 @@ namespace Ryujinx.HLE.HOS.Services.Prepo private string ReadReportBuffer(byte[] buffer, string room, UserId userId) { - StringBuilder sb = new StringBuilder(); + StringBuilder builder = new StringBuilder(); + MessagePackObject deserializedReport = MessagePackSerializer.UnpackMessagePackObject(buffer); - sb.AppendLine(); - sb.AppendLine("PlayReport log:"); + builder.AppendLine(); + builder.AppendLine("PlayReport log:"); if (!userId.IsNull) { - sb.AppendLine($" UserId: {userId.ToString()}"); + builder.AppendLine($" UserId: {userId.ToString()}"); } - sb.AppendLine($" Room: {room}"); + builder.AppendLine($" Room: {room}"); + builder.AppendLine($" Report: {deserializedReport}"); - var deserializedReport = Deserialize(buffer); - string jsonReport = Encoding.ASCII.GetString(JsonSerializer.PrettyPrintByteArray(Encoding.UTF8.GetBytes(deserializedReport.ToString()))); - - sb.AppendLine($" Report:"); - sb.AppendLine(jsonReport); - - return sb.ToString(); - } - - private static T Deserialize(byte[] bytes) - { - MessagePackSerializer serializer = MessagePackSerializer.Get(); - - using (MemoryStream byteStream = new MemoryStream(bytes)) - { - return (T)serializer.Unpack(byteStream); - } + return builder.ToString(); } } } \ No newline at end of file