From 2e60b5e60da58499b2ea78490af7c5f14ff62722 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Thu, 9 Jul 2020 14:41:30 +0100 Subject: [PATCH] Stub play reporting services --- app/CMakeLists.txt | 1 + .../main/cpp/skyline/services/base_service.h | 2 ++ .../skyline/services/prepo/IPrepoService.cpp | 12 ++++++++++ .../skyline/services/prepo/IPrepoService.h | 22 +++++++++++++++++++ .../main/cpp/skyline/services/serviceman.cpp | 4 ++++ 5 files changed, 41 insertions(+) create mode 100644 app/src/main/cpp/skyline/services/prepo/IPrepoService.cpp create mode 100644 app/src/main/cpp/skyline/services/prepo/IPrepoService.h diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 54888392..8a34ff47 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -124,6 +124,7 @@ add_library(skyline SHARED ${source_DIR}/skyline/services/nifm/IRequest.cpp ${source_DIR}/skyline/services/socket/bsd/IClient.cpp ${source_DIR}/skyline/services/ssl/ISslService.cpp + ${source_DIR}/skyline/services/prepo/IPrepoService.cpp ${source_DIR}/skyline/vfs/partition_filesystem.cpp ${source_DIR}/skyline/vfs/rom_filesystem.cpp ${source_DIR}/skyline/vfs/os_backing.cpp diff --git a/app/src/main/cpp/skyline/services/base_service.h b/app/src/main/cpp/skyline/services/base_service.h index 72db83f2..2459a6c3 100644 --- a/app/src/main/cpp/skyline/services/base_service.h +++ b/app/src/main/cpp/skyline/services/base_service.h @@ -80,6 +80,7 @@ namespace skyline::service { nifm_IRequest, socket_IClient, ssl_ISslService, + prepo_IPrepoService }; /** @@ -119,6 +120,7 @@ namespace skyline::service { {"nifm:u", Service::nifm_IStaticService}, {"bsd:u", Service::socket_IClient}, {"ssl", Service::ssl_ISslService}, + {"prepo:u", Service::prepo_IPrepoService} }; class ServiceManager; diff --git a/app/src/main/cpp/skyline/services/prepo/IPrepoService.cpp b/app/src/main/cpp/skyline/services/prepo/IPrepoService.cpp new file mode 100644 index 00000000..2b4486e4 --- /dev/null +++ b/app/src/main/cpp/skyline/services/prepo/IPrepoService.cpp @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#include "IPrepoService.h" + +namespace skyline::service::prepo { + IPrepoService::IPrepoService(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager, Service::prepo_IPrepoService, "prepo:IPrepoService", { + {0x2775, SFUNC(IPrepoService::SaveReportWithUser)}, + }) {} + + void IPrepoService::SaveReportWithUser(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {} +} diff --git a/app/src/main/cpp/skyline/services/prepo/IPrepoService.h b/app/src/main/cpp/skyline/services/prepo/IPrepoService.h new file mode 100644 index 00000000..2fdd6cc8 --- /dev/null +++ b/app/src/main/cpp/skyline/services/prepo/IPrepoService.h @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#pragma once + +#include +#include + +namespace skyline::service::prepo { + /** + * @brief IPrepoService or prepo:u is used by applications to store statistics (https://switchbrew.org/wiki/BCAT_services#prepo:a.2C_prepo:a2.2C_prepo:m.2C_prepo:u.2C_prepo:s) + */ + class IPrepoService : public BaseService { + public: + IPrepoService(const DeviceState &state, ServiceManager &manager); + + /** + * @brief This saves a play report for the given user + */ + void SaveReportWithUser(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + }; +} diff --git a/app/src/main/cpp/skyline/services/serviceman.cpp b/app/src/main/cpp/skyline/services/serviceman.cpp index d0b4cee6..badd3982 100644 --- a/app/src/main/cpp/skyline/services/serviceman.cpp +++ b/app/src/main/cpp/skyline/services/serviceman.cpp @@ -26,6 +26,7 @@ #include "nifm/IStaticService.h" #include "socket/bsd/IClient.h" #include "ssl/ISslService.h" +#include "prepo/IPrepoService.h" #include "serviceman.h" namespace skyline::service { @@ -110,6 +111,9 @@ namespace skyline::service { case Service::ssl_ISslService: serviceObj = std::make_shared(state, *this); break; + case Service::prepo_IPrepoService: + serviceObj = std::make_shared(state, *this); + break; default: throw exception("CreateService called on missing object, type: {}", serviceType); }