diff options
| author | 2023-02-18 16:26:48 -0500 | |
|---|---|---|
| committer | 2023-02-21 12:19:25 -0500 | |
| commit | a9369726147c7499e0016e183d5d56a7b44efe4b (patch) | |
| tree | c1d1b4a9fdafd92863c0922b05d72c14de83ffa7 /src/core/hle/service/ldn | |
| parent | core: defer cpu shutdown (diff) | |
| download | yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar.gz yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar.xz yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.zip | |
service: refactor server architecture
Converts services to have their own processes
Diffstat (limited to 'src/core/hle/service/ldn')
| -rw-r--r-- | src/core/hle/service/ldn/ldn.cpp | 18 | ||||
| -rw-r--r-- | src/core/hle/service/ldn/ldn.h | 7 |
2 files changed, 12 insertions, 13 deletions
diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp index e5099d61f..4c2abe7d3 100644 --- a/src/core/hle/service/ldn/ldn.cpp +++ b/src/core/hle/service/ldn/ldn.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include "core/hle/service/ldn/ldn.h" | 8 | #include "core/hle/service/ldn/ldn.h" |
| 9 | #include "core/hle/service/ldn/ldn_results.h" | 9 | #include "core/hle/service/ldn/ldn_results.h" |
| 10 | #include "core/hle/service/ldn/ldn_types.h" | 10 | #include "core/hle/service/ldn/ldn_types.h" |
| 11 | #include "core/hle/service/server_manager.h" | ||
| 11 | #include "core/internal_network/network.h" | 12 | #include "core/internal_network/network.h" |
| 12 | #include "core/internal_network/network_interface.h" | 13 | #include "core/internal_network/network_interface.h" |
| 13 | #include "network/network.h" | 14 | #include "network/network.h" |
| @@ -106,7 +107,7 @@ class IUserLocalCommunicationService final | |||
| 106 | : public ServiceFramework<IUserLocalCommunicationService> { | 107 | : public ServiceFramework<IUserLocalCommunicationService> { |
| 107 | public: | 108 | public: |
| 108 | explicit IUserLocalCommunicationService(Core::System& system_) | 109 | explicit IUserLocalCommunicationService(Core::System& system_) |
| 109 | : ServiceFramework{system_, "IUserLocalCommunicationService", ServiceThreadType::CreateNew}, | 110 | : ServiceFramework{system_, "IUserLocalCommunicationService"}, |
| 110 | service_context{system, "IUserLocalCommunicationService"}, | 111 | service_context{system, "IUserLocalCommunicationService"}, |
| 111 | room_network{system_.GetRoomNetwork()}, lan_discovery{room_network} { | 112 | room_network{system_.GetRoomNetwork()}, lan_discovery{room_network} { |
| 112 | // clang-format off | 113 | // clang-format off |
| @@ -730,12 +731,15 @@ public: | |||
| 730 | } | 731 | } |
| 731 | }; | 732 | }; |
| 732 | 733 | ||
| 733 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { | 734 | void LoopProcess(Core::System& system) { |
| 734 | std::make_shared<LDNM>(system)->InstallAsService(sm); | 735 | auto server_manager = std::make_unique<ServerManager>(system); |
| 735 | std::make_shared<LDNS>(system)->InstallAsService(sm); | 736 | |
| 736 | std::make_shared<LDNU>(system)->InstallAsService(sm); | 737 | server_manager->RegisterNamedService("ldn:m", std::make_shared<LDNM>(system)); |
| 737 | std::make_shared<LP2PAPP>(system)->InstallAsService(sm); | 738 | server_manager->RegisterNamedService("ldn:s", std::make_shared<LDNS>(system)); |
| 738 | std::make_shared<LP2PSYS>(system)->InstallAsService(sm); | 739 | server_manager->RegisterNamedService("ldn:u", std::make_shared<LDNU>(system)); |
| 740 | server_manager->RegisterNamedService("lp2p:app", std::make_shared<LP2PAPP>(system)); | ||
| 741 | server_manager->RegisterNamedService("lp2p:sys", std::make_shared<LP2PSYS>(system)); | ||
| 742 | ServerManager::RunServer(std::move(server_manager)); | ||
| 739 | } | 743 | } |
| 740 | 744 | ||
| 741 | } // namespace Service::LDN | 745 | } // namespace Service::LDN |
diff --git a/src/core/hle/service/ldn/ldn.h b/src/core/hle/service/ldn/ldn.h index 6afe2ea6f..fa869fa89 100644 --- a/src/core/hle/service/ldn/ldn.h +++ b/src/core/hle/service/ldn/ldn.h | |||
| @@ -13,13 +13,8 @@ namespace Core { | |||
| 13 | class System; | 13 | class System; |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | namespace Service::SM { | ||
| 17 | class ServiceManager; | ||
| 18 | } | ||
| 19 | |||
| 20 | namespace Service::LDN { | 16 | namespace Service::LDN { |
| 21 | 17 | ||
| 22 | /// Registers all LDN services with the specified service manager. | 18 | void LoopProcess(Core::System& system); |
| 23 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system); | ||
| 24 | 19 | ||
| 25 | } // namespace Service::LDN | 20 | } // namespace Service::LDN |