diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-06-23 23:47:48 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-06-23 23:47:48 +0200 |
commit | d8234bed420728aaa2e0f329778730a906f7dd12 (patch) | |
tree | be30b4b452967bed923c106971c35014ab4c9412 /src/server/game/Accounts/AccountMgr.cpp | |
parent | 9bac986f35067941552b7dec8da81eac127d2f66 (diff) | |
parent | aa93a975469cca56e35adc1b5b501f4536be61f1 (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Accounts/AccountMgr.cpp
src/server/game/Entities/Player/Player.h
src/server/game/Server/WorldSocket.cpp
src/server/game/World/World.cpp
Diffstat (limited to 'src/server/game/Accounts/AccountMgr.cpp')
-rw-r--r-- | src/server/game/Accounts/AccountMgr.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 59a8f046a6b..c7437909f05 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 AccountOpResult::AOR_NAME_NOT_EXIST; // account doesn't exist + } if (utf8length(newPassword) > MAX_ACCOUNT_STR) + { + sScriptMgr->OnFailedPasswordChange(accountId); return AccountOpResult::AOR_PASS_TOO_LONG; + } Utf8ToUpperOnlyLatin(username); Utf8ToUpperOnlyLatin(newPassword); @@ -189,6 +196,7 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accountId, std::string newPass LoginDatabase.Execute(stmt); + sScriptMgr->OnPasswordChange(accountId); return AccountOpResult::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 AccountOpResult::AOR_NAME_NOT_EXIST; // account doesn't exist + } if (utf8length(newEmail) > MAX_EMAIL_STR) + { + sScriptMgr->OnFailedEmailChange(accountId); return AccountOpResult::AOR_EMAIL_TOO_LONG; + } Utf8ToUpperOnlyLatin(username); Utf8ToUpperOnlyLatin(newEmail); @@ -212,6 +226,7 @@ AccountOpResult AccountMgr::ChangeEmail(uint32 accountId, std::string newEmail) LoginDatabase.Execute(stmt); + sScriptMgr->OnEmailChange(accountId); return AccountOpResult::AOR_OK; } @@ -223,7 +238,10 @@ AccountOpResult AccountMgr::ChangeRegEmail(uint32 accountId, std::string newEmai return AccountOpResult::AOR_NAME_NOT_EXIST; // account doesn't exist if (utf8length(newEmail) > MAX_EMAIL_STR) + { + sScriptMgr->OnFailedEmailChange(accountId); return AccountOpResult::AOR_EMAIL_TOO_LONG; + } Utf8ToUpperOnlyLatin(username); Utf8ToUpperOnlyLatin(newEmail); @@ -235,6 +253,7 @@ AccountOpResult AccountMgr::ChangeRegEmail(uint32 accountId, std::string newEmai LoginDatabase.Execute(stmt); + sScriptMgr->OnEmailChange(accountId); return AccountOpResult::AOR_OK; } |