diff options
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Commands/cs_account.cpp | 32 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_ban.cpp | 12 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_character.cpp | 26 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_disable.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_gm.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_gobject.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_group.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_lfg.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_list.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_lookup.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_message.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 44 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_npc.cpp | 16 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_quest.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_reload.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_reset.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_tele.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_wp.cpp | 14 | ||||
| -rw-r--r-- | src/server/scripts/World/action_ip_logger.cpp | 8 |
19 files changed, 95 insertions, 97 deletions
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 66db4a66278..cb6dcda99d8 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -106,7 +106,7 @@ public: uint32 const accountId = handler->GetSession()->GetAccountId(); { // check if 2FA already enabled - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_TOTP_SECRET); + LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_TOTP_SECRET); stmt->setUInt32(0, accountId); PreparedQueryResult result = LoginDatabase.Query(stmt); @@ -139,7 +139,7 @@ public: if (masterKey) Trinity::Crypto::AEEncryptWithRandomIV<Trinity::Crypto::AES>(pair.first->second, *masterKey); - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); + LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); stmt->setBinary(0, pair.first->second); stmt->setUInt32(1, accountId); LoginDatabase.Execute(stmt); @@ -170,7 +170,7 @@ public: uint32 const accountId = handler->GetSession()->GetAccountId(); Trinity::Crypto::TOTP::Secret secret; { // get current TOTP secret - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_TOTP_SECRET); + LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_TOTP_SECRET); stmt->setUInt32(0, accountId); PreparedQueryResult result = LoginDatabase.Query(stmt); @@ -209,7 +209,7 @@ public: if (Trinity::Crypto::TOTP::ValidateToken(secret, *token)) { - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); + LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); stmt->setNull(0); stmt->setUInt32(1, accountId); LoginDatabase.Execute(stmt); @@ -234,7 +234,7 @@ public: return false; } - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION); + LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPANSION); stmt->setUInt8(0, expansion); stmt->setUInt32(1, handler->GetSession()->GetAccountId()); @@ -344,9 +344,7 @@ public: static bool HandleAccountOnlineListCommand(ChatHandler* handler) { ///- 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) { @@ -368,7 +366,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); @@ -395,7 +393,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); @@ -410,7 +408,7 @@ public: } else { - 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); @@ -421,7 +419,7 @@ public: static bool HandleAccountLockIpCommand(ChatHandler* handler, bool state) { - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK); + LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK); if (state) { @@ -599,7 +597,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); @@ -656,7 +654,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); @@ -724,7 +722,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 (realmId == -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, accountId); stmt->setUInt8(1, gmLevel); @@ -827,7 +825,7 @@ public: if (secret == "off") { - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); + LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); stmt->setNull(0); stmt->setUInt32(1, targetAccountId); LoginDatabase.Execute(stmt); @@ -860,7 +858,7 @@ public: if (masterKey) Trinity::Crypto::AEEncryptWithRandomIV<Trinity::Crypto::AES>(*decoded, *masterKey); - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); + LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_TOTP_SECRET); stmt->setBinary(0, *decoded); stmt->setUInt32(1, targetAccountId); LoginDatabase.Execute(stmt); diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index e3f014cf7c5..f72fb715d04 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -328,7 +328,7 @@ public: else targetGuid = target->GetGUID().GetCounter(); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO); stmt->setUInt32(0, targetGuid); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) @@ -389,7 +389,7 @@ public: static bool HandleBanListAccountCommand(ChatHandler* handler, char const* args) { - PreparedStatement* stmt = nullptr; + LoginDatabasePreparedStatement* stmt = nullptr; stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS); LoginDatabase.Execute(stmt); @@ -511,7 +511,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) @@ -528,7 +528,7 @@ public: do { Field* fields = result->Fetch(); - PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME); + CharacterDatabasePreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME); stmt2->setUInt32(0, fields[0].GetUInt32()); PreparedQueryResult banResult = CharacterDatabase.Query(stmt2); if (banResult) @@ -550,7 +550,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->setUInt32(0, fields[0].GetUInt32()); PreparedQueryResult banInfo = CharacterDatabase.Query(stmt2); if (banInfo) @@ -591,7 +591,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_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 439d1c8c05a..c4cf6a02168 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->setUInt32(2, delInfo.guid.GetCounter()); @@ -254,7 +254,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->setUInt32(1, playerGuid.GetCounter()); CharacterDatabase.Execute(stmt); @@ -360,7 +360,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) @@ -422,7 +422,7 @@ public: std::string oldNameLink = handler->playerLink(targetName); handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), targetGuid.GetCounter()); - 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->setUInt32(1, targetGuid.GetCounter()); CharacterDatabase.Execute(stmt); @@ -481,7 +481,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) { @@ -509,7 +509,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) { @@ -536,7 +536,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) { @@ -589,7 +589,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(); @@ -614,10 +614,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 5110362740e..7d310d4a167 100644 --- a/src/server/scripts/Commands/cs_disable.cpp +++ b/src/server/scripts/Commands/cs_disable.cpp @@ -187,7 +187,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); @@ -312,7 +312,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 cdc0ac94c73..cbb5ef30b09 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -167,7 +167,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 16c9887e1f6..87ec9f2a840 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -555,7 +555,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 5ec0a6f46b9..4c76a2664f2 100644 --- a/src/server/scripts/Commands/cs_group.cpp +++ b/src/server/scripts/Commands/cs_group.cpp @@ -361,7 +361,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->setUInt32(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 eefd7c487b1..5f5cf956847 100644 --- a/src/server/scripts/Commands/cs_lfg.cpp +++ b/src/server/scripts/Commands/cs_lfg.cpp @@ -97,7 +97,7 @@ public: groupTarget = playerTarget->GetGroup(); else { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER); stmt->setUInt32(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 8d5d32ea890..e3925b284f6 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -202,7 +202,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); @@ -538,7 +538,7 @@ public: Player* target; ObjectGuid targetGuid; std::string targetName; - PreparedStatement* stmt = nullptr; + CharacterDatabasePreparedStatement* stmt = nullptr; if (!*args) return false; diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index c6292b2f9c7..76bf2d76e46 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -1460,7 +1460,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); @@ -1480,7 +1480,7 @@ public: (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); @@ -1496,7 +1496,7 @@ public: char* limitStr = strtok(nullptr, " "); 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); @@ -1528,7 +1528,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 16a73a4f87e..a9882f4c1df 100644 --- a/src/server/scripts/Commands/cs_message.cpp +++ b/src/server/scripts/Commands/cs_message.cpp @@ -113,7 +113,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); @@ -123,7 +123,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 acf3f5ce92c..810faa42533 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -125,7 +125,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) @@ -1212,7 +1212,7 @@ public: std::string itemName = itemNameStr+1; WorldDatabase.EscapeString(itemName); - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME); + WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME); stmt->setString(0, itemName); PreparedQueryResult result = WorldDatabase.Query(stmt); @@ -1530,7 +1530,7 @@ public: Player* target; ObjectGuid targetGuid; std::string targetName; - PreparedStatement* stmt = nullptr; + CharacterDatabasePreparedStatement* stmt = nullptr; // To make sure we get a target, we convert our guid to an omniversal... ObjectGuid parseGUID(HighGuid::Player, uint32(atoul(args))); @@ -1686,10 +1686,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) { @@ -1732,7 +1732,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) @@ -1754,9 +1754,9 @@ public: // Can be used to query data from Characters database - stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_XP); - stmt2->setUInt32(0, lowguid); - PreparedQueryResult result4 = CharacterDatabase.Query(stmt2); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_XP); + stmt->setUInt32(0, lowguid); + PreparedQueryResult result4 = CharacterDatabase.Query(stmt); if (result4) { @@ -1768,9 +1768,9 @@ public: if (gguid != 0) { // Guild Data - an own query, because it may not happen. - PreparedStatement* stmt3 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED); - stmt3->setUInt32(0, lowguid); - PreparedQueryResult result5 = CharacterDatabase.Query(stmt3); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED); + stmt->setUInt32(0, lowguid); + PreparedQueryResult result5 = CharacterDatabase.Query(stmt); if (result5) { Field* fields5 = result5->Fetch(); @@ -1878,9 +1878,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->setUInt32(0, lowguid); - PreparedQueryResult result6 = CharacterDatabase.Query(stmt4); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_MAILS); + stmt->setUInt32(0, lowguid); + PreparedQueryResult result6 = CharacterDatabase.Query(stmt); if (result6) { Field* fields = result6->Fetch(); @@ -1967,7 +1967,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(); @@ -2046,7 +2046,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, ""); @@ -2094,7 +2094,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); @@ -2564,7 +2564,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->setUInt32(0, guid.GetCounter()); CharacterDatabase.Execute(stmt); @@ -2584,7 +2584,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 d6e1f4985bc..0df3e831109 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -335,7 +335,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->setUInt32(1, lowGuid); @@ -521,7 +521,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()); @@ -550,7 +550,7 @@ public: creature->SetUInt32Value(UNIT_NPC_FLAGS, npcFlags); - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_NPCFLAG); + WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_NPCFLAG); stmt->setUInt32(0, npcFlags); stmt->setUInt32(1, creature->GetEntry()); @@ -694,7 +694,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()); @@ -776,7 +776,7 @@ public: sObjectMgr->AddCreatureToGrid(lowguid, data); // update position in DB - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_POSITION); + WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_POSITION); stmt->setFloat(0, player->GetPositionX()); stmt->setFloat(1, player->GetPositionY()); stmt->setFloat(2, player->GetPositionZ()); @@ -1057,7 +1057,7 @@ public: creature->Respawn(); } - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_WANDER_DISTANCE); + WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_WANDER_DISTANCE); stmt->setFloat(0, option); stmt->setUInt8(1, uint8(mtype)); @@ -1097,7 +1097,7 @@ public: else return false; - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS); + WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS); stmt->setUInt32(0, uint32(spawnTime)); stmt->setUInt32(1, guidLow); @@ -1528,7 +1528,7 @@ public: sFormationMgr->AddFormationMember(lowguid, followAngle, followDist, leaderGUID, groupAI); creature->SearchFormation(); - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_FORMATION); + WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_FORMATION); stmt->setUInt32(0, leaderGUID); stmt->setUInt32(1, lowguid); stmt->setFloat (2, followAngle); diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 52137f5ec95..935bcf23807 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -266,7 +266,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->setUInt32(1, player->GetGUID().GetCounter()); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 967e7555d87..e678c499b56 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -436,7 +436,7 @@ public: { uint32 entry = uint32(atoi(*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 a1020ef030f..d2550cc6aa7 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -178,7 +178,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->setUInt32(1, targetGuid.GetCounter()); CharacterDatabase.Execute(stmt); @@ -252,7 +252,7 @@ public: } else if (targetGuid) { - 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->setUInt32(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 78c1c69bc2f..bb95b8c0f2c 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -128,7 +128,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->setUInt32(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 917678e3667..5760117122d 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -97,7 +97,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); @@ -118,7 +118,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->setUInt32(0, guidLow); @@ -243,7 +243,7 @@ public: { Creature* target = handler->getSelectedCreature(); - PreparedStatement* stmt = nullptr; + WorldDatabasePreparedStatement* stmt = nullptr; if (!target) { @@ -288,7 +288,7 @@ public: char* show_str = strtok((char*)args, " "); std::string show = show_str; - PreparedStatement* stmt = nullptr; + WorldDatabasePreparedStatement* stmt = nullptr; // Check if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid")) @@ -569,7 +569,7 @@ public: uint32 pathid = 0; uint32 point = 0; Creature* target = handler->getSelectedCreature(); - PreparedStatement* stmt = nullptr; + WorldDatabasePreparedStatement* stmt = nullptr; // User did select a visual waypoint? if (!target || target->GetEntry() != VISUAL_WAYPOINT) @@ -737,7 +737,7 @@ public: uint32 pathid = 0; Creature* target = handler->getSelectedCreature(); - PreparedStatement* stmt = nullptr; + WorldDatabasePreparedStatement* stmt = nullptr; // Did player provide a PathID? diff --git a/src/server/scripts/World/action_ip_logger.cpp b/src/server/scripts/World/action_ip_logger.cpp index 22065550202..74d35bfb4ed 100644 --- a/src/server/scripts/World/action_ip_logger.cpp +++ b/src/server/scripts/World/action_ip_logger.cpp @@ -138,7 +138,7 @@ class AccountActionIpLogger : public AccountScript { // As we can assume most account actions are NOT failed login, so this is the more accurate check. // For those, we need last_ip... - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ALDL_IP_LOGGING); + LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ALDL_IP_LOGGING); stmt->setUInt32(0, playerGuid); stmt->setUInt32(1, characterGuid); @@ -149,7 +149,7 @@ class AccountActionIpLogger : public AccountScript } else // ... but for failed login, we query last_attempt_ip from account table. Which we do with an unique query { - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_FACL_IP_LOGGING); + LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_FACL_IP_LOGGING); stmt->setUInt32(0, playerGuid); stmt->setUInt32(1, characterGuid); @@ -231,7 +231,7 @@ class CharacterActionIpLogger : public PlayerScript } // Once we have done everything, we can insert the new log. - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_CHAR_IP_LOGGING); + LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_CHAR_IP_LOGGING); stmt->setUInt32(0, playerGuid); stmt->setUInt32(1, characterGuid); @@ -291,7 +291,7 @@ public: } // Once we have done everything, we can insert the new log. - PreparedStatement* stmt2 = LoginDatabase.GetPreparedStatement(LOGIN_INS_ALDL_IP_LOGGING); + LoginDatabasePreparedStatement* stmt2 = LoginDatabase.GetPreparedStatement(LOGIN_INS_ALDL_IP_LOGGING); stmt2->setUInt32(0, playerGuid); stmt2->setUInt32(1, characterGuid); |
