From 6949735098144e478451e73179ca2d9c6e7344f7 Mon Sep 17 00:00:00 2001 From: Ascathor Date: Fri, 2 May 2014 03:44:21 +0200 Subject: 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 --- src/server/game/Scripting/ScriptMgr.cpp | 48 +++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'src/server/game/Scripting/ScriptMgr.cpp') diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 94cf1047dfb..505539eea20 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -224,6 +224,7 @@ void ScriptMgr::Unload() SCR_CLEAR(TransportScript); SCR_CLEAR(AchievementCriteriaScript); SCR_CLEAR(PlayerScript); + SCR_CLEAR(AccountScript); SCR_CLEAR(GuildScript); SCR_CLEAR(GroupScript); SCR_CLEAR(UnitScript); @@ -1257,9 +1258,14 @@ void ScriptMgr::OnPlayerCreate(Player* player) FOREACH_SCRIPT(PlayerScript)->OnCreate(player); } -void ScriptMgr::OnPlayerDelete(uint64 guid) +void ScriptMgr::OnPlayerDelete(uint64 guid, uint32 accountId) { - FOREACH_SCRIPT(PlayerScript)->OnDelete(guid); + FOREACH_SCRIPT(PlayerScript)->OnDelete(guid, accountId); +} + +void ScriptMgr::OnPlayerFailedDelete(uint64 guid, uint32 accountId) +{ + FOREACH_SCRIPT(PlayerScript)->OnFailedDelete(guid, accountId); } void ScriptMgr::OnPlayerSave(Player* player) @@ -1277,6 +1283,37 @@ void ScriptMgr::OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newAre FOREACH_SCRIPT(PlayerScript)->OnUpdateZone(player, newZone, newArea); } +// Account +void ScriptMgr::OnAccountLogin(uint32 accountId) +{ + FOREACH_SCRIPT(AccountScript)->OnAccountLogin(accountId); +} + +void ScriptMgr::OnFailedAccountLogin(uint32 accountId) +{ + FOREACH_SCRIPT(AccountScript)->OnFailedAccountLogin(accountId); +} + +void ScriptMgr::OnEmailChange(uint32 accountId) +{ + FOREACH_SCRIPT(AccountScript)->OnEmailChange(accountId); +} + +void ScriptMgr::OnFailedEmailChange(uint32 accountId) +{ + FOREACH_SCRIPT(AccountScript)->OnFailedEmailChange(accountId); +} + +void ScriptMgr::OnPasswordChange(uint32 accountId) +{ + FOREACH_SCRIPT(AccountScript)->OnPasswordChange(accountId); +} + +void ScriptMgr::OnFailedPasswordChange(uint32 accountId) +{ + FOREACH_SCRIPT(AccountScript)->OnFailedPasswordChange(accountId); +} + // Guild void ScriptMgr::OnGuildAddMember(Guild* guild, Player* player, uint8& plRank) { @@ -1539,6 +1576,12 @@ PlayerScript::PlayerScript(const char* name) ScriptRegistry::AddScript(this); } +AccountScript::AccountScript(const char* name) + : ScriptObject(name) +{ + ScriptRegistry::AddScript(this); +} + GuildScript::GuildScript(const char* name) : ScriptObject(name) { @@ -1581,6 +1624,7 @@ template class ScriptRegistry; template class ScriptRegistry; template class ScriptRegistry; template class ScriptRegistry; +template class ScriptRegistry; // Undefine utility macros. #undef GET_SCRIPT_RET -- cgit v1.2.3