mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-26 09:02:44 -06:00
rpc: Fix class hierarchy. (#6694)
This commit is contained in:
parent
c10ffda91f
commit
0bedb28bdc
6 changed files with 14 additions and 12 deletions
|
@ -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<Core::TelemetrySession>();
|
||||
|
||||
rpc_server = std::make_unique<RPC::RPCServer>(*this);
|
||||
rpc_server = std::make_unique<RPC::Server>(*this);
|
||||
|
||||
service_manager = std::make_unique<Service::SM::ServiceManager>(*this);
|
||||
archive_manager = std::make_unique<Service::FS::ArchiveManager>(*this);
|
||||
|
|
|
@ -33,7 +33,7 @@ class DspInterface;
|
|||
}
|
||||
|
||||
namespace Core::RPC {
|
||||
class RPCServer;
|
||||
class Server;
|
||||
}
|
||||
|
||||
namespace Service {
|
||||
|
@ -384,7 +384,7 @@ private:
|
|||
std::shared_ptr<Frontend::ImageInterface> registered_image_interface;
|
||||
|
||||
/// RPC Server for scripting support
|
||||
std::unique_ptr<RPC::RPCServer> rpc_server;
|
||||
std::unique_ptr<RPC::Server> rpc_server;
|
||||
|
||||
std::unique_ptr<Service::FS::ArchiveManager> archive_manager;
|
||||
|
||||
|
|
|
@ -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); });
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <span>
|
||||
#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<std::unique_ptr<Packet>, true> request_queue;
|
||||
std::jthread request_handler_thread;
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <functional>
|
||||
#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<Packet> new_request) {
|
||||
NewRequestCallback(std::move(new_request));
|
||||
};
|
||||
|
|
|
@ -5,22 +5,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#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<Packet> new_request);
|
||||
|
||||
private:
|
||||
RPCServer& rpc_server;
|
||||
RPCServer rpc_server;
|
||||
std::unique_ptr<UDPServer> udp_server;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue