services: prepo: Fix IPC interface with SaveReport/SaveReportWithUser.

This commit is contained in:
bunnei 2020-02-05 22:10:28 -05:00
parent 9751ccc5e0
commit 2245c24e21

View file

@ -50,16 +50,16 @@ private:
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
const auto process_id = rp.PopRaw<u64>(); const auto process_id = rp.PopRaw<u64>();
const auto data1 = ctx.ReadBuffer(0); std::vector<std::vector<u8>> data{ctx.ReadBuffer(0)};
const auto data2 = ctx.ReadBuffer(1); if (Type == Core::Reporter::PlayReportType::New) {
data.emplace_back(ctx.ReadBuffer(1));
}
LOG_DEBUG(Service_PREPO, LOG_DEBUG(Service_PREPO, "called, type={:02X}, process_id={:016X}, data1_size={:016X}",
"called, type={:02X}, process_id={:016X}, data1_size={:016X}, data2_size={:016X}", static_cast<u8>(Type), process_id, data[0].size());
static_cast<u8>(Type), process_id, data1.size(), data2.size());
const auto& reporter{system.GetReporter()}; const auto& reporter{system.GetReporter()};
reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), {data1, data2}, reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), data, process_id);
process_id);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
@ -70,19 +70,19 @@ private:
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
const auto user_id = rp.PopRaw<u128>(); const auto user_id = rp.PopRaw<u128>();
const auto process_id = rp.PopRaw<u64>(); const auto process_id = rp.PopRaw<u64>();
std::vector<std::vector<u8>> data{ctx.ReadBuffer(0)};
const auto data1 = ctx.ReadBuffer(0); if (Type == Core::Reporter::PlayReportType::New) {
const auto data2 = ctx.ReadBuffer(1); data.emplace_back(ctx.ReadBuffer(1));
}
LOG_DEBUG( LOG_DEBUG(
Service_PREPO, Service_PREPO,
"called, type={:02X}, user_id={:016X}{:016X}, process_id={:016X}, data1_size={:016X}, " "called, type={:02X}, user_id={:016X}{:016X}, process_id={:016X}, data1_size={:016X}",
"data2_size={:016X}", static_cast<u8>(Type), user_id[1], user_id[0], process_id, data[0].size());
static_cast<u8>(Type), user_id[1], user_id[0], process_id, data1.size(), data2.size());
const auto& reporter{system.GetReporter()}; const auto& reporter{system.GetReporter()};
reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), {data1, data2}, reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), data, process_id,
process_id, user_id); user_id);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);