diff --git a/src/core/core.cpp b/src/core/core.cpp index 35bcca994d..703b49fba2 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -47,7 +47,7 @@ #include "core/hw/lcd.h" #include "core/loader/loader.h" #include "core/movie.h" -#include "core/rpc/rpc_server.h" +#include "core/rpc/server.h" #include "network/network.h" #include "video_core/custom_textures/custom_tex_manager.h" #include "video_core/renderer_base.h" @@ -416,7 +416,7 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window, telemetry_session = std::make_unique(); - rpc_server = std::make_unique(*this); + rpc_server = std::make_unique(*this); service_manager = std::make_unique(*this); archive_manager = std::make_unique(*this); diff --git a/src/core/core.h b/src/core/core.h index f73be6524b..fc9bba1e73 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -33,7 +33,7 @@ class DspInterface; } namespace Core::RPC { -class RPCServer; +class Server; } namespace Service { @@ -384,7 +384,7 @@ private: std::shared_ptr registered_image_interface; /// RPC Server for scripting support - std::unique_ptr rpc_server; + std::unique_ptr rpc_server; std::unique_ptr archive_manager; diff --git a/src/core/rpc/rpc_server.cpp b/src/core/rpc/rpc_server.cpp index b9114be82c..4dd9c2e767 100644 --- a/src/core/rpc/rpc_server.cpp +++ b/src/core/rpc/rpc_server.cpp @@ -10,7 +10,7 @@ namespace Core::RPC { -RPCServer::RPCServer(Core::System& system_) : system{system_}, server{*this} { +RPCServer::RPCServer(Core::System& system_) : system{system_} { LOG_INFO(RPC_Server, "Starting RPC server."); request_handler_thread = std::jthread([this](std::stop_token stop_token) { HandleRequestsLoop(stop_token); }); diff --git a/src/core/rpc/rpc_server.h b/src/core/rpc/rpc_server.h index 04b4371c90..f34d970596 100644 --- a/src/core/rpc/rpc_server.h +++ b/src/core/rpc/rpc_server.h @@ -9,7 +9,6 @@ #include #include "common/polyfill_thread.h" #include "common/threadsafe_queue.h" -#include "core/rpc/server.h" namespace Core { class System; @@ -36,7 +35,6 @@ private: private: Core::System& system; - Server server; Common::SPSCQueue, true> request_queue; std::jthread request_handler_thread; }; diff --git a/src/core/rpc/server.cpp b/src/core/rpc/server.cpp index ed93dac046..9ed278802d 100644 --- a/src/core/rpc/server.cpp +++ b/src/core/rpc/server.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include +#include "core/core.h" #include "core/rpc/packet.h" #include "core/rpc/rpc_server.h" #include "core/rpc/server.h" @@ -10,7 +10,7 @@ namespace Core::RPC { -Server::Server(RPCServer& rpc_server) : rpc_server(rpc_server) { +Server::Server(Core::System& system_) : rpc_server{system_} { const auto callback = [this](std::unique_ptr new_request) { NewRequestCallback(std::move(new_request)); }; diff --git a/src/core/rpc/server.h b/src/core/rpc/server.h index 46028e99b8..af6e42053c 100644 --- a/src/core/rpc/server.h +++ b/src/core/rpc/server.h @@ -5,22 +5,26 @@ #pragma once #include +#include "core/rpc/rpc_server.h" + +namespace Core { +class System; +} namespace Core::RPC { -class RPCServer; class UDPServer; class Packet; class Server { public: - explicit Server(RPCServer& rpc_server); + explicit Server(Core::System& system_); ~Server(); void NewRequestCallback(std::unique_ptr new_request); private: - RPCServer& rpc_server; + RPCServer rpc_server; std::unique_ptr udp_server; };