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
26
namespace
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
:
43
explicit
WhoIsResponse
() :
ServerPacket
(
SMSG_WHO_IS
, 2) { }
44
45
WorldPacket
const
*
Write
()
override
;
46
47
std::string
AccountName
;
48
};
49
50
struct
WhoWord
51
{
52
std::string
Word
;
53
};
54
55
struct
WhoRequestServerInfo
56
{
57
uint8
FactionGroup
= 0;
58
int32
Locale
= 0;
59
uint32
RequesterVirtualRealmAddress
= 0;
60
};
61
62
struct
WhoRequest
63
{
64
int32
MinLevel
= 0;
65
int32
MaxLevel
= 0;
66
std::string
Name
;
67
std::string
VirtualRealmName
;
68
std::string
Guild
;
69
std::string
GuildVirtualRealmName
;
70
Trinity::RaceMask<std::array<int32, 2>
>
RaceFilter
= { 0, 0 };
71
int32
ClassFilter
= -1;
72
std::vector<WhoWord>
Words
;
73
bool
ShowEnemies
=
false
;
74
bool
ShowArenaPlayers
=
false
;
75
bool
ExactName
=
false
;
76
Optional<WhoRequestServerInfo>
ServerInfo
;
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
86
WhoRequest
Request
;
87
uint32
Token
= 0;
88
uint8
Origin
= 0;
// 1 = Social, 2 = Chat, 3 = Item
89
bool
IsAddon
=
false
;
90
Array<int32, 10>
Areas
;
91
};
92
93
struct
WhoEntry
94
{
95
Query::PlayerGuidLookupData
PlayerData
;
96
ObjectGuid
GuildGUID
;
97
uint32
GuildVirtualRealmAddress
= 0;
98
std::string
GuildName
;
99
int32
AreaID
= 0;
100
bool
IsGM
=
false
;
101
};
102
103
struct
WhoResponse
104
{
105
std::vector<WhoEntry>
Entries
;
106
};
107
108
class
WhoResponsePkt
final :
public
ServerPacket
109
{
110
public
:
111
explicit
WhoResponsePkt
() :
ServerPacket
(
SMSG_WHO
, 1) { }
112
113
WorldPacket
const
*
Write
()
override
;
114
115
uint32
Token
= 0;
116
WhoResponse
Response
;
117
};
118
}
119
}
120
121
#endif
// TRINITYCORE_WHO_PACKETS_H
uint8
uint8_t uint8
Definition
Define.h:156
int32
int32_t int32
Definition
Define.h:150
uint32
uint32_t uint32
Definition
Define.h:154
ObjectGuid.h
SMSG_WHO
@ SMSG_WHO
Definition
Opcodes.h:2464
SMSG_WHO_IS
@ SMSG_WHO_IS
Definition
Opcodes.h:2465
CMSG_WHO
@ CMSG_WHO
Definition
Opcodes.h:1039
CMSG_WHO_IS
@ CMSG_WHO_IS
Definition
Opcodes.h:1040
Optional
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition
Optional.h:25
Packet.h
QueryPackets.h
RaceMask.h
ObjectGuid
Definition
ObjectGuid.h:308
WorldPacket
Definition
WorldPacket.h:26
WorldPackets::Array
Definition
PacketUtilities.h:170
WorldPackets::ClientPacket
Definition
Packet.h:61
WorldPackets::ServerPacket
Definition
Packet.h:47
WorldPackets::Who::WhoIsRequest
Definition
WhoPackets.h:31
WorldPackets::Who::WhoIsRequest::WhoIsRequest
WhoIsRequest(WorldPacket &&packet)
Definition
WhoPackets.h:33
WorldPackets::Who::WhoIsRequest::CharName
std::string CharName
Definition
WhoPackets.h:37
WorldPackets::Who::WhoIsRequest::Read
void Read() override
Definition
WhoPackets.cpp:23
WorldPackets::Who::WhoIsResponse
Definition
WhoPackets.h:41
WorldPackets::Who::WhoIsResponse::AccountName
std::string AccountName
Definition
WhoPackets.h:47
WorldPackets::Who::WhoIsResponse::Write
WorldPacket const * Write() override
Definition
WhoPackets.cpp:29
WorldPackets::Who::WhoIsResponse::WhoIsResponse
WhoIsResponse()
Definition
WhoPackets.h:43
WorldPackets::Who::WhoRequestPkt
Definition
WhoPackets.h:80
WorldPackets::Who::WhoRequestPkt::Areas
Array< int32, 10 > Areas
Definition
WhoPackets.h:90
WorldPackets::Who::WhoRequestPkt::IsAddon
bool IsAddon
Definition
WhoPackets.h:89
WorldPackets::Who::WhoRequestPkt::Request
WhoRequest Request
Definition
WhoPackets.h:86
WorldPackets::Who::WhoRequestPkt::Read
void Read() override
Definition
WhoPackets.cpp:88
WorldPackets::Who::WhoRequestPkt::Origin
uint8 Origin
Definition
WhoPackets.h:88
WorldPackets::Who::WhoRequestPkt::Token
uint32 Token
Definition
WhoPackets.h:87
WorldPackets::Who::WhoRequestPkt::WhoRequestPkt
WhoRequestPkt(WorldPacket &&packet)
Definition
WhoPackets.h:82
WorldPackets::Who::WhoResponsePkt
Definition
WhoPackets.h:109
WorldPackets::Who::WhoResponsePkt::Response
WhoResponse Response
Definition
WhoPackets.h:116
WorldPackets::Who::WhoResponsePkt::WhoResponsePkt
WhoResponsePkt()
Definition
WhoPackets.h:111
WorldPackets::Who::WhoResponsePkt::Write
WorldPacket const * Write() override
Definition
WhoPackets.cpp:128
WorldPackets::Who::WhoResponsePkt::Token
uint32 Token
Definition
WhoPackets.h:115
WorldPackets
Definition
GameObjectAI.h:36
std
STL namespace.
Trinity::RaceMask
Definition
RaceMask.h:91
WorldPackets::Query::PlayerGuidLookupData
Definition
QueryPackets.h:115
WorldPackets::Who::WhoEntry
Definition
WhoPackets.h:94
WorldPackets::Who::WhoEntry::AreaID
int32 AreaID
Definition
WhoPackets.h:99
WorldPackets::Who::WhoEntry::GuildVirtualRealmAddress
uint32 GuildVirtualRealmAddress
Definition
WhoPackets.h:97
WorldPackets::Who::WhoEntry::PlayerData
Query::PlayerGuidLookupData PlayerData
Definition
WhoPackets.h:95
WorldPackets::Who::WhoEntry::GuildGUID
ObjectGuid GuildGUID
Definition
WhoPackets.h:96
WorldPackets::Who::WhoEntry::GuildName
std::string GuildName
Definition
WhoPackets.h:98
WorldPackets::Who::WhoEntry::IsGM
bool IsGM
Definition
WhoPackets.h:100
WorldPackets::Who::WhoRequestServerInfo
Definition
WhoPackets.h:56
WorldPackets::Who::WhoRequestServerInfo::Locale
int32 Locale
Definition
WhoPackets.h:58
WorldPackets::Who::WhoRequestServerInfo::RequesterVirtualRealmAddress
uint32 RequesterVirtualRealmAddress
Definition
WhoPackets.h:59
WorldPackets::Who::WhoRequestServerInfo::FactionGroup
uint8 FactionGroup
Definition
WhoPackets.h:57
WorldPackets::Who::WhoRequest
Definition
WhoPackets.h:63
WorldPackets::Who::WhoRequest::Words
std::vector< WhoWord > Words
Definition
WhoPackets.h:72
WorldPackets::Who::WhoRequest::RaceFilter
Trinity::RaceMask< std::array< int32, 2 > > RaceFilter
Definition
WhoPackets.h:70
WorldPackets::Who::WhoRequest::MaxLevel
int32 MaxLevel
Definition
WhoPackets.h:65
WorldPackets::Who::WhoRequest::Guild
std::string Guild
Definition
WhoPackets.h:68
WorldPackets::Who::WhoRequest::ExactName
bool ExactName
Definition
WhoPackets.h:75
WorldPackets::Who::WhoRequest::VirtualRealmName
std::string VirtualRealmName
Definition
WhoPackets.h:67
WorldPackets::Who::WhoRequest::ClassFilter
int32 ClassFilter
Definition
WhoPackets.h:71
WorldPackets::Who::WhoRequest::Name
std::string Name
Definition
WhoPackets.h:66
WorldPackets::Who::WhoRequest::ShowArenaPlayers
bool ShowArenaPlayers
Definition
WhoPackets.h:74
WorldPackets::Who::WhoRequest::ShowEnemies
bool ShowEnemies
Definition
WhoPackets.h:73
WorldPackets::Who::WhoRequest::ServerInfo
Optional< WhoRequestServerInfo > ServerInfo
Definition
WhoPackets.h:76
WorldPackets::Who::WhoRequest::MinLevel
int32 MinLevel
Definition
WhoPackets.h:64
WorldPackets::Who::WhoRequest::GuildVirtualRealmName
std::string GuildVirtualRealmName
Definition
WhoPackets.h:69
WorldPackets::Who::WhoResponse
Definition
WhoPackets.h:104
WorldPackets::Who::WhoResponse::Entries
std::vector< WhoEntry > Entries
Definition
WhoPackets.h:105
WorldPackets::Who::WhoWord
Definition
WhoPackets.h:51
WorldPackets::Who::WhoWord::Word
std::string Word
Definition
WhoPackets.h:52
server
game
Server
Packets
WhoPackets.h
Generated on Sun May 10 2026 02:09:03 for TrinityCore by
1.9.8