mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 04:11:30 +00:00
GetRaidDetails converted to QueryDatabase
This commit is contained in:
parent
77cfd116e0
commit
4b1d3592d4
@ -1236,24 +1236,21 @@ void Raid::SetRaidDetails()
|
|||||||
|
|
||||||
void Raid::GetRaidDetails()
|
void Raid::GetRaidDetails()
|
||||||
{
|
{
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
std::string query = StringFormat("SELECT locked, loottype FROM raid_details WHERE raidid = %lu",
|
||||||
char* query = 0;
|
(unsigned long)GetID());
|
||||||
MYSQL_RES *result;
|
auto results = database.QueryDatabase(query);
|
||||||
MYSQL_ROW row;
|
if (!results.Success())
|
||||||
if (database.RunQuery(query,MakeAnyLenString(&query, "SELECT locked, loottype FROM raid_details WHERE raidid=%lu", (unsigned long)GetID()),errbuf,&result)){
|
return;
|
||||||
safe_delete_array(query);
|
|
||||||
if(mysql_num_rows(result) < 1) {
|
if (results.RowCount() == 0) {
|
||||||
mysql_free_result(result);
|
LogFile->write(EQEMuLog::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str());
|
||||||
LogFile->write(EQEMuLog::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), errbuf);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
row = mysql_fetch_row(result);
|
auto row = results.begin();
|
||||||
if(row){
|
|
||||||
locked = atoi(row[0]);
|
locked = atoi(row[0]);
|
||||||
LootType = atoi(row[1]);
|
LootType = atoi(row[1]);
|
||||||
}
|
|
||||||
mysql_free_result(result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Raid::LearnMembers()
|
bool Raid::LearnMembers()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user