TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SocialPackets.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 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 #ifndef SocialPackets_h__
19 #define SocialPackets_h__
20 
21 #include "Packet.h"
22 #include "ObjectGuid.h"
23 #include "SharedDefines.h"
24 
25 struct FriendInfo;
26 enum FriendsResult : uint8;
27 
28 namespace WorldPackets
29 {
30  namespace Social
31  {
32  class SendContactList final : public ClientPacket
33  {
34  public:
36 
37  void Read() override;
38 
39  uint32 Flags = 0;
40  };
41 
42  struct ContactInfo
43  {
44  ContactInfo(ObjectGuid const& guid, FriendInfo const& friendInfo);
45 
51  std::string Notes;
52  uint8 Status = 0;
56  };
57 
58  class ContactList final : public ServerPacket
59  {
60  public:
62 
63  WorldPacket const* Write() override;
64 
65  std::vector<ContactInfo> Contacts;
66  uint32 Flags = 0;
67  };
68 
69  class FriendStatus final : public ServerPacket
70  {
71  public:
73 
74  void Initialize(ObjectGuid const& guid, FriendsResult result, FriendInfo const& friendInfo);
75 
76  WorldPacket const* Write() override;
77 
79  std::string Notes;
81  uint8 Status = 0;
87  };
88 
90  {
93  };
94 
95  class AddFriend final : public ClientPacket
96  {
97  public:
98  AddFriend(WorldPacket&& packet) : ClientPacket(CMSG_ADD_FRIEND, std::move(packet)) { }
99 
100  void Read() override;
101 
102  std::string Notes;
103  std::string Name;
104  };
105 
106  class DelFriend final : public ClientPacket
107  {
108  public:
109  DelFriend(WorldPacket&& packet) : ClientPacket(CMSG_DEL_FRIEND, std::move(packet)) { }
110 
111  void Read() override;
112 
114  };
115 
116  class SetContactNotes final : public ClientPacket
117  {
118  public:
120 
121  void Read() override;
122 
124  std::string Notes;
125  };
126 
127  class AddIgnore final : public ClientPacket
128  {
129  public:
130  AddIgnore(WorldPacket&& packet) : ClientPacket(CMSG_ADD_IGNORE, std::move(packet)) { }
131 
132  void Read() override;
133 
134  std::string Name;
135  };
136 
137  class DelIgnore final : public ClientPacket
138  {
139  public:
140  DelIgnore(WorldPacket&& packet) : ClientPacket(CMSG_DEL_IGNORE, std::move(packet)) { }
141 
142  void Read() override;
143 
145  };
146 
147  class VoiceAddIgnore final : public ClientPacket
148  {
149  public:
151 
152  void Read() override;
153 
154  std::string OffenderName;
155  };
156 
157  class VoiceDelIgnore final : public ClientPacket
158  {
159  public:
161 
162  void Read() override;
163 
165  };
166  }
167 }
168 
169 #endif // SocialPackets_h__
SetContactNotes(WorldPacket &&packet)
Definition: SocialPackets.h:119
void Read() override
Definition: SocialPackets.cpp:23
Definition: Opcodes.h:598
FriendStatus()
Definition: SocialPackets.h:72
Definition: SocialPackets.h:89
FriendsResult
Results of friend related commands.
Definition: SocialMgr.h:67
Definition: Opcodes.h:927
uint32 NativeRealmAddr
Definition: SocialPackets.h:49
DelFriend(WorldPacket &&packet)
Definition: SocialPackets.h:109
Definition: Opcodes.h:612
Definition: Opcodes.h:238
uint32 ClassID
Definition: SocialPackets.h:80
Definition: SocialPackets.h:106
DelIgnore(WorldPacket &&packet)
Definition: SocialPackets.h:140
Definition: SocialPackets.h:157
AddIgnore(WorldPacket &&packet)
Definition: SocialPackets.h:130
Definition: SocialMgr.h:48
uint8 Status
Definition: SocialPackets.h:81
std::string Notes
Definition: SocialPackets.h:102
std::vector< ContactInfo > Contacts
Definition: SocialPackets.h:65
Definition: SocialPackets.h:32
Definition: Opcodes.h:237
void Read() override
Definition: SocialPackets.cpp:110
uint32 AreaID
Definition: SocialPackets.h:85
STL namespace.
Definition: Opcodes.h:55
Definition: Opcodes.h:714
QualifiedGUID Player
Definition: SocialPackets.h:144
uint32 TypeFlags
Definition: SocialPackets.h:50
uint32 Flags
Definition: SocialPackets.h:39
Definition: SocialPackets.h:127
uint32 VirtualRealmAddress
Definition: SocialPackets.h:92
uint32 VirtualRealmAddr
Definition: SocialPackets.h:48
uint32 ClassID
Definition: SocialPackets.h:55
Definition: Packet.h:59
std::string Notes
Definition: SocialPackets.h:79
std::string Notes
Definition: SocialPackets.h:124
VoiceDelIgnore(WorldPacket &&packet)
Definition: SocialPackets.h:160
ObjectGuid WowAccountGuid
Definition: SocialPackets.h:83
ContactInfo(ObjectGuid const &guid, FriendInfo const &friendInfo)
Definition: SocialPackets.cpp:28
void Read() override
Definition: SocialPackets.cpp:118
Definition: SocialPackets.h:69
void Read() override
Definition: SocialPackets.cpp:129
Definition: Packet.h:46
std::string Notes
Definition: SocialPackets.h:51
VoiceAddIgnore(WorldPacket &&packet)
Definition: SocialPackets.h:150
ObjectGuid Guid
Definition: SocialPackets.h:82
void Read() override
Definition: SocialPackets.cpp:139
uint32_t uint32
Definition: Define.h:150
uint32 Flags
Definition: SocialPackets.h:66
void Initialize(ObjectGuid const &guid, FriendsResult result, FriendInfo const &friendInfo)
Definition: SocialPackets.cpp:72
std::string Name
Definition: SocialPackets.h:103
ContactList()
Definition: SocialPackets.h:61
uint32 AreaID
Definition: SocialPackets.h:53
Definition: SocialPackets.h:58
uint8 FriendResult
Definition: SocialPackets.h:86
void Read() override
Definition: SocialPackets.cpp:134
Definition: BattlegroundMgr.h:57
Definition: SharedDefines.h:166
uint8_t uint8
Definition: g3dmath.h:164
std::string Name
Definition: SocialPackets.h:134
Definition: Opcodes.h:713
Definition: SocialPackets.h:137
SendContactList(WorldPacket &&packet)
Definition: SocialPackets.h:35
void Read() override
Definition: SocialPackets.cpp:144
Definition: SocialPackets.h:95
uint8 Status
Definition: SocialPackets.h:52
void Read() override
Definition: SocialPackets.cpp:123
ObjectGuid Guid
Definition: SocialPackets.h:46
ObjectGuid Guid
Definition: SocialPackets.h:91
uint8_t uint8
Definition: Define.h:152
uint32 Level
Definition: SocialPackets.h:84
ObjectGuid WowAccountGuid
Definition: SocialPackets.h:47
uint32 VirtualRealmAddress
Definition: SocialPackets.h:78
WorldPacket const * Write() override
Definition: SocialPackets.cpp:60
WorldPacket const * Write() override
Definition: SocialPackets.cpp:85
uint32 Level
Definition: SocialPackets.h:54
Definition: ObjectGuid.h:189
Definition: SocialPackets.h:116
QualifiedGUID Player
Definition: SocialPackets.h:123
Definition: SocialPackets.h:147
Definition: Opcodes.h:56
Definition: SocialPackets.h:42
Definition: Opcodes.h:990
Definition: WorldPacket.h:26
std::string OffenderName
Definition: SocialPackets.h:154
AddFriend(WorldPacket &&packet)
Definition: SocialPackets.h:98
QualifiedGUID Player
Definition: SocialPackets.h:113
QualifiedGUID Player
Definition: SocialPackets.h:164