test debugger commands
This commit is contained in:
@@ -3,14 +3,38 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "typedefs.hpp"
|
||||
|
||||
namespace network {
|
||||
class Server;
|
||||
class Connection;
|
||||
class ReadableConnection;
|
||||
class Network;
|
||||
}
|
||||
|
||||
namespace dv {
|
||||
class value;
|
||||
}
|
||||
|
||||
class Engine;
|
||||
|
||||
namespace devtools {
|
||||
class ClientConnection {
|
||||
public:
|
||||
ClientConnection(network::Network& network, u64id_t connection)
|
||||
: network(network), connection(connection) {
|
||||
}
|
||||
~ClientConnection();
|
||||
|
||||
std::string read();
|
||||
void send(const dv::value& message);
|
||||
void sendResponse(const std::string& type);
|
||||
private:
|
||||
network::Network& network;
|
||||
size_t messageLength = 0;
|
||||
u64id_t connection;
|
||||
};
|
||||
|
||||
class DebuggingServer {
|
||||
public:
|
||||
DebuggingServer(Engine& engine, const std::string& serverString);
|
||||
@@ -18,12 +42,12 @@ namespace devtools {
|
||||
|
||||
bool update();
|
||||
|
||||
void setClient(network::Connection& client) {
|
||||
this->client = &client;
|
||||
}
|
||||
void setClient(u64id_t client);
|
||||
private:
|
||||
Engine& engine;
|
||||
network::Server& server;
|
||||
network::Connection* client;
|
||||
std::unique_ptr<ClientConnection> connection;
|
||||
|
||||
bool performCommand(const std::string& type, const dv::value& map);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user