mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/CharacterDatabaseCleaner: Implement CLEANING_FLAG_QUESTSTATUS flag for queststatus cleaning (most of the deleted rows are abandoned quests)
--HG-- branch : trunk
This commit is contained in:
@@ -9,6 +9,7 @@ from characters in the database.
|
||||
CLEANING_FLAG_SKILLS = 0x2
|
||||
CLEANING_FLAG_SPELLS = 0x4
|
||||
CLEANING_FLAG_TALENTS = 0x8
|
||||
CLEANING_FLAG_QUESTSTATUS = 0x10
|
||||
|
||||
Example:
|
||||
We want to clean up old talents, spells and skills, but leave
|
||||
|
||||
@@ -52,6 +52,9 @@ void CharacterDatabaseCleaner::CleanDatabase()
|
||||
if (flags & CLEANING_FLAG_TALENTS)
|
||||
CleanCharacterTalent();
|
||||
|
||||
if (flags & CLEANING_FLAG_QUESTSTATUS)
|
||||
CleanCharacterQuestStatus();
|
||||
|
||||
CharacterDatabase.DirectExecute("UPDATE worldstates SET value = 0 WHERE entry = 20004");
|
||||
|
||||
sLog->outString(">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime));
|
||||
@@ -143,3 +146,8 @@ void CharacterDatabaseCleaner::CleanCharacterTalent()
|
||||
CheckUnique("spell", "character_talent", &TalentCheck);
|
||||
}
|
||||
|
||||
void CharacterDatabaseCleaner::CleanCharacterQuestStatus()
|
||||
{
|
||||
CharacterDatabase.DirectExecute("DELETE FROM character_queststatus WHERE status = 0");
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ namespace CharacterDatabaseCleaner
|
||||
CLEANING_FLAG_ACHIEVEMENT_PROGRESS = 0x1,
|
||||
CLEANING_FLAG_SKILLS = 0x2,
|
||||
CLEANING_FLAG_SPELLS = 0x4,
|
||||
CLEANING_FLAG_TALENTS = 0x8
|
||||
CLEANING_FLAG_TALENTS = 0x8,
|
||||
CLEANING_FLAG_QUESTSTATUS = 0x10
|
||||
};
|
||||
|
||||
void CleanDatabase();
|
||||
@@ -42,6 +43,7 @@ namespace CharacterDatabaseCleaner
|
||||
void CleanCharacterSkills();
|
||||
void CleanCharacterSpell();
|
||||
void CleanCharacterTalent();
|
||||
void CleanCharacterQuestStatus();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user