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:
linencloth
2010-12-28 04:26:25 +01:00
parent 1d9a75c338
commit 2ecb9eec8b
3 changed files with 12 additions and 1 deletions

View File

@@ -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

View File

@@ -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");
}

View File

@@ -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