diff --git a/sql/updates/world/3.3.5/2016_08_04_05_world.sql b/sql/updates/world/3.3.5/2016_08_04_05_world.sql new file mode 100644 index 0000000000..02f0f13005 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_04_05_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `trinity_string` WHERE `entry` = 1031; +INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES +(1031, 'An account password can NOT be longer than 16 characters (client limit). The account was NOT created.'); diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 66222342bf..c17c7103db 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -44,6 +44,9 @@ AccountOpResult AccountMgr::CreateAccount(std::string username, std::string pass if (utf8length(username) > MAX_ACCOUNT_STR) return AccountOpResult::AOR_NAME_TOO_LONG; // username's too long + if (utf8length(password) > MAX_PASS_STR) + return AccountOpResult::AOR_PASS_TOO_LONG; // password's too long + Utf8ToUpperOnlyLatin(username); Utf8ToUpperOnlyLatin(password); Utf8ToUpperOnlyLatin(email); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 616cd721cd..a4973a8a16 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -863,7 +863,7 @@ enum TrinityStrings LANG_ACCOUNT_NOT_DELETED_SQL_ERROR = 1002, LANG_ACCOUNT_NOT_DELETED = 1003, LANG_ACCOUNT_CREATED = 1004, - LANG_ACCOUNT_TOO_LONG = 1005, + LANG_ACCOUNT_NAME_TOO_LONG = 1005, LANG_ACCOUNT_ALREADY_EXIST = 1006, LANG_ACCOUNT_NOT_CREATED_SQL_ERROR = 1007, LANG_ACCOUNT_NOT_CREATED = 1008, @@ -889,7 +889,8 @@ enum TrinityStrings LANG_SQLDRIVER_QUERY_LOGGING_DISABLED = 1028, LANG_ACCOUNT_INVALID_BNET_NAME = 1029, // 6.x ONLY LANG_ACCOUNT_USE_BNET_COMMANDS = 1030, // 6.x enum value name but different text in DB - // Room for more level 4 1031-1099 not used + LANG_ACCOUNT_PASS_TOO_LONG = 1031, + // Room for more level 4 1032-1099 not used // Level 3 (continue) LANG_ACCOUNT_SETADDON = 1100, diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 80a0a0d996..e8cae69e18 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -141,7 +141,11 @@ public: } break; case AccountOpResult::AOR_NAME_TOO_LONG: - handler->SendSysMessage(LANG_ACCOUNT_TOO_LONG); + handler->SendSysMessage(LANG_ACCOUNT_NAME_TOO_LONG); + handler->SetSentErrorMessage(true); + return false; + case AccountOpResult::AOR_PASS_TOO_LONG: + handler->SendSysMessage(LANG_ACCOUNT_PASS_TOO_LONG); handler->SetSentErrorMessage(true); return false; case AccountOpResult::AOR_NAME_ALREADY_EXIST: