Core\Command: remove account_muted data on account deletion

(cherry picked from commit 6a87524204)

# Conflicts:
#	src/server/database/Database/Implementation/LoginDatabase.cpp
#	src/server/database/Database/Implementation/LoginDatabase.h
This commit is contained in:
ForesterDev
2016-08-04 17:24:41 +04:00
committed by jackpoz
parent b71a3c2766
commit 6147ba6156
3 changed files with 6 additions and 0 deletions

View File

@@ -113,6 +113,7 @@ void LoginDatabaseConnection::DoPrepareStatements()
PrepareStatement(LOGIN_INS_ACCOUNT_MUTE, "INSERT INTO account_muted VALUES (?, UNIX_TIMESTAMP(), ?, ?, ?)", CONNECTION_ASYNC);
PrepareStatement(LOGIN_SEL_ACCOUNT_MUTE_INFO, "SELECT mutedate, mutetime, mutereason, mutedby FROM account_muted WHERE guid = ? ORDER BY mutedate ASC", CONNECTION_SYNCH);
PrepareStatement(LOGIN_DEL_ACCOUNT_MUTED, "DELETE FROM account_muted WHERE guid = ?", CONNECTION_ASYNC);
#define BnetAccountInfo "ba.id, UPPER(ba.email), ba.locked, ba.lock_country, ba.last_ip, ba.failed_logins, bab.unbandate > UNIX_TIMESTAMP() OR bab.unbandate = bab.bandate, bab.unbandate = bab.bandate"
#define BnetGameAccountInfo "a.id, a.username, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, ab.unbandate = ab.bandate, aa.gmlevel"

View File

@@ -109,6 +109,7 @@ enum LoginDatabaseStatements
LOGIN_INS_ACCOUNT_MUTE,
LOGIN_SEL_ACCOUNT_MUTE_INFO,
LOGIN_DEL_ACCOUNT_MUTED,
LOGIN_SEL_BNET_ACCOUNT_INFO,
LOGIN_UPD_BNET_LAST_LOGIN_INFO,

View File

@@ -142,6 +142,10 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accountId)
stmt->setUInt32(0, accountId);
trans->Append(stmt);
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_MUTED);
stmt->setUInt32(0, accountId);
trans->Append(stmt);
LoginDatabase.CommitTransaction(trans);
return AccountOpResult::AOR_OK;