Set wesnothd and wesnoth client MP username length limit to 20 (was 18)

This commit is contained in:
Ignacio R. Morelle 2010-12-05 21:12:23 +00:00
parent 9c104ae4c2
commit 3487ab1a23
4 changed files with 6 additions and 6 deletions

View file

@ -309,7 +309,7 @@ static server_type open_connection(game_display& disp, const std::string& origin
"hyphens are allowed.", i18n_symbols);
} else if((*error)["error_code"] == MP_NAME_TOO_LONG_ERROR) {
error_message = vgettext("The nick '$nick' is too long. Nicks must "
"be 18 characters or less.", i18n_symbols);
"be 20 characters or less.", i18n_symbols);
} else if((*error)["error_code"] == MP_NAME_RESERVED_ERROR) {
error_message = vgettext("The nick '$nick' is reserved and cannot be used by players.", i18n_symbols);
} else if((*error)["error_code"] == MP_NAME_UNREGISTERED_ERROR) {

View file

@ -23,7 +23,7 @@ class game_display;
namespace mp {
// max. length of a player name
const size_t max_login_size = 18;
const size_t max_login_size = 20;
/*
* This is the main entry points of multiplayer mode.

View file

@ -149,8 +149,8 @@ void suh::check_name(const std::string& name) {
"characters. Only alpha-numeric characters, underscores and hyphens"
"are allowed.");
}
if(name.size() > 18) {
throw error("This username is too long. Usernames must be 18 characters or less.");
if(name.size() > 20) {
throw error("This username is too long. Usernames must be 20 characters or less.");
}
}

View file

@ -962,8 +962,8 @@ void server::process_login(const network::connection sock,
"are allowed.").c_str(), MP_INVALID_CHARS_IN_NAME_ERROR);
return;
}
if (username.size() > 18) {
send_error(sock, ("The nick '" + username + "' is too long. Nicks must be 18 characters or less.").c_str(),
if (username.size() > 20) {
send_error(sock, ("The nick '" + username + "' is too long. Nicks must be 20 characters or less.").c_str(),
MP_NAME_TOO_LONG_ERROR);
return;
}