aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Accounts/AccountMgr.cpp
diff options
context:
space:
mode:
authorAscathor <Break_the_Chain@web.de>2014-05-02 03:44:21 +0200
committerAscathor <Break_the_Chain@web.de>2014-06-13 16:25:11 +0200
commit6949735098144e478451e73179ca2d9c6e7344f7 (patch)
tree083b22ce75e2a5b40f6623c18feb74e8dd448063 /src/server/game/Accounts/AccountMgr.cpp
parent58043720420a0f59e95a5e7d226fec3ee98ebfa4 (diff)
Core/Misc:
* Fix some codestyle, fix some typos * Change CMakeLists for: Custom (can be uncommented), Events, World ** Custom is theoretically unchanged. You can, however, uncomment the glob_recurse that initializes every file within. This might be easier for beginners. * Introducing the IP Based Action Log System: ** On several different actions, e.g. Login, Character Login, etc., a new entry is added ** Can be logged on and off in worldserver config *** Disabled by default to prevent increased log db size for unknowing users. * Add a new row to account table called 'last_attempt_ip' ** Lists the last ip trying to connect to the account * Add a new type of HookScripts: AccountScript ** Includes: OnAccountLogin, OnFailedAccountLogin, OnEmailChange, OnFailedChange, OnPasswordChange, OnFailedPasswordChange * Added new Hook to PlayerScripts: OnFailedPlayerDelete * Added new variables to PlayerScripts: OnPlayerDelete
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;
}