aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2019-07-27 01:00:37 +0200
committerShauren <shauren.trinity@gmail.com>2019-07-27 01:00:37 +0200
commite8e89f58fb800014f53341f12505f60ee2b5fb6f (patch)
tree2b63800163e2026be75621a36ddf1218bdbf9dab /src/server/scripts/Commands
parent1dcbceba81002ba6ff83129d403763df398f9736 (diff)
Core/DBLayer: Prevent using prepared statements on wrong database
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_account.cpp20
-rw-r--r--src/server/scripts/Commands/cs_ban.cpp12
-rw-r--r--src/server/scripts/Commands/cs_battlenet_account.cpp8
-rw-r--r--src/server/scripts/Commands/cs_character.cpp26
-rw-r--r--src/server/scripts/Commands/cs_disable.cpp4
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp2
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp2
-rw-r--r--src/server/scripts/Commands/cs_group.cpp2
-rw-r--r--src/server/scripts/Commands/cs_lfg.cpp2
-rw-r--r--src/server/scripts/Commands/cs_list.cpp4
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp8
-rw-r--r--src/server/scripts/Commands/cs_message.cpp4
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp44
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp16
-rw-r--r--src/server/scripts/Commands/cs_quest.cpp2
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp2
-rw-r--r--src/server/scripts/Commands/cs_reset.cpp6
-rw-r--r--src/server/scripts/Commands/cs_tele.cpp2
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp14
19 files changed, 89 insertions, 91 deletions
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index f162b6465be..1630e91f6a6 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -98,7 +98,7 @@ public:
return false;
}
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
stmt->setUInt8(0, uint8(expansion));
stmt->setUInt32(1, accountId);
@@ -232,9 +232,7 @@ public:
static bool HandleAccountOnlineListCommand(ChatHandler* handler, char const* /*args*/)
{
///- Get the list of accounts ID logged to the realm
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ONLINE);
-
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
+ PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ONLINE));
if (!result)
{
@@ -256,7 +254,7 @@ public:
///- Get the username, last IP and GM level of each account
// No SQL injection. account is uint32.
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO);
stmt->setUInt32(0, account);
PreparedQueryResult resultLogin = LoginDatabase.Query(stmt);
@@ -293,7 +291,7 @@ public:
{
if (IpLocationRecord const* location = sIPLocation->GetLocationRecord(handler->GetSession()->GetRemoteAddress()))
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK_COUNTRY);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK_COUNTRY);
stmt->setString(0, location->CountryCode);
stmt->setUInt32(1, handler->GetSession()->GetAccountId());
LoginDatabase.Execute(stmt);
@@ -307,7 +305,7 @@ public:
}
else if (param == "off")
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK_COUNTRY);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK_COUNTRY);
stmt->setString(0, "00");
stmt->setUInt32(1, handler->GetSession()->GetAccountId());
LoginDatabase.Execute(stmt);
@@ -333,7 +331,7 @@ public:
if (!param.empty())
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK);
if (param == "on")
{
@@ -560,7 +558,7 @@ public:
std::string emailoutput;
uint32 accountId = handler->GetSession()->GetAccountId();
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_EMAIL_BY_ID);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_EMAIL_BY_ID);
stmt->setUInt32(0, accountId);
PreparedQueryResult result = LoginDatabase.Query(stmt);
@@ -627,7 +625,7 @@ public:
if (expansion > sWorld->getIntConfig(CONFIG_EXPANSION))
return false;
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION);
stmt->setUInt8(0, expansion);
stmt->setUInt32(1, accountId);
@@ -710,7 +708,7 @@ public:
// Check and abort if the target gm has a higher rank on one of the realms and the new realm is -1
if (gmRealmID == -1 && !AccountMgr::IsConsoleAccount(playerSecurity))
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST);
stmt->setUInt32(0, targetAccountId);
stmt->setUInt8(1, uint8(gm));
diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp
index 6ecd3072298..52816ecf3f6 100644
--- a/src/server/scripts/Commands/cs_ban.cpp
+++ b/src/server/scripts/Commands/cs_ban.cpp
@@ -325,7 +325,7 @@ public:
else
targetGuid = target->GetGUID();
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO);
stmt->setUInt64(0, targetGuid.GetCounter());
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
@@ -386,7 +386,7 @@ public:
static bool HandleBanListAccountCommand(ChatHandler* handler, char const* args)
{
- PreparedStatement* stmt = NULL;
+ LoginDatabasePreparedStatement* stmt = NULL;
stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
LoginDatabase.Execute(stmt);
@@ -508,7 +508,7 @@ public:
return false;
std::string filter(filterStr);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME_FILTER);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME_FILTER);
stmt->setString(0, filter);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
@@ -525,7 +525,7 @@ public:
do
{
Field* fields = result->Fetch();
- PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME);
+ CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME);
stmt2->setUInt64(0, fields[0].GetUInt64());
PreparedQueryResult banResult = CharacterDatabase.Query(stmt2);
if (banResult)
@@ -547,7 +547,7 @@ public:
std::string char_name = fields[1].GetString();
- PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO_LIST);
+ CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO_LIST);
stmt2->setUInt64(0, fields[0].GetUInt64());
PreparedQueryResult banInfo = CharacterDatabase.Query(stmt2);
if (banInfo)
@@ -588,7 +588,7 @@ public:
static bool HandleBanListIPCommand(ChatHandler* handler, char const* args)
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
LoginDatabase.Execute(stmt);
char* filterStr = strtok((char*)args, " ");
diff --git a/src/server/scripts/Commands/cs_battlenet_account.cpp b/src/server/scripts/Commands/cs_battlenet_account.cpp
index c801770dc8d..906ac9698dc 100644
--- a/src/server/scripts/Commands/cs_battlenet_account.cpp
+++ b/src/server/scripts/Commands/cs_battlenet_account.cpp
@@ -146,7 +146,7 @@ public:
{
if (IpLocationRecord const* location = sIPLocation->GetLocationRecord(handler->GetSession()->GetRemoteAddress()))
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK_CONTRY);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK_CONTRY);
stmt->setString(0, location->CountryCode);
stmt->setUInt32(1, handler->GetSession()->GetBattlenetAccountId());
LoginDatabase.Execute(stmt);
@@ -160,7 +160,7 @@ public:
}
else if (param == "off")
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK_CONTRY);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK_CONTRY);
stmt->setString(0, "00");
stmt->setUInt32(1, handler->GetSession()->GetBattlenetAccountId());
LoginDatabase.Execute(stmt);
@@ -188,7 +188,7 @@ public:
if (!param.empty())
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_BNET_ACCOUNT_LOCK);
if (param == "on")
{
@@ -471,7 +471,7 @@ public:
return false;
char* battlenetAccountName = strtok((char*)args, " ");
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_GAME_ACCOUNT_LIST_SMALL);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BNET_GAME_ACCOUNT_LIST_SMALL);
stmt->setString(0, battlenetAccountName);
if (PreparedQueryResult accountList = LoginDatabase.Query(stmt))
{
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
index 800d5b4a4af..988d29bb5e2 100644
--- a/src/server/scripts/Commands/cs_character.cpp
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -102,7 +102,7 @@ public:
static bool GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString)
{
PreparedQueryResult result;
- PreparedStatement* stmt;
+ CharacterDatabasePreparedStatement* stmt;
if (!searchString.empty())
{
// search by GUID
@@ -221,7 +221,7 @@ public:
return;
}
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_RESTORE_DELETE_INFO);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_RESTORE_DELETE_INFO);
stmt->setString(0, delInfo.name);
stmt->setUInt32(1, delInfo.accountId);
stmt->setUInt64(2, delInfo.guid.GetCounter());
@@ -251,7 +251,7 @@ public:
else
{
// Update level and reset XP, everything else will be updated at login
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
stmt->setUInt8(0, uint8(newLevel));
stmt->setUInt64(1, playerGuid.GetCounter());
CharacterDatabase.Execute(stmt);
@@ -356,7 +356,7 @@ public:
}
}
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
stmt->setString(0, newName);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (result)
@@ -418,7 +418,7 @@ public:
std::string oldNameLink = handler->playerLink(targetName);
handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), targetGuid.ToString().c_str());
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
stmt->setUInt64(1, targetGuid.GetCounter());
CharacterDatabase.Execute(stmt);
@@ -477,7 +477,7 @@ public:
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE));
if (target)
{
@@ -505,7 +505,7 @@ public:
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION));
if (target)
{
@@ -532,7 +532,7 @@ public:
if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE));
if (target)
{
@@ -585,7 +585,7 @@ public:
return false;
}
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
stmt->setString(0, accountName);
if (PreparedQueryResult result = LoginDatabase.Query(stmt))
newAccountId = (*result)[0].GetUInt32();
@@ -610,10 +610,10 @@ public:
}
}
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_BY_GUID);
- stmt->setUInt32(0, newAccountId);
- stmt->setUInt32(1, targetGuid.GetCounter());
- CharacterDatabase.DirectExecute(stmt);
+ CharacterDatabasePreparedStatement* charStmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_BY_GUID);
+ charStmt->setUInt32(0, newAccountId);
+ charStmt->setUInt32(1, targetGuid.GetCounter());
+ CharacterDatabase.DirectExecute(charStmt);
sWorld->UpdateRealmCharCount(oldAccountId);
sWorld->UpdateRealmCharCount(newAccountId);
diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp
index bd83b1d92f9..fa80b4fcb63 100644
--- a/src/server/scripts/Commands/cs_disable.cpp
+++ b/src/server/scripts/Commands/cs_disable.cpp
@@ -188,7 +188,7 @@ public:
break;
}
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
stmt->setUInt32(0, entry);
stmt->setUInt8(1, disableType);
PreparedQueryResult result = WorldDatabase.Query(stmt);
@@ -313,7 +313,7 @@ public:
break;
}
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES);
stmt->setUInt32(0, entry);
stmt->setUInt8(1, disableType);
PreparedQueryResult result = WorldDatabase.Query(stmt);
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index 4e1ff6c18d4..5d16e926ab3 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -170,7 +170,7 @@ public:
static bool HandleGMListFullCommand(ChatHandler* handler, char const* /*args*/)
{
///- Get the accounts with GM Level >0
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_GM_ACCOUNTS);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_GM_ACCOUNTS);
stmt->setUInt8(0, uint8(SEC_MODERATOR));
stmt->setInt32(1, int32(realm.Id.Realm));
PreparedQueryResult result = LoginDatabase.Query(stmt);
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index 3293c6cb9d7..d432beb9c06 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -538,7 +538,7 @@ public:
Player* player = handler->GetSession()->GetPlayer();
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_GAMEOBJECT_NEAREST);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_GAMEOBJECT_NEAREST);
stmt->setFloat(0, player->GetPositionX());
stmt->setFloat(1, player->GetPositionY());
stmt->setFloat(2, player->GetPositionZ());
diff --git a/src/server/scripts/Commands/cs_group.cpp b/src/server/scripts/Commands/cs_group.cpp
index 3300efaafdd..a691eee7d28 100644
--- a/src/server/scripts/Commands/cs_group.cpp
+++ b/src/server/scripts/Commands/cs_group.cpp
@@ -297,7 +297,7 @@ public:
// If not, we extract it from the SQL.
if (!groupTarget)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
stmt->setUInt64(0, guidTarget.GetCounter());
PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt);
if (resultGroup)
diff --git a/src/server/scripts/Commands/cs_lfg.cpp b/src/server/scripts/Commands/cs_lfg.cpp
index 4ff73e0d61b..1913309df56 100644
--- a/src/server/scripts/Commands/cs_lfg.cpp
+++ b/src/server/scripts/Commands/cs_lfg.cpp
@@ -98,7 +98,7 @@ public:
groupTarget = playerTarget->GetGroup();
else
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER);
stmt->setUInt64(0, guidTarget.GetCounter());
PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt);
if (resultGroup)
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp
index c256fbc6f2e..f7f982065ec 100644
--- a/src/server/scripts/Commands/cs_list.cpp
+++ b/src/server/scripts/Commands/cs_list.cpp
@@ -166,7 +166,7 @@ public:
// inventory case
uint32 inventoryCount = 0;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM);
stmt->setUInt32(0, itemId);
result = CharacterDatabase.Query(stmt);
@@ -473,7 +473,7 @@ public:
Player* target;
ObjectGuid targetGuid;
std::string targetName;
- PreparedStatement* stmt = NULL;
+ CharacterDatabasePreparedStatement* stmt = NULL;
if (!*args)
return false;
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index c9a8a70127b..d26c39e4ea6 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -1306,7 +1306,7 @@ public:
limit = limitStr ? atoi(limitStr) : -1;
}
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP);
stmt->setString(0, ip);
PreparedQueryResult result = LoginDatabase.Query(stmt);
@@ -1325,7 +1325,7 @@ public:
if (!Utf8ToUpperOnlyLatin(account))
return false;
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME);
stmt->setString(0, account);
PreparedQueryResult result = LoginDatabase.Query(stmt);
@@ -1341,7 +1341,7 @@ public:
char* limitStr = strtok(NULL, " ");
int32 limit = limitStr ? atoi(limitStr) : -1;
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL);
stmt->setString(0, email);
PreparedQueryResult result = LoginDatabase.Query(stmt);
@@ -1373,7 +1373,7 @@ public:
uint32 accountId = fields[0].GetUInt32();
std::string accountName = fields[1].GetString();
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC);
stmt->setUInt32(0, accountId);
PreparedQueryResult result2 = CharacterDatabase.Query(stmt);
diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp
index c467bcc2d46..761cceac506 100644
--- a/src/server/scripts/Commands/cs_message.cpp
+++ b/src/server/scripts/Commands/cs_message.cpp
@@ -115,7 +115,7 @@ public:
if (channel)
channel->SetOwnership(true);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
stmt->setUInt8 (0, 1);
stmt->setString(1, channelStr);
CharacterDatabase.Execute(stmt);
@@ -126,7 +126,7 @@ public:
if (channel)
channel->SetOwnership(false);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
stmt->setUInt8 (0, 0);
stmt->setString(1, channelStr);
CharacterDatabase.Execute(stmt);
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 9f8d7148121..f73633fb102 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -128,7 +128,7 @@ public:
{
if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE))
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PVPSTATS_FACTIONS_OVERALL);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PVPSTATS_FACTIONS_OVERALL);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (result)
@@ -1000,7 +1000,7 @@ public:
if (!player)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND);
stmt->setUInt64(0, targetGUID.GetCounter());
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (result)
@@ -1594,7 +1594,7 @@ public:
Player* target;
ObjectGuid targetGuid;
std::string targetName;
- PreparedStatement* stmt = NULL;
+ CharacterDatabasePreparedStatement* stmt = NULL;
// To make sure we get a target, we convert our guid to an omniversal...
ObjectGuid parseGUID = ObjectGuid::Create<HighGuid::Player>(strtoull(args, nullptr, 10));
@@ -1748,10 +1748,10 @@ public:
}
// Query the prepared statement for login data
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO);
- stmt->setInt32(0, int32(realm.Id.Realm));
- stmt->setUInt32(1, accId);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
+ LoginDatabasePreparedStatement* stmt2 = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO);
+ stmt2->setInt32(0, int32(realm.Id.Realm));
+ stmt2->setUInt32(1, accId);
+ PreparedQueryResult result = LoginDatabase.Query(stmt2);
if (result)
{
@@ -1794,7 +1794,7 @@ public:
std::string nameLink = handler->playerLink(targetName);
// Returns banType, banTime, bannedBy, banreason
- PreparedStatement* stmt2 = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS);
+ stmt2 = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS);
stmt2->setUInt32(0, accId);
PreparedQueryResult result2 = LoginDatabase.Query(stmt2);
if (!result2)
@@ -1814,9 +1814,9 @@ public:
}
// Can be used to query data from Characters database
- stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_XP);
- stmt2->setUInt64(0, lowguid);
- PreparedQueryResult result4 = CharacterDatabase.Query(stmt2);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_XP);
+ stmt->setUInt64(0, lowguid);
+ PreparedQueryResult result4 = CharacterDatabase.Query(stmt);
if (result4)
{
@@ -1828,9 +1828,9 @@ public:
if (gguid)
{
// Guild Data - an own query, because it may not happen.
- PreparedStatement* stmt3 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED);
- stmt3->setUInt64(0, lowguid);
- PreparedQueryResult result5 = CharacterDatabase.Query(stmt3);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED);
+ stmt->setUInt64(0, lowguid);
+ PreparedQueryResult result5 = CharacterDatabase.Query(stmt);
if (result5)
{
Field* fields5 = result5->Fetch();
@@ -1932,9 +1932,9 @@ public:
// Mail Data - an own query, because it may or may not be useful.
// SQL: "SELECT SUM(CASE WHEN (checked & 1) THEN 1 ELSE 0 END) AS 'readmail', COUNT(*) AS 'totalmail' FROM mail WHERE `receiver` = ?"
- PreparedStatement* stmt4 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_MAILS);
- stmt4->setUInt64(0, lowguid);
- PreparedQueryResult result6 = CharacterDatabase.Query(stmt4);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_MAILS);
+ stmt->setUInt64(0, lowguid);
+ PreparedQueryResult result6 = CharacterDatabase.Query(stmt);
if (result6)
{
Field* fields = result6->Fetch();
@@ -2009,7 +2009,7 @@ public:
if (handler->HasLowerSecurity (target, targetGuid, true))
return false;
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
std::string muteBy = "";
if (handler->GetSession())
muteBy = handler->GetSession()->GetPlayerName();
@@ -2088,7 +2088,7 @@ public:
target->GetSession()->m_muteTime = 0;
}
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
+ LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
stmt->setInt64(0, 0);
stmt->setString(1, "");
stmt->setString(2, "");
@@ -2136,7 +2136,7 @@ public:
// helper for mutehistory
static bool HandleMuteInfoHelper(uint32 accountId, char const* accountName, ChatHandler *handler)
{
- PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_MUTE_INFO);
+ LoginDatabasePreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_MUTE_INFO);
stmt->setUInt32(0, accountId);
PreparedQueryResult result = LoginDatabase.Query(stmt);
@@ -2630,7 +2630,7 @@ public:
}
// If player found: delete his freeze aura
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN);
stmt->setUInt64(0, guid.GetCounter());
CharacterDatabase.Execute(stmt);
@@ -2650,7 +2650,7 @@ public:
static bool HandleListFreezeCommand(ChatHandler* handler, char const* /*args*/)
{
// Get names from DB
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 129053e2f88..d090e3ed700 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -427,7 +427,7 @@ public:
wait = 0;
// Update movement type
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE);
stmt->setUInt8(0, uint8(WAYPOINT_MOTION_TYPE));
stmt->setUInt64(1, lowGuid);
@@ -615,7 +615,7 @@ public:
const_cast<CreatureTemplate*>(cinfo)->faction = factionId;
// ..and DB
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_FACTION);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_FACTION);
stmt->setUInt16(0, uint16(factionId));
stmt->setUInt32(1, creature->GetEntry());
@@ -647,7 +647,7 @@ public:
creature->SetNpcFlags(NPCFlags(raw[0]));
creature->SetNpcFlags2(NPCFlags2(raw[1]));
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_NPCFLAG);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_NPCFLAG);
stmt->setUInt64(0, npcFlags);
stmt->setUInt32(1, creature->GetEntry());
@@ -799,7 +799,7 @@ public:
Player* player = handler->GetSession()->GetPlayer();
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_NEAREST);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_NEAREST);
stmt->setFloat(0, player->GetPositionX());
stmt->setFloat(1, player->GetPositionY());
stmt->setFloat(2, player->GetPositionZ());
@@ -900,7 +900,7 @@ public:
}
}
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_POSITION);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_POSITION);
stmt->setFloat(0, x);
stmt->setFloat(1, y);
@@ -1193,7 +1193,7 @@ public:
creature->Respawn();
}
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_DISTANCE);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_DISTANCE);
stmt->setFloat(0, option);
stmt->setUInt8(1, uint8(mtype));
@@ -1224,7 +1224,7 @@ public:
ObjectGuid::LowType guidLow = creature->GetSpawnId();
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS);
stmt->setUInt32(0, spawnTime);
stmt->setUInt64(1, guidLow);
@@ -1566,7 +1566,7 @@ public:
sFormationMgr->CreatureGroupMap[lowguid] = group_member;
creature->SearchFormation();
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_FORMATION);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_FORMATION);
stmt->setUInt64(0, leaderGUID);
stmt->setUInt64(1, lowguid);
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp
index 09df98fead1..db2e6d2529d 100644
--- a/src/server/scripts/Commands/cs_quest.cpp
+++ b/src/server/scripts/Commands/cs_quest.cpp
@@ -245,7 +245,7 @@ public:
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled
{
// prepare Quest Tracker datas
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_GM_COMPLETE);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_GM_COMPLETE);
stmt->setUInt32(0, quest->GetQuestId());
stmt->setUInt64(1, player->GetGUID().GetCounter());
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 9e5048576a7..ea969f1366f 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -432,7 +432,7 @@ public:
{
uint32 entry = atoul(*itr);
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_TEMPLATE);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_TEMPLATE);
stmt->setUInt32(0, entry);
PreparedQueryResult result = WorldDatabase.Query(stmt);
diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp
index f8ae4589612..cd860ee343d 100644
--- a/src/server/scripts/Commands/cs_reset.cpp
+++ b/src/server/scripts/Commands/cs_reset.cpp
@@ -173,7 +173,7 @@ public:
}
else
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS));
stmt->setUInt64(1, targetGuid.GetCounter());
CharacterDatabase.Execute(stmt);
@@ -252,7 +252,7 @@ public:
}
else if (!targetGuid.IsEmpty())
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS));
stmt->setUInt64(1, targetGuid.GetCounter());
CharacterDatabase.Execute(stmt);
@@ -298,7 +298,7 @@ public:
return false;
}
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS);
stmt->setUInt16(0, uint16(atLogin));
CharacterDatabase.Execute(stmt);
diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp
index dc16fc49d08..4ae8e282aff 100644
--- a/src/server/scripts/Commands/cs_tele.cpp
+++ b/src/server/scripts/Commands/cs_tele.cpp
@@ -138,7 +138,7 @@ public:
target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->GetOrientation());
else
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND);
stmt->setUInt64(0, target_guid.GetCounter());
PreparedQueryResult resultDB = CharacterDatabase.Query(stmt);
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index 52c5ae5267f..610e81511d7 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -98,7 +98,7 @@ public:
pathid = target->GetWaypointPath();
else
{
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_ID);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_ID);
PreparedQueryResult result = WorldDatabase.Query(stmt);
@@ -119,7 +119,7 @@ public:
return true;
}
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_POINT);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_POINT);
stmt->setUInt32(0, pathid);
PreparedQueryResult result = WorldDatabase.Query(stmt);
@@ -186,7 +186,7 @@ public:
guidLow = target->GetSpawnId();
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_ADDON_BY_GUID);
+ WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_ADDON_BY_GUID);
stmt->setUInt64(0, guidLow);
@@ -243,7 +243,7 @@ public:
{
Creature* target = handler->getSelectedCreature();
- PreparedStatement* stmt = NULL;
+ WorldDatabasePreparedStatement* stmt = NULL;
if (!target)
{
@@ -291,7 +291,7 @@ public:
char* show_str = strtok((char*)args, " ");
std::string show = show_str;
- PreparedStatement* stmt = NULL;
+ WorldDatabasePreparedStatement* stmt = NULL;
// Check
if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid"))
@@ -572,7 +572,7 @@ public:
uint32 pathid = 0;
uint32 point = 0;
Creature* target = handler->getSelectedCreature();
- PreparedStatement* stmt = NULL;
+ WorldDatabasePreparedStatement* stmt = NULL;
// User did select a visual waypoint?
if (!target || target->GetEntry() != VISUAL_WAYPOINT)
@@ -736,7 +736,7 @@ public:
uint32 pathid = 0;
Creature* target = handler->getSelectedCreature();
- PreparedStatement* stmt = NULL;
+ WorldDatabasePreparedStatement* stmt = NULL;
// Did player provide a PathID?