Core/Commands: Added new 'bnetaccount listgameaccounts' command to display all account table entries linked to a given battle.net email

* Also fixed errors about bad commands in db

Closes #18474
This commit is contained in:
Shauren
2016-12-18 12:35:27 +01:00
parent bc75899114
commit b633d61899
8 changed files with 70 additions and 12 deletions

View File

@@ -138,6 +138,7 @@ void LoginDatabaseConnection::DoPrepareStatements()
PrepareStatement(LOGIN_SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT, "SELECT battlenet_account FROM account WHERE id = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_UPD_BNET_GAME_ACCOUNT_LINK, "UPDATE account SET battlenet_account = ?, battlenet_index = ? WHERE id = ?", CONNECTION_ASYNC);
PrepareStatement(LOGIN_SEL_BNET_MAX_ACCOUNT_INDEX, "SELECT MAX(battlenet_index) FROM account WHERE battlenet_account = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_BNET_GAME_ACCOUNT_LIST, "SELECT a.id, a.username FROM account a LEFT JOIN battlenet_accounts ba ON a.battlenet_account = ba.id WHERE ba.email = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_UPD_BNET_FAILED_LOGINS, "UPDATE battlenet_accounts SET failed_logins = failed_logins + 1 WHERE id = ?", CONNECTION_ASYNC);
PrepareStatement(LOGIN_INS_BNET_ACCOUNT_AUTO_BANNED, "INSERT INTO battlenet_account_bans(id, bandate, unbandate, bannedby, banreason) VALUES(?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity Auth', 'Failed login autoban')", CONNECTION_ASYNC);

View File

@@ -129,6 +129,7 @@ enum LoginDatabaseStatements
LOGIN_SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT,
LOGIN_UPD_BNET_GAME_ACCOUNT_LINK,
LOGIN_SEL_BNET_MAX_ACCOUNT_INDEX,
LOGIN_SEL_BNET_GAME_ACCOUNT_LIST,
LOGIN_UPD_BNET_FAILED_LOGINS,
LOGIN_INS_BNET_ACCOUNT_AUTO_BANNED,