Core/Protocol:
- Correct the use of first byte in SMSG_NAME_QUERY_RESPONSE - Send guid and name in SMSG_CHAR_RENAME for failing results too
This commit is contained in:
@@ -1119,8 +1119,10 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
|
|||||||
uint8 res = ObjectMgr::CheckPlayerName(newName, true);
|
uint8 res = ObjectMgr::CheckPlayerName(newName, true);
|
||||||
if (res != CHAR_NAME_SUCCESS)
|
if (res != CHAR_NAME_SUCCESS)
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
WorldPacket data(SMSG_CHAR_RENAME, 1+8+(newName.size()+1));
|
||||||
data << uint8(res);
|
data << uint8(res);
|
||||||
|
data << uint64(guid);
|
||||||
|
data << newName;
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1451,6 +1453,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
|
|||||||
std::string oldname = result->Fetch()[0].GetString();
|
std::string oldname = result->Fetch()[0].GetString();
|
||||||
sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str());
|
sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair);
|
Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair);
|
||||||
|
|
||||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN);
|
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN);
|
||||||
|
|||||||
@@ -33,42 +33,39 @@
|
|||||||
|
|
||||||
void WorldSession::SendNameQueryOpcode(uint64 guid)
|
void WorldSession::SendNameQueryOpcode(uint64 guid)
|
||||||
{
|
{
|
||||||
Player* player = NULL;
|
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||||
const CharacterNameData* nameData = sWorld->GetCharacterNameData(GUID_LOPART(guid));
|
CharacterNameData const* nameData = sWorld->GetCharacterNameData(GUID_LOPART(guid));
|
||||||
if (nameData)
|
|
||||||
player = ObjectAccessor::FindPlayer(guid);
|
|
||||||
|
|
||||||
// guess size
|
|
||||||
WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8+1+1+1+1+1+10));
|
WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8+1+1+1+1+1+10));
|
||||||
data.appendPackGUID(guid);
|
data.appendPackGUID(guid);
|
||||||
data << uint8(0); // added in 3.1
|
if (!player)
|
||||||
if (nameData)
|
|
||||||
{
|
{
|
||||||
data << nameData->m_name; // played name
|
data << uint8(1); // player unknown
|
||||||
data << uint8(0); // realm name for cross realm BG usage
|
SendPacket(&data);
|
||||||
data << uint8(nameData->m_race);
|
return;
|
||||||
data << uint8(nameData->m_gender);
|
|
||||||
data << uint8(nameData->m_class);
|
|
||||||
}
|
}
|
||||||
else
|
if (!nameData)
|
||||||
{
|
{
|
||||||
data << std::string(GetTrinityString(LANG_NON_EXIST_CHARACTER));
|
data << uint8(2); // name unknown
|
||||||
data << uint32(0);
|
SendPacket(&data);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player)
|
data << uint8(0); // name known
|
||||||
|
data << nameData->m_name; // played name
|
||||||
|
data << uint8(0); // realm name - only set for cross realm interaction (such as Battlegrounds)
|
||||||
|
data << uint8(nameData->m_race);
|
||||||
|
data << uint8(nameData->m_gender);
|
||||||
|
data << uint8(nameData->m_class);
|
||||||
|
|
||||||
|
if (DeclinedName const* names = player->GetDeclinedNames())
|
||||||
{
|
{
|
||||||
if (DeclinedName const* names = player->GetDeclinedNames())
|
data << uint8(1); // Name is declined
|
||||||
{
|
for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||||
data << uint8(1); // is declined
|
data << names->name[i];
|
||||||
for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
|
||||||
data << names->name[i];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
data << uint8(0); // is not declined
|
|
||||||
}
|
}
|
||||||
else //TODO: decline names may also need to be stored in char name data
|
else
|
||||||
data << uint8(0);
|
data << uint8(0); // Name is not declined
|
||||||
|
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
}
|
}
|
||||||
@@ -76,7 +73,6 @@ void WorldSession::SendNameQueryOpcode(uint64 guid)
|
|||||||
void WorldSession::HandleNameQueryOpcode(WorldPacket& recv_data)
|
void WorldSession::HandleNameQueryOpcode(WorldPacket& recv_data)
|
||||||
{
|
{
|
||||||
uint64 guid;
|
uint64 guid;
|
||||||
|
|
||||||
recv_data >> guid;
|
recv_data >> guid;
|
||||||
|
|
||||||
// This is disable by default to prevent lots of console spam
|
// This is disable by default to prevent lots of console spam
|
||||||
|
|||||||
Reference in New Issue
Block a user