1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-11 12:16:39 +00:00
Ryujinx/Ryujinx.HLE/HOS/Services/Sdb/Pdm/IQueryService.cs
Ac_K 79abc6ed93 Implement IApplicationFunctions & IQueryService commands (#823)
* Implement IApplicationFunctions & IQueryService commands

- Fix some nits in `IApplicationFunctions`
- Implement `QueryApplicationPlayStatistics` and `QueryApplicationPlayStatisticsByUid` checked by RE.
- Implement `QueryApplicationPlayStatisticsForSystem` and `QueryApplicationPlayStatisticsByUserAccountIdForSystem` checked by RE.
- Implement `QueryPlayStatisticsManager` to get/set played games statistics. We currently don't store any statistics because it's handled by qlaunch (or maybe am service?) on Switch.
We can add support later if games use returned statistics for something.

* Fix reviews
2019-11-15 01:25:22 +01:00

24 lines
No EOL
974 B
C#

using Ryujinx.HLE.HOS.Services.Sdb.Pdm.QueryService;
namespace Ryujinx.HLE.HOS.Services.Sdb.Pdm
{
[Service("pdm:qry")]
class IQueryService : IpcService
{
public IQueryService(ServiceCtx context) { }
[Command(13)] // 5.0.0+
// QueryApplicationPlayStatisticsForSystem(buffer<bytes, 5> title_id_list) -> (buffer<bytes, 6> entries, s32 entries_count)
public ResultCode QueryApplicationPlayStatisticsForSystem(ServiceCtx context)
{
return QueryPlayStatisticsManager.GetPlayStatistics(context);
}
[Command(16)] // 6.0.0+
// QueryApplicationPlayStatisticsByUserAccountIdForSystem(nn::account::Uid, buffer<bytes, 5> title_id_list) -> (buffer<bytes, 6> entries, s32 entries_count)
public ResultCode QueryApplicationPlayStatisticsByUserAccountIdForSystem(ServiceCtx context)
{
return QueryPlayStatisticsManager.GetPlayStatistics(context, true);
}
}
}