Permalink
Browse files

Core/CharacterDatabaseCleaner: Implement CLEANING_FLAG_QUESTSTATUS fl…

…ag for queststatus cleaning (most of the deleted rows are abandoned quests)

--HG--
branch : trunk
  • Loading branch information...
1 parent 1d9a75c commit 2ecb9eec8b8bbd118431c4f799e3253f0aaefd75 linencloth committed Dec 28, 2010
@@ -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

0 comments on commit 2ecb9ee

Please sign in to comment.