Core/World: Store account id in CharacterInfo to reduce the amount of database queries
(cherry picked from commit aaaa1c34410c160c7b0382f5ecdb39fa01ba007c)
(cherry picked from commit 4a36850167)
Conflicts:
src/server/game/Handlers/CharacterHandler.cpp
src/server/game/World/World.cpp
This commit is contained in:
1 parent
b7d37daa74
commit
ce7fc03930
15 files changed
+91
-104
No files matched your search
@@ -4551,14 +4551,14 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
|
||||
|
||||
if (deleteFinally)
|
||||
charDelete_method = CHAR_DELETE_REMOVE;
|
||||
else if (CharacterNameData const* nameData = sWorld->GetCharacterNameData(playerguid)) // To avoid a query, we select loaded data. If it doesn't exist, return.
|
||||
else if (CharacterInfo const* nameData = sWorld->GetCharacterInfo(playerguid)) // To avoid a query, we select loaded data. If it doesn't exist, return.
|
||||
{
|
||||
// Define the required variables
|
||||
uint32 charDelete_minLvl = sWorld->getIntConfig(nameData->m_class != CLASS_DEATH_KNIGHT ? CONFIG_CHARDELETE_MIN_LEVEL : CONFIG_CHARDELETE_HEROIC_MIN_LEVEL);
|
||||
uint32 charDelete_minLvl = sWorld->getIntConfig(nameData->Class != CLASS_DEATH_KNIGHT ? CONFIG_CHARDELETE_MIN_LEVEL : CONFIG_CHARDELETE_HEROIC_MIN_LEVEL);
|
||||
|
||||
// if we want to finalize the character removal or the character does not meet the level requirement of either heroic or non-heroic settings,
|
||||
// we set it to mode CHAR_DELETE_REMOVE
|
||||
if (nameData->m_level < charDelete_minLvl)
|
||||
if (nameData->Level < charDelete_minLvl)
|
||||
charDelete_method = CHAR_DELETE_REMOVE;
|
||||
}
|
||||
|
||||
@@ -4885,7 +4885,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
|
||||
if (updateRealmChars)
|
||||
sWorld->UpdateRealmCharCount(accountId);
|
||||
|
||||
sWorld->DeleteCharacterNameData(playerguid);
|
||||
sWorld->DeleteCharacterInfo(playerguid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user