Fixing some bugs for 1.4.19b1
This commit is contained in:
@@ -496,10 +496,10 @@ command_result SpeakingClient::handleCommandClientInit(Command& cmd) {
|
||||
return command_result{error::client_hacked};
|
||||
}
|
||||
} else if(key == "client_talk_request_msg") {
|
||||
if(cmd["client_talk_request_msg"].string().length() > 50)
|
||||
if(cmd["client_talk_request_msg"].string().length() > ts::config::server::limits::talk_power_request_message_length)
|
||||
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)
|
||||
if(cmd["client_away_message"].string().length() > ts::config::server::limits::afk_message_length)
|
||||
return command_result{error::parameter_invalid_size, "client_away_message"};
|
||||
}
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ command_result ConnectedClient::handleCommandClientPoke(Command &cmd) {
|
||||
}
|
||||
|
||||
auto message = cmd["msg"].string();
|
||||
if(count_characters(message) > 100)
|
||||
if(count_characters(message) > ts::config::server::limits::poke_message_length)
|
||||
return command_result{error::parameter_invalid_size, "msg"};
|
||||
|
||||
for(auto& client : clients)
|
||||
@@ -654,12 +654,12 @@ command_result ConnectedClient::handleCommandClientEdit(Command &cmd, const std:
|
||||
} else if(info == property::CLIENT_AWAY_MESSAGE) {
|
||||
if(!self) continue;
|
||||
|
||||
if(cmd["client_away_message"].string().length() > ts::kMaxAfkMessageLength)
|
||||
if(cmd["client_away_message"].string().length() > ts::config::server::limits::afk_message_length)
|
||||
return command_result{error::parameter_invalid};
|
||||
} else if(!self) { /* dont edit random properties of other clients. For us self its allowed to edit the rest without permissions */
|
||||
continue;
|
||||
} else if(info == property::CLIENT_TALK_REQUEST_MSG) {
|
||||
if(cmd["client_talk_request_msg"].string().length() > ts::kMaxRequestTalkPowerMessageLength)
|
||||
if(cmd["client_talk_request_msg"].string().length() > ts::config::server::limits::talk_power_request_message_length)
|
||||
return command_result{error::parameter_invalid};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user