From ea14a955243705b5d5b22868c30c174e6524b4d3 Mon Sep 17 00:00:00 2001 From: Thog Date: Sun, 2 Feb 2020 04:24:17 +0100 Subject: Fix inconsistencies with UserId (#906) * Fix inconsistencies with UserId The account user id isn't an UUID. This PR adds a new UserId type with the correct value ordering to avoid mismatch with LibHac's Uid. This also fix an hardcoded value of the UserId. As the userid has been invalid for quite some time (and to avoid forcing users to their recreate saves), the userid has been changed to "00000000000000010000000000000000". Also implement a stub for IApplicationFunctions::GetSaveDataSize. (see the sources for the reason) Fix #626 * Address jd's & Ac_k's comments --- .../Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService') diff --git a/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs b/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs index 925a2593..ce85ff20 100644 --- a/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs +++ b/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs @@ -1,6 +1,7 @@ using ARMeilleure.Memory; +using Ryujinx.Common; +using Ryujinx.HLE.HOS.Services.Account.Acc; using Ryujinx.HLE.HOS.Services.Sdb.Pdm.QueryService.Types; -using Ryujinx.HLE.Utilities; using System; using System.Collections.Generic; using System.Linq; @@ -10,7 +11,7 @@ namespace Ryujinx.HLE.HOS.Services.Sdb.Pdm.QueryService { static class QueryPlayStatisticsManager { - private static Dictionary applicationPlayStatistics = new Dictionary(); + private static Dictionary applicationPlayStatistics = new Dictionary(); internal static ResultCode GetPlayStatistics(ServiceCtx context, bool byUserId = false) { @@ -20,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Sdb.Pdm.QueryService long outputPosition = context.Request.ReceiveBuff[0].Position; long outputSize = context.Request.ReceiveBuff[0].Size; - UInt128 userId = byUserId ? new UInt128(context.RequestData.ReadBytes(0x10)) : new UInt128(); + UserId userId = byUserId ? context.RequestData.ReadStruct() : new UserId(); if (byUserId) { -- cgit v1.2.3