Stubbed QueryLastPlayTime

This commit is contained in:
Jarrod Norwell 2024-05-28 02:19:54 +08:00
parent 39f1a62c8d
commit 7eff2ce894
4 changed files with 25 additions and 2 deletions

View File

@ -31,7 +31,7 @@ PDM_QRY::PDM_QRY(Core::System& system_) : ServiceFramework{system_, "pdm:qry"} {
{14, nullptr, "QueryRecentlyPlayedApplication"},
{15, nullptr, "GetRecentlyPlayedApplicationUpdateEvent"},
{16, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystemV0"},
{17, nullptr, "QueryLastPlayTime"},
{17, &PDM_QRY::QueryLastPlayTime, "QueryLastPlayTime"},
{18, nullptr, "QueryApplicationPlayStatisticsForSystem"},
{19, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystem"},
};
@ -64,4 +64,12 @@ void PDM_QRY::QueryPlayStatisticsByApplicationIdAndUserAccountId(HLERequestConte
rb.PushRaw(statistics);
}
void PDM_QRY::QueryLastPlayTime(HLERequestContext& ctx) {
const s32 total_entries = 1;
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push(total_entries);
}
} // namespace Service::NS

View File

@ -27,6 +27,7 @@ public:
private:
void QueryPlayStatisticsByApplicationIdAndUserAccountId(HLERequestContext& ctx);
void QueryLastPlayTime(HLERequestContext& ctx);
};
} // namespace Service::NS

View File

@ -29,7 +29,7 @@ IQueryService::IQueryService(Core::System& system_) : ServiceFramework{system_,
{14, nullptr, "QueryRecentlyPlayedApplication"},
{15, nullptr, "GetRecentlyPlayedApplicationUpdateEvent"},
{16, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystemV0"},
{17, nullptr, "QueryLastPlayTime"},
{17, D<&IQueryService::QueryLastPlayTime>, "QueryLastPlayTime"},
{18, nullptr, "QueryApplicationPlayStatisticsForSystem"},
{19, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystem"},
};
@ -53,4 +53,13 @@ Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId(
R_SUCCEED();
}
Result IQueryService::QueryLastPlayTime(
Out<s32> out_entries, u8 unknown,
OutArray<LastPlayTime, BufferAttr_HipcMapAlias> out_last_play_times,
InArray<s32, BufferAttr_HipcMapAlias> application_ids) {
*out_entries = 1;
*out_last_play_times = {};
R_SUCCEED();
}
} // namespace Service::NS

View File

@ -23,6 +23,8 @@ struct PlayStatistics {
};
static_assert(sizeof(PlayStatistics) == 0x28, "PlayStatistics is an invalid size");
struct LastPlayTime {};
class IQueryService final : public ServiceFramework<IQueryService> {
public:
explicit IQueryService(Core::System& system_);
@ -31,6 +33,9 @@ public:
private:
Result QueryPlayStatisticsByApplicationIdAndUserAccountId(
Out<PlayStatistics> out_play_statistics, bool unknown, u64 application_id, Uid account_id);
Result QueryLastPlayTime(Out<s32> out_entries, u8 unknown,
OutArray<LastPlayTime, BufferAttr_HipcMapAlias> out_last_play_times,
InArray<s32, BufferAttr_HipcMapAlias> application_ids);
};
} // namespace Service::NS