ok maybe your patch have better features, but if you are interested in just dumping chars > than a level, specifying directory of .sql pdumped files and switch this feature on and off, here is a patch that i wrote some days ago:
Index: Player.cpp
===================================================================
--- Player.cpp (revisione 917)
+++ Player.cpp (revisione 918)
@@ -16,6 +16,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include "Config/Config.h"
+#include "PlayerDump.h"
#include "Common.h"
#include "Language.h"
#include "Database/DatabaseEnv.h"
@@ -4097,6 +4101,31 @@
void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmChars)
{
+ if(sConfig.GetBoolDefault("DumpActive", 0))
+ {
+ QueryResult *resultPlayer = CharacterDatabase.PQuery("SELECT name, level FROM characters WHERE guid='%u' ", playerguid);
+ if(resultPlayer)
+ {
+ Field *fields = resultPlayer->Fetch();
+
+ std::string pname = "";
+ uint32 plevel = fields[1].GetUInt32();
+ if(sConfig.GetBoolDefault("DumpTimestamp", 0))
+ pname = fields[0].GetCppString() + "_" + Log::GetTimestampStr() + ".sql";
+ else
+ pname = fields[0].GetCppString() + ".sql";
+
+ if(plevel >= sConfig.GetIntDefault("DumpMinLevel", 0))
+ {
+ std::string directory = sConfig.GetStringDefault("DumpPath", "") + pname;
+ PlayerDumpWriter().WriteDump(directory, playerguid);
+ }
+ delete resultPlayer;
+ }
+ }
+
uint32 guid = GUID_LOPART(playerguid);
// convert corpse to bones if exist (to prevent exiting Corpse in World without DB entry)
really simple and short, maybe is not so good because it have to access to database everytime a character is deleted, but works both in 3.2.2a and 3.3.2a (i think also in 2.4.3 because is really simple but not yet tested)
you have to add in mangosd.conf file these lines (explanation excluded if u want ) :
###################################################################################################################
# Pdumps
#
# DumpActive
# Enable/disable dumps before character delete, 0 by default
#
# DumpPath
# Path where dump files are stored, default empty
#
# DumpMinLevel
# Minimum level to dump characters, default 0
#
# DumpTimestamp
# Add timestamps to dumped files, default 0
#
###################################################################################################################
DumpActive = 1
DumpPath = ""
DumpMinLevel = 40
DumpTimestamp = 1
Directory/path works exactly as DataDir or LogsDir.
Hope this helps.