Core/Accounts: Delete all bans related to an account when it has been deleted.

This commit is contained in:
kaelima
2012-05-06 02:37:31 +02:00
parent 072bab6951
commit f34e650fe0
5 changed files with 13 additions and 1 deletions
+9
View File
@@ -91,10 +91,15 @@ AccountOpResult DeleteAccount(uint32 accountId)
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_TUTORIALS);
stmt->setUInt32(0, accountId);
CharacterDatabase.Execute(stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ACCOUNT_DATA);
stmt->setUInt32(0, accountId);
CharacterDatabase.Execute(stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_BAN);
stmt->setUInt32(0, accountId);
CharacterDatabase.Execute(stmt);
SQLTransaction trans = LoginDatabase.BeginTransaction();
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT);
@@ -109,6 +114,10 @@ AccountOpResult DeleteAccount(uint32 accountId)
stmt->setUInt32(0, accountId);
trans->Append(stmt);
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_BANNED);
stmt->setUInt32(0, accountId);
trans->Append(stmt);
LoginDatabase.CommitTransaction(trans);
return AOR_OK;