TrinityCore
Loading...
Searching...
No Matches
WhoPackets.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
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#ifndef TRINITYCORE_WHO_PACKETS_H
19#define TRINITYCORE_WHO_PACKETS_H
20
21#include "Packet.h"
22#include "ObjectGuid.h"
23#include "QueryPackets.h"
24#include "RaceMask.h"
25
26namespace WorldPackets
27{
28 namespace Who
29 {
30 class WhoIsRequest final : public ClientPacket
31 {
32 public:
33 explicit WhoIsRequest(WorldPacket&& packet) : ClientPacket(CMSG_WHO_IS, std::move(packet)) { }
34
35 void Read() override;
36
37 std::string CharName;
38 };
39
40 class WhoIsResponse final : public ServerPacket
41 {
42 public:
44
45 WorldPacket const* Write() override;
46
47 std::string AccountName;
48 };
49
50 struct WhoWord
51 {
52 std::string Word;
53 };
54
61
63 {
66 std::string Name;
67 std::string VirtualRealmName;
68 std::string Guild;
72 std::vector<WhoWord> Words;
73 bool ShowEnemies = false;
74 bool ShowArenaPlayers = false;
75 bool ExactName = false;
77 };
78
79 class WhoRequestPkt final : public ClientPacket
80 {
81 public:
82 explicit WhoRequestPkt(WorldPacket&& packet) : ClientPacket(CMSG_WHO, std::move(packet)) { }
83
84 void Read() override;
85
88 uint8 Origin = 0; // 1 = Social, 2 = Chat, 3 = Item
89 bool IsAddon = false;
91 };
92
102
104 {
105 std::vector<WhoEntry> Entries;
106 };
107
108 class WhoResponsePkt final : public ServerPacket
109 {
110 public:
112
113 WorldPacket const* Write() override;
114
117 };
118 }
119}
120
121#endif // TRINITYCORE_WHO_PACKETS_H
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
@ SMSG_WHO
Definition Opcodes.h:2464
@ SMSG_WHO_IS
Definition Opcodes.h:2465
@ CMSG_WHO
Definition Opcodes.h:1039
@ CMSG_WHO_IS
Definition Opcodes.h:1040
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
WhoIsRequest(WorldPacket &&packet)
Definition WhoPackets.h:33
WorldPacket const * Write() override
WhoRequestPkt(WorldPacket &&packet)
Definition WhoPackets.h:82
WorldPacket const * Write() override
STL namespace.
Query::PlayerGuidLookupData PlayerData
Definition WhoPackets.h:95
std::vector< WhoWord > Words
Definition WhoPackets.h:72
Trinity::RaceMask< std::array< int32, 2 > > RaceFilter
Definition WhoPackets.h:70
Optional< WhoRequestServerInfo > ServerInfo
Definition WhoPackets.h:76
std::vector< WhoEntry > Entries
Definition WhoPackets.h:105