aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2017_02_12_00_world_2016_08_11_00_world.sql3
-rw-r--r--src/server/game/Accounts/AccountMgr.cpp3
-rw-r--r--src/server/game/Accounts/BattlenetAccountMgr.cpp2
-rw-r--r--src/server/game/Miscellaneous/Language.h2
-rw-r--r--src/server/scripts/Commands/cs_account.cpp6
-rw-r--r--src/server/scripts/Commands/cs_battlenet_account.cpp16
6 files changed, 23 insertions, 9 deletions
diff --git a/sql/updates/world/master/2017_02_12_00_world_2016_08_11_00_world.sql b/sql/updates/world/master/2017_02_12_00_world_2016_08_11_00_world.sql
new file mode 100644
index 00000000000..02f0f13005e
--- /dev/null
+++ b/sql/updates/world/master/2017_02_12_00_world_2016_08_11_00_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 9b136c34eb7..690b4c3f351 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/Accounts/BattlenetAccountMgr.cpp b/src/server/game/Accounts/BattlenetAccountMgr.cpp
index d304c30d9cc..3909de055e7 100644
--- a/src/server/game/Accounts/BattlenetAccountMgr.cpp
+++ b/src/server/game/Accounts/BattlenetAccountMgr.cpp
@@ -35,7 +35,7 @@ AccountOpResult Battlenet::AccountMgr::CreateBattlenetAccount(std::string email,
Utf8ToUpperOnlyLatin(password);
if (GetId(email))
- return AccountOpResult::AOR_NAME_ALREADY_EXIST;
+ return AccountOpResult::AOR_NAME_ALREADY_EXIST;
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_BNET_ACCOUNT);
stmt->setString(0, email);
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 148d7affc63..1317373b2f9 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -873,7 +873,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,
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 40278cb856e..72c571ae007 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:
diff --git a/src/server/scripts/Commands/cs_battlenet_account.cpp b/src/server/scripts/Commands/cs_battlenet_account.cpp
index 3014d86ae34..5a19ef48dca 100644
--- a/src/server/scripts/Commands/cs_battlenet_account.cpp
+++ b/src/server/scripts/Commands/cs_battlenet_account.cpp
@@ -105,15 +105,15 @@ 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_NAME_ALREADY_EXIST:
- handler->SendSysMessage(LANG_ACCOUNT_ALREADY_EXIST);
+ case AccountOpResult::AOR_PASS_TOO_LONG:
+ handler->SendSysMessage(LANG_ACCOUNT_PASS_TOO_LONG);
handler->SetSentErrorMessage(true);
return false;
- case AccountOpResult::AOR_PASS_TOO_LONG:
- handler->SendSysMessage(LANG_PASSWORD_TOO_LONG);
+ case AccountOpResult::AOR_NAME_ALREADY_EXIST:
+ handler->SendSysMessage(LANG_ACCOUNT_ALREADY_EXIST);
handler->SetSentErrorMessage(true);
return false;
default:
@@ -442,7 +442,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: