diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/prepo/prepo.cpp | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index 78f897d3e..ec4a84989 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp @@ -4,9 +4,10 @@ #include "common/hex_util.h" #include "common/logging/log.h" #include "core/core.h" -#include "core/hle/ipc_helpers.h" #include "core/hle/service/acc/profile_manager.h" +#include "core/hle/service/ipc_helpers.h" #include "core/hle/service/prepo/prepo.h" +#include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" #include "core/reporter.h" @@ -53,7 +54,7 @@ public: private: template <Core::Reporter::PlayReportType Type> - void SaveReport(Kernel::HLERequestContext& ctx) { + void SaveReport(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto process_id = rp.PopRaw<u64>(); @@ -63,7 +64,7 @@ private: return ctx.ReadBuffer(1); } - return std::vector<u8>{}; + return std::span<const u8>{}; }(); LOG_DEBUG(Service_PREPO, @@ -71,7 +72,7 @@ private: Type, process_id, data1.size(), data2.size()); const auto& reporter{system.GetReporter()}; - reporter.SavePlayReport(Type, system.GetCurrentProcessProgramID(), {data1, data2}, + reporter.SavePlayReport(Type, system.GetApplicationProcessProgramID(), {data1, data2}, process_id); IPC::ResponseBuilder rb{ctx, 2}; @@ -79,7 +80,7 @@ private: } template <Core::Reporter::PlayReportType Type> - void SaveReportWithUser(Kernel::HLERequestContext& ctx) { + void SaveReportWithUser(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto user_id = rp.PopRaw<u128>(); const auto process_id = rp.PopRaw<u64>(); @@ -90,7 +91,7 @@ private: return ctx.ReadBuffer(1); } - return std::vector<u8>{}; + return std::span<const u8>{}; }(); LOG_DEBUG(Service_PREPO, @@ -99,21 +100,21 @@ private: Type, user_id[1], user_id[0], process_id, data1.size(), data2.size()); const auto& reporter{system.GetReporter()}; - reporter.SavePlayReport(Type, system.GetCurrentProcessProgramID(), {data1, data2}, + reporter.SavePlayReport(Type, system.GetApplicationProcessProgramID(), {data1, data2}, process_id, user_id); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } - void RequestImmediateTransmission(Kernel::HLERequestContext& ctx) { + void RequestImmediateTransmission(HLERequestContext& ctx) { LOG_WARNING(Service_PREPO, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } - void GetTransmissionStatus(Kernel::HLERequestContext& ctx) { + void GetTransmissionStatus(HLERequestContext& ctx) { LOG_WARNING(Service_PREPO, "(STUBBED) called"); constexpr s32 status = 0; @@ -123,7 +124,7 @@ private: rb.Push(status); } - void GetSystemSessionId(Kernel::HLERequestContext& ctx) { + void GetSystemSessionId(HLERequestContext& ctx) { LOG_WARNING(Service_PREPO, "(STUBBED) called"); constexpr u64 system_session_id = 0; @@ -132,7 +133,7 @@ private: rb.Push(system_session_id); } - void SaveSystemReport(Kernel::HLERequestContext& ctx) { + void SaveSystemReport(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto title_id = rp.PopRaw<u64>(); @@ -142,7 +143,7 @@ private: return ctx.ReadBuffer(1); } - return std::vector<u8>{}; + return std::span<const u8>{}; }(); LOG_DEBUG(Service_PREPO, "called, title_id={:016X}, data1_size={:016X}, data2_size={:016X}", @@ -155,7 +156,7 @@ private: rb.Push(ResultSuccess); } - void SaveSystemReportWithUser(Kernel::HLERequestContext& ctx) { + void SaveSystemReportWithUser(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto user_id = rp.PopRaw<u128>(); const auto title_id = rp.PopRaw<u64>(); @@ -166,7 +167,7 @@ private: return ctx.ReadBuffer(1); } - return std::vector<u8>{}; + return std::span<const u8>{}; }(); LOG_DEBUG(Service_PREPO, @@ -183,12 +184,20 @@ private: } }; -void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { - std::make_shared<PlayReport>("prepo:a", system)->InstallAsService(service_manager); - std::make_shared<PlayReport>("prepo:a2", system)->InstallAsService(service_manager); - std::make_shared<PlayReport>("prepo:m", system)->InstallAsService(service_manager); - std::make_shared<PlayReport>("prepo:s", system)->InstallAsService(service_manager); - std::make_shared<PlayReport>("prepo:u", system)->InstallAsService(service_manager); +void LoopProcess(Core::System& system) { + auto server_manager = std::make_unique<ServerManager>(system); + + server_manager->RegisterNamedService("prepo:a", + std::make_shared<PlayReport>("prepo:a", system)); + server_manager->RegisterNamedService("prepo:a2", + std::make_shared<PlayReport>("prepo:a2", system)); + server_manager->RegisterNamedService("prepo:m", + std::make_shared<PlayReport>("prepo:m", system)); + server_manager->RegisterNamedService("prepo:s", + std::make_shared<PlayReport>("prepo:s", system)); + server_manager->RegisterNamedService("prepo:u", + std::make_shared<PlayReport>("prepo:u", system)); + ServerManager::RunServer(std::move(server_manager)); } } // namespace Service::PlayReport |