mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
test debugger commands
This commit is contained in:
parent
44bf4a2f9e
commit
3fef284a02
4 changed files with 133 additions and 9 deletions
|
|
@ -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);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue