ArcEmu: Optional Disable Character Deletion - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Optional Disable Character Deletion Disable or Enable Character Deletion

#1 User is offline   Destkan 

  • Member
  • Pip
  • Group: Members
  • Posts: 12
  • Joined: 01-May 09

Posted 07 July 2009 - 11:55 PM

Well guys, that's my first patch so please don't bother me if i'm too noob <_<

Briefly, i added "DisableCharDeletion" support in arcemu-optional.conf file (http://pastebin.com/m7196b8b0).
If set to 1, Players are able to create but not delete Characters (this is for avoiding unvoluntary char delection (i.e.: stolen account))

C++

// CharacterHandler.cpp ->

uint8 WorldSession::DeleteCharacter(uint32 guid)

{

//Disable Characters Deletion if set to 1 in the arcemu-optional.conf file
if( Config.OptionalConfig.GetBoolDefault( "Optional" , "DisableCharDeletion" , true ) )
{
return E_CHAR_DELETE_FAILED;;
}


Default Value="0" (Blizzlike, this allows normal character deletion)

Cya

Dest

Attached File(s)


0

#2 User is offline   Destkan 

  • Member
  • Pip
  • Group: Members
  • Posts: 12
  • Joined: 01-May 09

Posted 08 July 2009 - 01:17 PM

View PostSadikum, on 08 July 2009 - 05:36 AM, said:

Little critic : this isn't a patch file and if DisableCharDeletion is 0 by default :
Config.OptionalConfig.GetBoolDefault( "Optional" , "DisableCharDeletion" , false )


You're wrong, my code is correct. You have to set it to TRUE in the function control in order to NOT ACTIVATE the deletion procedure. Your code would do the OPPOSITE thing ! (Try by yourself). Anyway, I just compiled it and it works fine. You have badly interpreted the boolean procedure:

"Disabled by default", yes, but in the CONFIG FILE, not in the function ! The function reads the value in the config file, and if it's set to 1, avoid the deletion. Otherwise, it will allow it. It's obvious.

Please don't post such things, this mess up people brain and create a lot of confusion.

Again, my code is correct <_<

About the "this isn't a patch file", i have no idea of what you mean by that...I just committed my idea and the related piece of code :)
0

#3 User is offline   Destkan 

  • Member
  • Pip
  • Group: Members
  • Posts: 12
  • Joined: 01-May 09

Posted 08 July 2009 - 01:36 PM

OK patch file created. I never did that before, so please excuse me if i didn't attach the patchfile to my previous post.

(i dunno why, the forum did not load my attached file, so i uploaded it here)
0

#4 User is offline   Destkan 

  • Member
  • Pip
  • Group: Members
  • Posts: 12
  • Joined: 01-May 09

Posted 09 July 2009 - 08:04 AM

View PostSadikum, on 09 July 2009 - 07:02 AM, said:

I'm not an idiot and this cannot make a compile error, it's a sort of typo fix... The third argument of the function is the default value if the second argument doesn't exist in config file. So it's better to set it like the default value in config file :) .


This makes no sense at all. The config file is updated by the patch file, so i do not see any reason to use the opposite value. In that case, too, the Disable is called by an IF statement, so if you set that value to false by default, the function would work ...INVERTED. So it would disable the deletion only if set to...FALSE. And this is NOT what the function has to do. Additionally, if the value is not found in the conf file, the IF would automatically NOT execute its statement, as long as there's no ELSE statement specified (it's a simple conditional jump).
0

#5 User is offline   Destkan 

  • Member
  • Pip
  • Group: Members
  • Posts: 12
  • Joined: 01-May 09

Posted 09 July 2009 - 08:38 AM

After a few chatlines with Elenion, i now fully understand your point of view.

I take a look at the GetBoolDefault declaration in Config.cpp (arcemu-shared) and in fact you're right. It would return true if the config file does not contain the DisableCharDeletion directive. Now i fully understand your point of view. Sorry, i did not intend it in that way :) I thinked that you just misunderstood the boolean execution (EnableCharDeletion instead of DisableCharDeletion) :) Yep, returning false by default, in that case is a good idea. Anyway, if people update (as they should do) their config file, there will be no problem at all ;)

I attach to the post the new patchfile :) Thank you Sadikum, it's always an "anti-lazy user fix" ;)

Attached File(s)


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users