Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Bugs

Archive::Bugs Archive area for Bugs's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 05-19-2004, 06:31 AM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default

Try these out. Should be in command.cpp at about lines 2938 and 1411 in command.cpp, respectively.

Code:
void command_listpetition (Client *c, const Seperator *sep)
{
  char errbuf[MYSQL_ERRMSG_SIZE];
  char *query;
  MYSQL_RES *result;
  MYSQL_ROW row;
  unsigned int count = 0;

  query = new char[256];

  if (database.RunQuery (
    query,
    MakeAnyLenString(&query,  "SELECT petid, charname,accountname FROM petitions ORDER BY petid"),
    errbuf,
    &result) == false)
  {
    safe_delete_array (query);
    c->Message (13, "Error executing query.");
    return;
  }

  safe_delete_array (query);

  LogFile->write (EQEMuLog::Normal,
    "Petition list requested by %s", c->GetName());

  while ((row = mysql_fetch_row (result)) != NULL)
  {
    if (count++ == 0)
      c->Message (13,"  ID: Character Name, Account Name");

    c->Message (15, "  %s: %s, %s", row[0], row[1], row[2]);
  }

  if (count == 0)
    c->Message (15, "No petitions found.");

  mysql_free_result (result);
}
Code:
void command_delpetition (Client *c, const Seperator *sep)
{
   if (sep->arg[1][0] == 0 || strcasecmp (sep->arg[1], "*") == 0)
   {
      c->Message (0, "Usage: #delpetition (petition number).");
      c->Message (0, "Type #listpetition for a list.");
      return;
   }

   if (petition_list.DeletePetition (atoi (sep->argplus[1])) == -1)
      c->Message (13, "Error deleting petition %i.", atoi (sep->argplus[1]));
   else
      c->Message (13, "Deleted petition %i.", atoi(sep->argplus[1]));
}
edit: Added new delete petition function and modified list petitions.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 09:20 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3