TrinityCore
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 WhoPackets_h__
19#define WhoPackets_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 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
56 {
60 };
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 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 IsFromAddOn = false;
91 };
92
93 struct WhoEntry
94 {
98 std::string GuildName;
100 bool IsGM = false;
101 };
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 // WhoPackets_h__
uint8_t uint8
Definition: Define.h:144
#define SI64LIT(N)
Definition: Define.h:130
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
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
Definition: WhoPackets.cpp:25
Array< int32, 10 > Areas
Definition: WhoPackets.h:90
WhoRequestPkt(WorldPacket &&packet)
Definition: WhoPackets.h:82
WorldPacket const * Write() override
Definition: WhoPackets.cpp:129
@ CMSG_WHO
Definition: Opcodes.h:894
@ CMSG_WHO_IS
Definition: Opcodes.h:895
@ SMSG_WHO
Definition: Opcodes.h:2073
@ SMSG_WHO_IS
Definition: Opcodes.h:2074
STL namespace.
Query::PlayerGuidLookupData PlayerData
Definition: WhoPackets.h:95
std::vector< WhoWord > Words
Definition: WhoPackets.h:72
Trinity::RaceMask< int64 > RaceFilter
Definition: WhoPackets.h:70
Optional< WhoRequestServerInfo > ServerInfo
Definition: WhoPackets.h:76
std::string GuildVirtualRealmName
Definition: WhoPackets.h:69
std::vector< WhoEntry > Entries
Definition: WhoPackets.h:105