mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
command_delpetition converted to QueryDatabase
This commit is contained in:
parent
905a264744
commit
ca2c2ccfac
@ -1562,17 +1562,19 @@ void command_petitioninfo(Client *c, const Seperator *sep)
|
||||
|
||||
void command_delpetition(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[1][0] == 0 || strcasecmp(sep->arg[1],"*")==0)
|
||||
if (sep->arg[1][0] == 0 || strcasecmp(sep->arg[1],"*") == 0) {
|
||||
c->Message(0, "Usage: #delpetition (petition number) Type #listpetition for a list");
|
||||
else {
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(13,"Attempting to delete petition number: %i",atoi(sep->argplus[1]));
|
||||
if (database.RunQuery(query, MakeAnyLenString(&query, "DELETE from petitions where petid=%i",atoi(sep->argplus[1])), errbuf)) {
|
||||
std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", atoi(sep->argplus[1]));
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
return;
|
||||
|
||||
LogFile->write(EQEMuLog::Normal,"Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) );
|
||||
}
|
||||
safe_delete_array(query);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void command_listnpcs(Client *c, const Seperator *sep)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user