mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-22 19:31:29 +00:00
RaidGroupCount converted to QueryDatabase
This commit is contained in:
parent
0ece5bf178
commit
a3bde6e1f1
@ -1765,22 +1765,23 @@ uint8 ZoneDatabase::GroupCount(uint32 groupid) {
|
|||||||
return atoi(row[0]);
|
return atoi(row[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 ZoneDatabase::RaidGroupCount(uint32 raidid, uint32 groupid)
|
uint8 ZoneDatabase::RaidGroupCount(uint32 raidid, uint32 groupid) {
|
||||||
{
|
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
std::string query = StringFormat("SELECT count(charid) FROM raid_members "
|
||||||
char *query = 0;
|
"WHERE raidid = %d AND groupid = %d;", raidid, groupid);
|
||||||
MYSQL_RES *result;
|
auto results = QueryDatabase(query);
|
||||||
MYSQL_ROW row;
|
|
||||||
uint8 count=0;
|
if (!results.Success()) {
|
||||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT count(charid) FROM raid_members WHERE raidid=%d AND groupid=%d;", raidid, groupid), errbuf, &result)) {
|
LogFile->write(EQEMuLog::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
if((row = mysql_fetch_row(result))!=nullptr)
|
return 0;
|
||||||
count = atoi(row[0]);
|
}
|
||||||
mysql_free_result(result);
|
|
||||||
} else {
|
if (results.RowCount() == 0)
|
||||||
LogFile->write(EQEMuLog::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query, errbuf);
|
return 0;
|
||||||
}
|
|
||||||
safe_delete_array(query);
|
auto row = results.begin();
|
||||||
return count;
|
|
||||||
|
return atoi(row[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid)
|
int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user