aboutsummaryrefslogtreecommitdiff
path: root/src/server/database
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-12-18 12:35:27 +0100
committerShauren <shauren.trinity@gmail.com>2016-12-18 12:35:27 +0100
commitb633d61899bbbd723d4c0b2cbc850d5b686be46c (patch)
treed7a79b34779399be1ab823d39572500794038cb8 /src/server/database
parentbc758991140e961ceac46b17b766b0d54b8129fb (diff)
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
Diffstat (limited to 'src/server/database')
-rw-r--r--src/server/database/Database/Implementation/LoginDatabase.cpp1
-rw-r--r--src/server/database/Database/Implementation/LoginDatabase.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/server/database/Database/Implementation/LoginDatabase.cpp b/src/server/database/Database/Implementation/LoginDatabase.cpp
index 083bdb383f1..0c989ab401b 100644
--- a/src/server/database/Database/Implementation/LoginDatabase.cpp
+++ b/src/server/database/Database/Implementation/LoginDatabase.cpp
@@ -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);
diff --git a/src/server/database/Database/Implementation/LoginDatabase.h b/src/server/database/Database/Implementation/LoginDatabase.h
index bddb119544e..bc95b3c273d 100644
--- a/src/server/database/Database/Implementation/LoginDatabase.h
+++ b/src/server/database/Database/Implementation/LoginDatabase.h
@@ -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,