Core/Packets: Added CMSG_PAGE_TEXT_QUERY and SMSG_PAGE_TEXT_QUERY_RESPONSE

Moved QueryPlayerName to QueryPackets
This commit is contained in:
Intel
2014-11-15 17:40:04 +02:00
parent 96fa1eb5ec
commit cd9be92395
7 changed files with 163 additions and 112 deletions
@@ -88,3 +88,68 @@ WorldPacket const* WorldPackets::Query::QueryCreatureResponse::Write()
return &_worldPacket;
}
void WorldPackets::Query::QueryPlayerName::Read()
{
_worldPacket >> Player;
Hint.VirtualRealmAddress.HasValue = _worldPacket.ReadBit();
Hint.NativeRealmAddress.HasValue = _worldPacket.ReadBit();
if (Hint.VirtualRealmAddress.HasValue)
_worldPacket >> Hint.VirtualRealmAddress.value;
if (Hint.NativeRealmAddress.HasValue)
_worldPacket >> Hint.NativeRealmAddress.value;
}
WorldPacket const* WorldPackets::Query::QueryPlayerNameResponse::Write()
{
_worldPacket << Result;
_worldPacket << Player;
if (Result == 0)
{
_worldPacket.WriteBits(Data.Name.length(), 7);
for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
_worldPacket.WriteBits(Data.DeclinedNames.name[i].length(), 7);
for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
_worldPacket.WriteString(Data.DeclinedNames.name[i]);
_worldPacket << Data.AccountID;
_worldPacket << Data.BnetAccountID;
_worldPacket << Data.GuidActual;
_worldPacket << Data.VirtualRealmAddress;
_worldPacket << Data.Race;
_worldPacket << Data.Sex;
_worldPacket << Data.ClassID;
_worldPacket << Data.Level;
_worldPacket.WriteString(Data.Name);
}
return &_worldPacket;
}
void WorldPackets::Query::QueryPageText::Read()
{
_worldPacket >> PageTextID;
_worldPacket >> ItemGUID;
}
WorldPacket const* WorldPackets::Query::QueryPageTextResponse::Write()
{
_worldPacket << PageTextID;
_worldPacket.WriteBit(Allow);
if (Allow)
{
_worldPacket << Info.ID;
_worldPacket << Info.NextPageID;
_worldPacket.WriteBits(Info.Text.length(), 12);
_worldPacket.WriteString(Info.Text);
}
return &_worldPacket;
}