mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 07:21:48 +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);
|
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)
|
if(m_db == nullptr)
|
||||||
return(false);
|
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);
|
_log(GUILDS__ERROR, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str());
|
||||||
safe_delete_array(query);
|
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
safe_delete_array(query);
|
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -108,7 +108,7 @@ protected:
|
|||||||
bool DBSetAltFlag(uint32 charid, bool is_alt);
|
bool DBSetAltFlag(uint32 charid, bool is_alt);
|
||||||
bool DBSetTributeFlag(uint32 charid, bool enabled);
|
bool DBSetTributeFlag(uint32 charid, bool enabled);
|
||||||
bool DBSetPublicNote(uint32 charid, const char *note);
|
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);
|
// void DBSetPublicNote(uint32 guild_id,char* charname, char* note);
|
||||||
|
|
||||||
bool LocalDeleteGuild(uint32 guild_id);
|
bool LocalDeleteGuild(uint32 guild_id);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user