aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Accounts/AccountMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Accounts/AccountMgr.cpp')
-rw-r--r--src/server/game/Accounts/AccountMgr.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp
index 773e169e5c2..ff30fe7ba35 100644
--- a/src/server/game/Accounts/AccountMgr.cpp
+++ b/src/server/game/Accounts/AccountMgr.cpp
@@ -21,6 +21,7 @@
#include "DatabaseEnv.h"
#include "ObjectAccessor.h"
#include "Player.h"
+#include "ScriptMgr.h"
#include "Util.h"
#include "SHA1.h"
#include "WorldSession.h"
@@ -166,10 +167,16 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accountId, std::string newPass
std::string username;
if (!GetName(accountId, username))
+ {
+ sScriptMgr->OnFailedPasswordChange(accountId);
return AOR_NAME_NOT_EXIST; // account doesn't exist
+ }
if (utf8length(newPassword) > MAX_ACCOUNT_STR)
+ {
+ sScriptMgr->OnFailedPasswordChange(accountId);
return AOR_PASS_TOO_LONG;
+ }
normalizeString(username);
normalizeString(newPassword);
@@ -189,6 +196,7 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accountId, std::string newPass
LoginDatabase.Execute(stmt);
+ sScriptMgr->OnPasswordChange(accountId);
return AOR_OK;
}
@@ -197,10 +205,16 @@ AccountOpResult AccountMgr::ChangeEmail(uint32 accountId, std::string newEmail)
std::string username;
if (!GetName(accountId, username))
+ {
+ sScriptMgr->OnFailedEmailChange(accountId);
return AOR_NAME_NOT_EXIST; // account doesn't exist
+ }
if (utf8length(newEmail) > MAX_EMAIL_STR)
+ {
+ sScriptMgr->OnFailedEmailChange(accountId);
return AOR_EMAIL_TOO_LONG;
+ }
normalizeString(username);
normalizeString(newEmail);
@@ -212,6 +226,7 @@ AccountOpResult AccountMgr::ChangeEmail(uint32 accountId, std::string newEmail)
LoginDatabase.Execute(stmt);
+ sScriptMgr->OnEmailChange(accountId);
return AOR_OK;
}
@@ -220,10 +235,16 @@ AccountOpResult AccountMgr::ChangeRegEmail(uint32 accountId, std::string newEmai
std::string username;
if (!GetName(accountId, username))
+ {
+ sScriptMgr->OnFailedEmailChange(accountId);
return AOR_NAME_NOT_EXIST; // account doesn't exist
+ }
if (utf8length(newEmail) > MAX_EMAIL_STR)
+ {
+ sScriptMgr->OnFailedEmailChange(accountId);
return AOR_EMAIL_TOO_LONG;
+ }
normalizeString(username);
normalizeString(newEmail);
@@ -235,6 +256,7 @@ AccountOpResult AccountMgr::ChangeRegEmail(uint32 accountId, std::string newEmai
LoginDatabase.Execute(stmt);
+ sScriptMgr->OnEmailChange(accountId);
return AOR_OK;
}