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
This commit is contained in:
Ascathor
2014-05-02 03:44:21 +02:00
parent 5804372042
commit 6949735098
23 changed files with 618 additions and 52 deletions

View File

@@ -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<PlayerScript>::AddScript(this);
}
AccountScript::AccountScript(const char* name)
: ScriptObject(name)
{
ScriptRegistry<AccountScript>::AddScript(this);
}
GuildScript::GuildScript(const char* name)
: ScriptObject(name)
{
@@ -1581,6 +1624,7 @@ template class ScriptRegistry<PlayerScript>;
template class ScriptRegistry<GuildScript>;
template class ScriptRegistry<GroupScript>;
template class ScriptRegistry<UnitScript>;
template class ScriptRegistry<AccountScript>;
// Undefine utility macros.
#undef GET_SCRIPT_RET