Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 10-05-2006, 05:49 AM
aza77
Hill Giant
 
Join Date: Dec 2004
Posts: 126
Thumbs down Magelo modification

This patch makes it possible to enable or disable the magelo for an account. #magelo enable/disable is the command for it.

First of all you need to modify the account table:

ALTER TABLE `account` ADD `magelo` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1';

magelo 1 = enabled
magelo 0 = disabled

if you want it disabled by default just change the default 1 to 0.

now we need to add the command for it ..

command.cpp
-------------

||
command_add("magelo","- enable/disable your mageloprofile",0,command_magelo)

-------------

void command_magelo(Client *c, const Seperator *sep)
{
if (strcasecmp(sep->arg[1], "enable")==0)
{
database.SetMagelo(c->AccountID(),1);
c->Message(0, "Your Magelo profile is enabled.");
}
else if (strcasecmp(sep->arg[1], "disable")==0)
{
database.SetMagelo(c->AccountID(),0);
c->Message(0, "Your Magelo profile is disabled.");
}
else
c->Message(0, "Usage: #magelo [enable/disable]");
}

------------

command.h
------------

void command_magelo(Client *c, const Seperator *sep);

------------

database.cpp
------------

void Database::SetMagelo(int32 acctid, int8 status)
{
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
int32 affected_rows = 0;

RunQuery(query, MakeAnyLenString(&query, "UPDATE account SET magelo=%i where id=%i",status,acctid), errbuf, 0, &affected_rows);
safe_delete_array(query);
}

------------

database.h
------------

void SetMagelo(int32 acctid, int8 status);

------------

now the final step .. get the modified magelo from www.projectf.org/downloads/magelo.zip and install it

enjoy it
__________________
- http://www.eqemu-paradigma.de -
Reply With Quote
Reply


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 03:57 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