Jump to content

[9767][patch]Don't delete chars finally


Guest DasBlub

Recommended Posts

What bug does the patch fix? What features does the patch add?

on our server we have often the problem, that chars get deleted by users (or their litle brothers ;)). and then restoring those chars based on sql dumps and database backups isn't the best way...

so i've implemented this patch which sets only a flag in the db and cuts the char away from the account. so you can restore the char very fast.

For which SubVersion revision was the patch created?

2008_11_01_02 (bf5fcf69e720842e6649ac8f7c8bc8cbe8397f4a)

Who has been writing this patch? Please include either forum user names or email addresses.

DasBlub

[old code removed. please use my git repo]

can now be found at github: http://github.com/DasBlub/mangos/tree/no_char_delete

single commit: http://github.com/DasBlub/mangos/commit/bd83d0332ff099bc276e4410f6ec406099985e28

and as a patchfile (created with git show): http://paste2.org/p/142137

Link to comment
Share on other sites

  • Replies 90
  • Created
  • Last Reply

Top Posters In This Topic

wouldn't a better solution be to simply change the account on the character to like 0 when they get deleted. Then recovery is simply set it back to the account. And cleanup is to just remove anything with account 0.

Sounds good.

Only thing that needs to be taken into consideration is that the charname keeps reserved without the deletion. So there should be done some sort of renaming to deleted chars because some ppl might want to delete chars to free up the name again.

Should be removed from friendslists, etc. before ofc.

Link to comment
Share on other sites

I think it is bad idea, For this you have charlog file dumps. If it isn't good for you, use this patch, but add it to MaNGOS git will be useless. A lot of users after first login tryting to create/delete several characters, or delete character after some levels . And with this patch fill DB and slowdown mangos for no reason.

But that option makes only half work, it makes inventory and bank items lost         

This bug was fixed long time ago and it works for me (and not only for me).

Link to comment
Share on other sites

wouldn't a better solution be to simply change the account on the character to like 0 when they get deleted. Then recovery is simply set it back to the account. And cleanup is to just remove anything with account 0.

this is that what the scripts does. the script sets the account to 0 and cleans the name (so the name is reusable). both values are storred in an additional field splited by a "|". the script removes the player from the group and from the guild but lets all other things.t if you want to delete the char finally you can just run a housekeeping script on your server which deletes the char finally.

oh i've set up now a github account and create a branch for this. see here: http://github.com/DasBlub/mangos/tree/no_char_delete (needed 3 commits for this, was my first time ;))

Link to comment
Share on other sites

Yes I know, sorry but I don't like your patch.. reasons are posted above.. Filling database and slowdown mangos isn't the best way. Better it would be as said XeNoW.

it isn't filling the db, the idea behind is, that you have a housekeeping script which runs daily on the server and removes all characters which have deleteDate < now-30days

Link to comment
Share on other sites

Yes I know, sorry but I don't like your patch.. reasons are posted above.. Filling database and slowdown mangos isn't the best way. Better it would be as said XeNoW.

I think this stuff would qualify for an additional setting in mangos.conf.

Something like "full deletion", "delinking", "deletion with pdump".

Having over 20k chars on my server, tons of noobs who regulary "accidently" delete their stuff (however that is possible) and a database which can take it, i'd really appreciate some flexibilty on char deletion.

#    CharDeletion
#        Character Deletion Behavior
#        Default: 0 - Full deletion without restoration point
#                      1 - Deletion with pdump of the character
#                      2 - Delinking, char gets delinked from the account, name gets freed up and appears as deleted ingame
#
####################################################################################################################

CharDeletion = 0

Just some template for further thoughts.

Link to comment
Share on other sites

Maybe it would be better to only save deleted characters above level 20 or something like that.

ok, i'll do now two flags in the config file: CharDeletion.Mode and CharDeletion.MinLevel, is that so ok for you? with that you're free to expand this how ever you want to.

Link to comment
Share on other sites

Actually, wouldn't it be better to prevent deletion on an account basis?

In other words: set a flag in each row of the account table to allow/disallow/change the mode in which character deletion works for that account?

And perhaps a .conf option to choose the default value for that column (for new rows) and a chat command to change it (for existing ones)?

Link to comment
Share on other sites

Actually, wouldn't it be better to prevent deletion on an account basis?

In other words: set a flag in each row of the account table to allow/disallow/change the mode in which character deletion works for that account?

And perhaps a .conf option to choose the default value for that column (for new rows) and a chat command to change it (for existing ones)?

Good idea

Enable or Disable char deletion

Link to comment
Share on other sites

Good idea

Enable or Disable char deletion

i don't think that this is a good idea, because users should be able to delete their chars on the normal way, BUT we (admins,gms,scripters) should also be able to restore those characters in an easy way.

but hey, when i've implemented the config option you can do it yourself and just check the option for e.g. the value 2 ;)

Link to comment
Share on other sites

It seems to me that you misunderstood my suggestion: I did not mean to say that thet flag must be boolean (as in: EITHER enable OR disable char deletion), just that I deem it better to save it for each account (so that it can differ between accounts).

It's true that doing it through a flag for each account WOULD use slightly more memory than setting a single flag to be used for every and single one of them (or a part of them,those that meets certain criteria outlined above), but this would reduce flexibility. And since memory is a non issue in this instance (loading a single smallint flag isnt worth much even if done with thousands of accounts) why not allow some measure of customization for users and admins (since this IS, after all, a CUSTOM yet very welcome addition).

Just my thougts, of course...

Link to comment
Share on other sites

*updated* http://github.com/DasBlub/mangos/tree/no_char_delete

getting now the settings from the config file. please note, that you have to apply the changes to the default config also to your own config file. so to enable this patch for all characters just paste this code in:

#    CharDeletion.Mode
#        Character Deletion Behavior
#        Default: 0  - Full deletion without restoration point
#                 1  - Delinking, char gets delinked from the account, name gets freed up and appears as deleted ingame
#                 2  - Deletion with pdump of the character
#    CharDeletion.MinLevel
#        Character gets deleted by CharDeletion.Mode=0 when the character hasn't the specified level yet.
#        Default: 0  - For every character the specified mode will be used
#                 1+ - Only for players which have reached the specified level get deleted by the specified mode.
#                      the rest will be deleted by CharDeletion.Mode=0
#
####################################################################################################################

CharDeletion.Mode = 1
CharDeletion.MinLevel = 0

CharDeletion.MinLevel has no effect, because i can't get the level from the player.

has anyone an idea how to get the player level? i've tried it with that:

objmgr.GetPlayer(playerguid)->getLevel()

but then, mangos crashes in Object::GetUInt32Value...

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use