Core/Handlers: removed useless db query

This commit is contained in:
joschiwald
2016-07-09 13:16:08 +02:00
parent 14b93c04ee
commit c96f53e85f

View File

@@ -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)