Core/Players: Reject logins flagged for rename earlier in Player::LoadFromDB
This commit is contained in:
@@ -18655,6 +18655,14 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol
|
||||
return false;
|
||||
}
|
||||
|
||||
m_atLoginFlags = fields.at_login;
|
||||
|
||||
if (HasAtLoginFlag(AT_LOGIN_RENAME))
|
||||
{
|
||||
TC_LOG_ERROR("entities.player.cheat", "Player::LoadFromDB: Player ({}) tried to login while forced to rename, can't load.'", guid.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
_Create(guid);
|
||||
|
||||
m_name = std::move(fields.name);
|
||||
@@ -18744,8 +18752,6 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol
|
||||
ReplaceAllPlayerFlagsEx(fields.playerFlagsEx);
|
||||
SetWatchedFactionIndex(fields.watchedFaction);
|
||||
|
||||
m_atLoginFlags = fields.at_login;
|
||||
|
||||
if (!GetSession()->ValidateAppearance(Races(GetRace()), Classes(GetClass()), fields.gender, MakeChrCustomizationChoiceRange(customizations)))
|
||||
{
|
||||
TC_LOG_ERROR("entities.player.loading", "Player::LoadFromDB: Player ({}) has wrong Appearance values (Hair/Skin/Color), can't load.", guid.ToString());
|
||||
@@ -19047,6 +19053,7 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol
|
||||
}
|
||||
}
|
||||
|
||||
// no early return is allowed past this point, player will be deleted and still referenced by the map and battleground AddPlayer can apply auras also
|
||||
SetMap(map);
|
||||
UpdatePositionData();
|
||||
|
||||
@@ -19094,12 +19101,6 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol
|
||||
|
||||
_LoadPetStable(fields.summonedPetNumber, holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_PET_SLOTS));
|
||||
|
||||
if (HasAtLoginFlag(AT_LOGIN_RENAME))
|
||||
{
|
||||
TC_LOG_ERROR("entities.player.cheat", "Player::LoadFromDB: Player ({}) tried to login while forced to rename, can't load.'", GetGUID().ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Honor system
|
||||
// Update Honor kills data
|
||||
m_lastHonorUpdateTime = logoutTime;
|
||||
|
||||
Reference in New Issue
Block a user