Fix Prepo parsing reports (#1016)
This fix the parsing of prepo service reports which could failed in some edge case. I've improved the parsing of the object to a JSON string too.
This commit is contained in:
parent
6edc929894
commit
b2d307d34f
1 changed files with 5 additions and 6 deletions
|
@ -3,9 +3,9 @@ using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||||
using Ryujinx.HLE.Utilities;
|
using Ryujinx.HLE.Utilities;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Utf8Json;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Prepo
|
namespace Ryujinx.HLE.HOS.Services.Prepo
|
||||||
{
|
{
|
||||||
|
@ -95,12 +95,11 @@ namespace Ryujinx.HLE.HOS.Services.Prepo
|
||||||
|
|
||||||
sb.AppendLine($" Room: {room}");
|
sb.AppendLine($" Room: {room}");
|
||||||
|
|
||||||
var payload = Deserialize<IDictionary<string, object>>(buffer);
|
var deserializedReport = Deserialize<dynamic>(buffer);
|
||||||
|
string jsonReport = Encoding.ASCII.GetString(JsonSerializer.PrettyPrintByteArray(Encoding.UTF8.GetBytes(deserializedReport.ToString())));
|
||||||
|
|
||||||
foreach (var field in payload)
|
sb.AppendLine($" Report:");
|
||||||
{
|
sb.AppendLine(jsonReport);
|
||||||
sb.AppendLine($" Key: {field.Key}, Value: {field.Value}");
|
|
||||||
}
|
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue