From f20ff5c6e3f6c8ada4adbc60ea854c1f3eeff014 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:32:34 -0600 Subject: [PATCH] Cleanup of some QueryDatabase references that no longer need auto results --- common/database.cpp | 6 ------ common/guild_base.cpp | 4 ---- common/rulesys.cpp | 1 - queryserv/lfguild.cpp | 4 ---- ucs/database.cpp | 12 +++--------- 5 files changed, 3 insertions(+), 24 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index c0f578f2a..f3122d458 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -734,12 +734,6 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven charid, i, newinv->GetItem()->ID, newinv->GetCharges(), newinv->GetColor()); auto results = QueryDatabase(invquery); - - if (!results.RowsAffected()) -#if EQDEBUG >= 9 - else - Log.Out(Logs::General, Logs::None,, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); -#endif } if (i == MainCursor) { diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 64020971a..1416dedf1 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -231,14 +231,10 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { //clear out old `guilds` entry auto results = m_db->QueryDatabase(query); - if (!results.Success()) - //clear out old `guild_ranks` entries query = StringFormat("DELETE FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id); results = m_db->QueryDatabase(query); - if (!results.Success()) - //escape our strings. char *name_esc = new char[info->name.length()*2+1]; char *motd_esc = new char[info->motd.length()*2+1]; diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 97d5a96ad..a53dbcabe 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -312,7 +312,6 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) { " VALUES(%d, '%s', '%s')", m_activeRuleset, _GetRuleName(type, index), vstr); auto results = db->QueryDatabase(query); - if (!results.Success()) } diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index 2f395c97a..340321f06 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -240,7 +240,6 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From); auto results = database.QueryDatabase(query); - if(!results.Success()) uint32 Now = time(nullptr); @@ -254,7 +253,6 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char "VALUES (0, '%s', '%s', %u, 0, %u, %u, %u, %u)", From, Comments, Level, Class, AAPoints, TimeZone, Now); auto results = database.QueryDatabase(query); - if(!results.Success()) } ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30); @@ -284,7 +282,6 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName); auto results = database.QueryDatabase(query); - if(!results.Success()) uint32 Now = time(nullptr); @@ -300,7 +297,6 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char GuildName, Comments, FromLevel, ToLevel, Classes, AACount, TimeZone, Now); auto results = database.QueryDatabase(query); - if(!results.Success()) } diff --git a/ucs/database.cpp b/ucs/database.cpp index 507e8ad30..fbbfdeac6 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -268,9 +268,7 @@ void Database::SetChannelPassword(std::string channelName, std::string password) std::string query = StringFormat("UPDATE `chatchannels` SET `password` = '%s' WHERE `name` = '%s'", password.c_str(), channelName.c_str()); - auto results = QueryDatabase(query); - if(!results.Success()) - + QueryDatabase(query); } void Database::SetChannelOwner(std::string channelName, std::string owner) { @@ -279,9 +277,7 @@ void Database::SetChannelOwner(std::string channelName, std::string owner) { std::string query = StringFormat("UPDATE `chatchannels` SET `owner` = '%s' WHERE `name` = '%s'", owner.c_str(), channelName.c_str()); - auto results = QueryDatabase(query); - if(!results.Success()) - + QueryDatabase(query); } void Database::SendHeaders(Client *client) { @@ -488,9 +484,7 @@ void Database::SetMessageStatus(int messageNumber, int status) { } std::string query = StringFormat("UPDATE `mail` SET `status` = %i WHERE `msgid`=%i", status, messageNumber); - auto results = QueryDatabase(query); - if (!results.Success()) - + QueryDatabase(query); } void Database::ExpireMail() {