mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
Converted ClearRaid to QueryDatabase, added ClearAllRaids utility method
This commit is contained in:
parent
c80f803ba7
commit
34739b71b3
@ -1990,16 +1990,32 @@ void Database::SetAgreementFlag(uint32 acctid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Database::ClearRaid(uint32 rid) {
|
void Database::ClearRaid(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_members"), errbuf))
|
{
|
||||||
printf("Unable to clear raids: %s\n",errbuf);
|
//clear all raids
|
||||||
} else { //clear a specific group
|
ClearAllRaids();
|
||||||
if (!RunQuery(query, MakeAnyLenString(&query, "delete from raid_members where raidid = %lu", (unsigned long)rid), errbuf))
|
return;
|
||||||
printf("Unable to clear raids: %s\n",errbuf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//clear a specific group
|
||||||
|
auto results = QueryDatabase(query, MakeAnyLenString(&query, "delete from raid_members where raidid = %lu", (unsigned long)rid));
|
||||||
safe_delete_array(query);
|
safe_delete_array(query);
|
||||||
|
|
||||||
|
if (!results.Success())
|
||||||
|
std::cout << "Unable to clear raids: " << results.ErrorMessage() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Database::ClearAllRaids(void)
|
||||||
|
{
|
||||||
|
char *query = nullptr;
|
||||||
|
|
||||||
|
auto results = QueryDatabase(query, MakeAnyLenString(&query, "delete from raid_members"));
|
||||||
|
safe_delete_array(query);
|
||||||
|
|
||||||
|
if (!results.Success())
|
||||||
|
std::cout << "Unable to clear raids: " << results.ErrorMessage() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::ClearRaidDetails(uint32 rid) {
|
void Database::ClearRaidDetails(uint32 rid) {
|
||||||
|
|||||||
@ -270,6 +270,12 @@ private:
|
|||||||
*/
|
*/
|
||||||
void ClearAllGroupLeaders();
|
void ClearAllGroupLeaders();
|
||||||
void ClearAllGroups();
|
void ClearAllGroups();
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Raid, utility methods.
|
||||||
|
*/
|
||||||
|
void ClearAllRaids();
|
||||||
};
|
};
|
||||||
|
|
||||||
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