diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Accounts/AccountMgr.cpp | 3 | ||||
| -rw-r--r-- | src/server/game/Miscellaneous/Language.h | 5 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_account.cpp | 6 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 6269b968852..c4e74995c57 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 ef5779bb64c..187c442667b 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -865,7 +865,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, @@ -891,7 +891,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 4bce2d168a9..487d2a48d0f 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: |
