mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
QueryWithLogging converted to QueryDatabase
This commit is contained in:
parent
cca9ddab43
commit
8a44271b2f
@ -930,19 +930,17 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) {
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool BaseGuildManager::QueryWithLogging(char *&query, int len, const char *errmsg) {
|
||||
bool BaseGuildManager::QueryWithLogging(std::string query, int len, const char *errmsg) {
|
||||
if(m_db == nullptr)
|
||||
return(false);
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
auto results = m_db->QueryDatabase(query);
|
||||
|
||||
if (!m_db->RunQuery(query, len, errbuf))
|
||||
if (!results.Success())
|
||||
{
|
||||
_log(GUILDS__ERROR, "Error %s: '%s': %s", errmsg, query, errbuf);
|
||||
safe_delete_array(query);
|
||||
_log(GUILDS__ERROR, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str());
|
||||
return(false);
|
||||
}
|
||||
safe_delete_array(query);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ protected:
|
||||
bool DBSetAltFlag(uint32 charid, bool is_alt);
|
||||
bool DBSetTributeFlag(uint32 charid, bool enabled);
|
||||
bool DBSetPublicNote(uint32 charid, const char *note);
|
||||
bool QueryWithLogging(char *&query, int len, const char *errmsg);
|
||||
bool QueryWithLogging(std::string query, int len, const char *errmsg);
|
||||
// void DBSetPublicNote(uint32 guild_id,char* charname, char* note);
|
||||
|
||||
bool LocalDeleteGuild(uint32 guild_id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user