TrinityCore
Loading...
Searching...
No Matches
WhoPackets.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "WhoPackets.h"
19
21{
26
33
35{
36 data >> word.Word;
37
38 return data;
39}
40
42{
43 data >> request.MinLevel;
44 data >> request.MaxLevel;
45 data >> request.Name;
46 data >> request.Guild;
47 data >> request.RaceFilter;
48 data >> request.ClassFilter;
49
50 request.Areas.resize(data.read<uint32>());
51 for (int32& area : request.Areas)
52 data >> area;
53
54 request.Words.resize(data.read<uint32>());
55 for (WhoWord& word : request.Words)
56 data >> word;
57
58 return data;
59}
60
65
67{
68 data << entry.Name;
69 data << entry.GuildName;
70 data << int32(entry.Level);
71 data << int32(entry.ClassID);
72 data << int32(entry.Race);
73 data << uint8(entry.Sex);
74 data << int32(entry.AreaID);
75
76 return data;
77}
78
80{
81 data << uint32(response.Entries.size());
82 data << uint32(response.TotalMatches);
83
84 for (size_t i = 0; i < response.Entries.size(); ++i)
85 data << response.Entries[i];
86
87 return data;
88}
89
96}
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
size_type size() const
void resize(size_type newSize)
WorldPacket _worldPacket
Definition Packet.h:42
WorldPacket const * Write() override
WorldPacket const * Write() override
ByteBuffer & operator<<(ByteBuffer &data, WhoEntry const &entry)
ByteBuffer & operator>>(ByteBuffer &data, WhoWord &word)
std::string_view Name
Definition WhoPackets.h:78
std::string_view GuildName
Definition WhoPackets.h:79