mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
feat(Core/Hooks): OnLastIpUpdate(accountId, ip) (#4913)
This commit is contained in:
@@ -1761,6 +1761,11 @@ void ScriptMgr::OnAccountLogin(uint32 accountId)
|
||||
FOREACH_SCRIPT(AccountScript)->OnAccountLogin(accountId);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnLastIpUpdate(uint32 accountId, std::string ip)
|
||||
{
|
||||
FOREACH_SCRIPT(AccountScript)->OnLastIpUpdate(accountId, ip);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnFailedAccountLogin(uint32 accountId)
|
||||
{
|
||||
FOREACH_SCRIPT(AccountScript)->OnFailedAccountLogin(accountId);
|
||||
|
||||
@@ -967,6 +967,9 @@ public:
|
||||
// Called when an account logged in successfully
|
||||
virtual void OnAccountLogin(uint32 /*accountId*/) { }
|
||||
|
||||
// Called when an ip logged in successfully
|
||||
virtual void OnLastIpUpdate(uint32 /*accountId*/, std::string /*ip*/) { }
|
||||
|
||||
// Called when an account login failed
|
||||
virtual void OnFailedAccountLogin(uint32 /*accountId*/) { }
|
||||
|
||||
@@ -1412,6 +1415,7 @@ public: /* PlayerScript */
|
||||
|
||||
public: /* AccountScript */
|
||||
void OnAccountLogin(uint32 accountId);
|
||||
void OnLastIpUpdate(uint32 accountId, std::string ip);
|
||||
void OnFailedAccountLogin(uint32 accountId);
|
||||
void OnEmailChange(uint32 accountId);
|
||||
void OnFailedEmailChange(uint32 accountId);
|
||||
|
||||
@@ -979,6 +979,8 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
||||
|
||||
LoginDatabase.Execute(stmt);
|
||||
|
||||
sScriptMgr->OnLastIpUpdate(id, address);
|
||||
|
||||
// NOTE ATM the socket is single-threaded, have this in mind ...
|
||||
ACE_NEW_RETURN(m_Session, WorldSession(id, this, AccountTypes(security), expansion, mutetime, locale, recruiter, isRecruiter, skipQueue, TotalTime), -1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user