mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/Handlers: removed useless db query
This commit is contained in:
@@ -1370,7 +1370,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
|
||||
uint8 plrRace = fields[0].GetUInt8();
|
||||
uint8 plrClass = fields[1].GetUInt8();
|
||||
uint8 plrGender = fields[2].GetUInt8();
|
||||
std::string plrName = fields[4].GetString();
|
||||
std::string oldName = fields[4].GetString();
|
||||
|
||||
if (!Player::ValidateAppearance(plrRace, plrClass, plrGender, customizeInfo.HairStyle, customizeInfo.HairColor, customizeInfo.Face, customizeInfo.FacialHair, customizeInfo.Skin, true))
|
||||
{
|
||||
@@ -1400,7 +1400,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
// prevent character rename
|
||||
if (sWorld->getBoolConfig(CONFIG_PREVENT_RENAME_CUSTOMIZATION) && (customizeInfo.Name != plrName))
|
||||
if (sWorld->getBoolConfig(CONFIG_PREVENT_RENAME_CUSTOMIZATION) && (customizeInfo.Name != oldName))
|
||||
{
|
||||
SendCharCustomize(CHAR_NAME_FAILURE, customizeInfo);
|
||||
return;
|
||||
@@ -1437,17 +1437,6 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
|
||||
}
|
||||
}
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME);
|
||||
stmt->setUInt32(0, customizeInfo.Guid.GetCounter());
|
||||
result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (result)
|
||||
{
|
||||
std::string oldname = result->Fetch()[0].GetString();
|
||||
TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s), Character[%s] (%s) Customized to: %s",
|
||||
GetAccountId(), GetRemoteAddress().c_str(), oldname.c_str(), customizeInfo.Guid.ToString().c_str(), customizeInfo.Name.c_str());
|
||||
}
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
Player::Customize(&customizeInfo, trans);
|
||||
@@ -1469,6 +1458,9 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
|
||||
sWorld->UpdateCharacterInfo(customizeInfo.Guid, customizeInfo.Name, customizeInfo.Gender);
|
||||
|
||||
SendCharCustomize(RESPONSE_SUCCESS, customizeInfo);
|
||||
|
||||
TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s), Character[%s] (%s) Customized to: %s",
|
||||
GetAccountId(), GetRemoteAddress().c_str(), oldName.c_str(), customizeInfo.Guid.ToString().c_str(), customizeInfo.Name.c_str());
|
||||
}
|
||||
|
||||
void WorldSession::HandleEquipmentSetSave(WorldPacket& recvData)
|
||||
|
||||
Reference in New Issue
Block a user