mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/DB:
- Only use configured PersistentFlags for character database cleaner to determine data saving behaviour during runtime, instead of all original flags set in worldstates. - Remove the forced deletion of abandoned quest entries in 10828_characters_character_queststatus.sql for those who do not want to lose that data. If you want to purge that data then run the core with CleanupFlags & 0x10. If you want to both purge the data now and prevent it from being saved in the future, run the core with CleanupFlags & 0x10 AND PersistentCleanupFlags & 0x10 --HG-- branch : trunk
This commit is contained in:
@@ -38,8 +38,7 @@ void CharacterDatabaseCleaner::CleanDatabase()
|
||||
return;
|
||||
|
||||
uint32 flags = (*result)[0].GetUInt32();
|
||||
sWorld->SetCleaningFlags(flags);
|
||||
|
||||
|
||||
// clean up
|
||||
if (flags & CLEANING_FLAG_ACHIEVEMENT_PROGRESS)
|
||||
CleanCharacterAchievementProgress();
|
||||
@@ -56,7 +55,12 @@ void CharacterDatabaseCleaner::CleanDatabase()
|
||||
if (flags & CLEANING_FLAG_QUESTSTATUS)
|
||||
CleanCharacterQuestStatus();
|
||||
|
||||
CharacterDatabase.DirectPExecute("UPDATE worldstates SET value = value & %u WHERE entry = 20004", sWorld->getIntConfig(CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS));
|
||||
// NOTE: In order to have persistentFlags be set in worldstates for the next cleanup,
|
||||
// you need to define them at least once in worldstates.
|
||||
flags &= sWorld->getIntConfig(CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS);
|
||||
CharacterDatabase.DirectPExecute("UPDATE worldstates SET value = %u WHERE entry = 20004", flags);
|
||||
|
||||
sWorld->SetCleaningFlags(flags);
|
||||
|
||||
sLog->outString(">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
|
||||
Reference in New Issue
Block a user