Jump to content

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


Guest DasBlub

Recommended Posts

*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...

Player::LoadValuesArrayFromDB(Tokens data, playerguid);
uint32 level = Player::GetUInt32ValueFromArray(data, UNIT_FIELD_LEVEL);

Link to comment
Share on other sites

  • Replies 90
  • Created
  • Last Reply

Top Posters In This Topic

[quot

search the code for an example

look at level3.cpp

Tokens data;
Player::LoadValuesArrayFromDB(data,targetGUID);
level = Player::GetUInt32ValueFromArray(data, UNIT_FIELD_LEVEL);

data get it's values cause you give it to "loadv..." by reference..

tanks! i haven't seen the first line with LoadValuesArrayFromDB, shame on me :(

btw why is here written, that your post is from today, 12:45 AM? it's 08:10 AM... shouldn't it be 00:45 AM? because my last post is also from today 12:10 AM but i've written it tonight (seems like it has been allready today ;))

Link to comment
Share on other sites

While I like the idea to do have a "lazy character deletion", I personally disagree with exporting the housekeeping task to an external script. Having a configuration entry to define the time after which those characters are deleted once and for all seems more reasonable.

Link to comment
Share on other sites

While I like the idea to do have a "lazy character deletion", I personally disagree with exporting the housekeeping task to an external script. Having a configuration entry to define the time after which those characters are deleted once and for all seems more reasonable.

i just got the same idea ;)

but where to implement this? is there allready such a function? i only know that there is a function for the daily quests which get's called every day at 6 o'clock, should i implement it the same way?

thanks for the answer(s) :D

Link to comment
Share on other sites

ok, after having some trubles with the db, now i've finished it finally :D

check it out on the common way over git: http://github.com/DasBlub/mangos/tree/no_char_delete

now you can set an option in the config file which specifies the keep days.

NOTE: there has been a change in the db structure, i've split up the field 'deleteInfos' into 'deleteInfos_Name' and 'deleteInfos_Account'. you need to execute the sql file sql/updates/no_char_delete/no_char_delete.sql

because i think, that nobody has used this patch until now on a prod. system, i haven't written an update for the table.

Link to comment
Share on other sites

ok, after having some trubles with the db, now i've finished it finally :D

check it out on the common way over git: http://github.com/DasBlub/mangos/tree/no_char_delete

now you can set an option in the config file which specifies the keep days.

NOTE: there has been a change in the db structure, i've split up the field 'deleteInfos' into 'deleteInfos_Name' and 'deleteInfos_Account'. you need to execute the sql file sql/updates/no_char_delete/no_char_delete.sql

because i think, that nobody has used this patch until now on a prod. system, i haven't written an update for the table.

 uint64 guid = charFields[0].GetUInt64();;
uint64 accountId = charFields[1].GetUInt32();
Player::DeleteFromDB(charFields[0].GetUInt64(),accountId,true,true);

why not use in DeleteFromDB variable guid defined above ?

Link to comment
Share on other sites

 uint64 guid = charFields[0].GetUInt64();;
uint64 accountId = charFields[1].GetUInt32();
Player::DeleteFromDB(charFields[0].GetUInt64(),accountId,true,true);

why not use in DeleteFromDB variable guid defined above ?

ouch. ok haven't seen it :( just updated, thanks :D

ps: charlie, your name is in my commit :D

Link to comment
Share on other sites

  • 2 weeks later...
Why not use currently existed functionlaity save character dump with enabled CharLogDump config option...

dont work every rev, sometimes i got uncompleted dumps:( sometimes no dump at all

and is harder way for not experienced users. so options in config could be nice features

this option is good idea . had many problems with char deletion..

Link to comment
Share on other sites

Why not use currently existed functionlaity save character dump with enabled CharLogDump config option...

because this works only well, when the db has not changed since the dump has been created. else you can't load the dump anymore (or only with a high amount of working)...

and how you see, i've done it over a config flag, so this patch could be extended by an automatic pdump option...

Link to comment
Share on other sites

updated to newest revision.

please, can any dev give once a statement, if this patch will go into git or not?

we've running it on our server, and we've no problems with the db (in 3 days 800 chars deleted). so it seems to work well also with big amount of characters.

please, can anyone give a final statement? we are using it on our server and it works fine (no lags based on that patch).

i just don't like it if my patch rests for the rest of it's (binary) live in this thread without any responsy from a dev ;)

Link to comment
Share on other sites

Why not use currently existed functionlaity save character dump with enabled CharLogDump config option...

i believe that this would bring things much closer to official. if something like this could be implemented for item deletions as well. on official if you accidently destroy an item a gm can restore it after investigating if you ever actually had it. granted you have to submit a ticket within 24 hours.

obviously on official they don't actually delete data as if that were the case it would be impossible to know if you had the item. also if they do a dump on evey delete it would become very cumbersome to go through log files to see if you had in fact destroyed the item. you can also have characters restored within 1-2 hours which leads me to believe that something along the lines of this patch is used on official.

ofcourse we can't really know if this is the exact method used but what we can be fairly sure of is that they have something of this sort in place.

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