Skip to content

Commit 2ecb9ee

Browse files
author
linencloth
committed
Core/CharacterDatabaseCleaner: Implement CLEANING_FLAG_QUESTSTATUS flag for queststatus cleaning (most of the deleted rows are abandoned quests)
--HG-- branch : trunk
1 parent 1d9a75c commit 2ecb9ee

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

doc/CharacterDBCleanup.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ from characters in the database.
99
CLEANING_FLAG_SKILLS = 0x2
1010
CLEANING_FLAG_SPELLS = 0x4
1111
CLEANING_FLAG_TALENTS = 0x8
12+
CLEANING_FLAG_QUESTSTATUS = 0x10
1213

1314
Example:
1415
We want to clean up old talents, spells and skills, but leave

src/server/game/Tools/CharacterDatabaseCleaner.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ void CharacterDatabaseCleaner::CleanDatabase()
5252
if (flags & CLEANING_FLAG_TALENTS)
5353
CleanCharacterTalent();
5454

55+
if (flags & CLEANING_FLAG_QUESTSTATUS)
56+
CleanCharacterQuestStatus();
57+
5558
CharacterDatabase.DirectExecute("UPDATE worldstates SET value = 0 WHERE entry = 20004");
5659

5760
sLog->outString(">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime));
@@ -143,3 +146,8 @@ void CharacterDatabaseCleaner::CleanCharacterTalent()
143146
CheckUnique("spell", "character_talent", &TalentCheck);
144147
}
145148

149+
void CharacterDatabaseCleaner::CleanCharacterQuestStatus()
150+
{
151+
CharacterDatabase.DirectExecute("DELETE FROM character_queststatus WHERE status = 0");
152+
}
153+

src/server/game/Tools/CharacterDatabaseCleaner.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ namespace CharacterDatabaseCleaner
2626
CLEANING_FLAG_ACHIEVEMENT_PROGRESS = 0x1,
2727
CLEANING_FLAG_SKILLS = 0x2,
2828
CLEANING_FLAG_SPELLS = 0x4,
29-
CLEANING_FLAG_TALENTS = 0x8
29+
CLEANING_FLAG_TALENTS = 0x8,
30+
CLEANING_FLAG_QUESTSTATUS = 0x10
3031
};
3132

3233
void CleanDatabase();
@@ -42,6 +43,7 @@ namespace CharacterDatabaseCleaner
4243
void CleanCharacterSkills();
4344
void CleanCharacterSpell();
4445
void CleanCharacterTalent();
46+
void CleanCharacterQuestStatus();
4547
}
4648

4749
#endif

0 commit comments

Comments
 (0)