Using new command error system

This commit is contained in:
WolverinDEV
2020-01-25 23:42:37 +01:00
parent 10092cfab0
commit bb2e7699dc
18 changed files with 1223 additions and 1190 deletions
+3 -3
View File
@@ -232,11 +232,11 @@ bool WebClient::closeConnection(const std::chrono::system_clock::time_point& tim
return true;
}
CommandResult WebClient::handleCommand(Command &command) {
command_result WebClient::handleCommand(Command &command) {
if(this->connectionState() == ConnectionState::INIT_HIGH && this->handshake.state == HandshakeState::SUCCEEDED){
if(command.command() == "clientinit") {
auto result = this->handleCommandClientInit(command);
if(!result)
if(result.error_code())
this->closeConnection(system_clock::now() + seconds(1));
return result;
}
@@ -624,7 +624,7 @@ bool WebClient::disconnect(const std::string &reason) {
return this->closeConnection(system_clock::now() + seconds(1));
}
CommandResult WebClient::handleCommandClientInit(Command &command) {
command_result WebClient::handleCommandClientInit(Command &command) {
return SpeakingClient::handleCommandClientInit(command);
}
+2 -2
View File
@@ -109,8 +109,8 @@ namespace ts {
protected:
CommandResult handleCommand(Command &command) override;
CommandResult handleCommandClientInit(Command &command) override;
command_result handleCommand(Command &command) override;
command_result handleCommandClientInit(Command &command) override;
};
}
}