mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-19 12:21:34 +00:00
Built utility function ClearAllRaidDetails
This commit is contained in:
parent
34739b71b3
commit
e81e47e9c5
@ -2018,16 +2018,29 @@ void Database::ClearAllRaids(void)
|
|||||||
std::cout << "Unable to clear raids: " << results.ErrorMessage() << std::endl;
|
std::cout << "Unable to clear raids: " << results.ErrorMessage() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Database::ClearAllRaidDetails(void)
|
||||||
|
{
|
||||||
|
char *query = nullptr;
|
||||||
|
|
||||||
|
if (!RunQuery(query, MakeAnyLenString(&query, "delete from raid_details"), errbuf))
|
||||||
|
printf("Unable to clear raid details: %s\n",errbuf);
|
||||||
|
safe_delete_array(query);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
void Database::ClearRaidDetails(uint32 rid) {
|
void Database::ClearRaidDetails(uint32 rid) {
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
char *query = nullptr;
|
||||||
char *query = 0;
|
|
||||||
if(rid == 0) { //clear all raids
|
if(rid == 0)
|
||||||
if (!RunQuery(query, MakeAnyLenString(&query, "delete from raid_details"), errbuf))
|
{
|
||||||
printf("Unable to clear raid details: %s\n",errbuf);
|
//clear all raids
|
||||||
} else { //clear a specific group
|
ClearAllRaidDetails();
|
||||||
if (!RunQuery(query, MakeAnyLenString(&query, "delete from raid_details where raidid = %lu", (unsigned long)rid), errbuf))
|
return;
|
||||||
printf("Unable to clear raid details: %s\n",errbuf);
|
}
|
||||||
}
|
|
||||||
|
//clear a specific group
|
||||||
|
if (!RunQuery(query, MakeAnyLenString(&query, "delete from raid_details where raidid = %lu", (unsigned long)rid), errbuf))
|
||||||
|
printf("Unable to clear raid details: %s\n",errbuf);
|
||||||
safe_delete_array(query);
|
safe_delete_array(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -276,6 +276,7 @@ private:
|
|||||||
* Raid, utility methods.
|
* Raid, utility methods.
|
||||||
*/
|
*/
|
||||||
void ClearAllRaids();
|
void ClearAllRaids();
|
||||||
|
void ClearAllRaidDetails();
|
||||||
};
|
};
|
||||||
|
|
||||||
bool FetchRowMap(MYSQL_RES *result, std::map<std::string,std::string> &rowmap);
|
bool FetchRowMap(MYSQL_RES *result, std::map<std::string,std::string> &rowmap);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user