Fixed some too long messages

This commit is contained in:
WolverinDEV
2020-07-30 11:50:31 +02:00
parent 3f700e79d3
commit 1e0c9eabe3
4 changed files with 17 additions and 4 deletions
+6
View File
@@ -494,6 +494,12 @@ command_result SpeakingClient::handleCommandClientInit(Command& cmd) {
logWarning(this->getServerId(), "{} Tried to join within an invalid supplied '{}' ({})", CLIENT_STR_LOG_PREFIX, key,cmd[key].string());
return command_result{error::client_hacked};
}
} else if(key == "client_talk_request_msg") {
if(cmd["client_talk_request_msg"].string().length() > 50)
return command_result{error::parameter_invalid_size, "client_talk_request_msg"};
} else if(key == "client_away_message") {
if(cmd["client_away_message"].string().length() > ts::kMaxAfkMessageLength)
return command_result{error::parameter_invalid_size, "client_away_message"};
}
const auto &info = property::find<property::ClientProperties>(key);