Using new permissions system consequently

This commit is contained in:
WolverinDEV
2020-01-26 14:21:34 +01:00
parent bb2e7699dc
commit c7b6c0a3ba
37 changed files with 8982 additions and 657 deletions
+13
View File
@@ -157,6 +157,19 @@ void WebClient::sendCommand(const ts::Command &command, bool low) {
this->sendJson(value);
}
void WebClient::sendCommand(const ts::command_builder &command, bool low) {
#if false
Json::Value value{};
value["type"] = "command2";
value["payload"] = command.build();
this->sendJson(value);
#else
auto data = command.build();
Command parsed_command = Command::parse(pipes::buffer_view{data.data(), data.length()}, true, false);
this->sendCommand(parsed_command, low);
#endif
}
bool WebClient::closeConnection(const std::chrono::system_clock::time_point& timeout) {
bool flushing = timeout.time_since_epoch().count() > 0;
+1
View File
@@ -26,6 +26,7 @@ namespace ts {
void sendJson(const Json::Value&);
void sendCommand(const ts::Command &command, bool low = false) override;
void sendCommand(const ts::command_builder &command, bool low) override;
bool disconnect(const std::string &reason) override;
bool closeConnection(const std::chrono::system_clock::time_point& timeout = std::chrono::system_clock::time_point()) override;