parent
16f220253a
commit
5b8bc792b8
4 changed files with 14 additions and 0 deletions
|
|
@ -68,6 +68,8 @@ namespace AccountMgr
|
|||
if (!result)
|
||||
return AOR_NAME_NOT_EXIST;
|
||||
|
||||
sScriptMgr->OnBeforeAccountDelete(accountId);
|
||||
|
||||
// Obtain accounts characters
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARS_BY_ACCOUNT_ID);
|
||||
stmt->SetData(0, accountId);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,14 @@ void ScriptMgr::OnAccountLogin(uint32 accountId)
|
|||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnBeforeAccountDelete(uint32 accountId)
|
||||
{
|
||||
ExecuteScript<AccountScript>([&](AccountScript* script)
|
||||
{
|
||||
script->OnBeforeAccountDelete(accountId);
|
||||
});
|
||||
}
|
||||
|
||||
//void ScriptMgr::OnAccountLogout(uint32 accountId)
|
||||
//{
|
||||
// ExecuteScript<AccountScript>([&](AccountScript* script)
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ public:
|
|||
// Called when an account logged in successfully
|
||||
virtual void OnAccountLogin(uint32 /*accountId*/) { }
|
||||
|
||||
// Called when an account is about to be deleted
|
||||
virtual void OnBeforeAccountDelete(uint32 /*accountId*/) { }
|
||||
|
||||
// Called when an ip logged in successfully
|
||||
virtual void OnLastIpUpdate(uint32 /*accountId*/, std::string /*ip*/) { }
|
||||
|
||||
|
|
|
|||
|
|
@ -469,6 +469,7 @@ public: /* PlayerScript */
|
|||
|
||||
public: /* AccountScript */
|
||||
void OnAccountLogin(uint32 accountId);
|
||||
void OnBeforeAccountDelete(uint32 accountId);
|
||||
void OnLastIpUpdate(uint32 accountId, std::string ip);
|
||||
void OnFailedAccountLogin(uint32 accountId);
|
||||
void OnEmailChange(uint32 accountId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue