TrinityCore
SocialPackets.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 SocialPackets_h__
19#define SocialPackets_h__
20
21#include "Packet.h"
22#include "ObjectGuid.h"
23#include "SharedDefines.h"
24
25struct FriendInfo;
26enum FriendsResult : uint8;
27
28namespace WorldPackets
29{
30 namespace Social
31 {
32 class SendContactList final : public ClientPacket
33 {
34 public:
36
37 void Read() override;
38
40 };
41
43 {
44 ContactInfo(ObjectGuid const& guid, FriendInfo const& friendInfo);
45
51 std::string Notes;
56 bool Mobile = false;
57 };
58
59 class ContactList final : public ServerPacket
60 {
61 public:
63
64 WorldPacket const* Write() override;
65
66 std::vector<ContactInfo> Contacts;
68 };
69
70 class FriendStatus final : public ServerPacket
71 {
72 public:
74
75 void Initialize(ObjectGuid const& guid, FriendsResult result, FriendInfo const& friendInfo);
76
77 WorldPacket const* Write() override;
78
80 std::string Notes;
88 bool Mobile = false;
89 };
90
92 {
95 };
96
97 class AddFriend final : public ClientPacket
98 {
99 public:
100 AddFriend(WorldPacket&& packet) : ClientPacket(CMSG_ADD_FRIEND, std::move(packet)) { }
101
102 void Read() override;
103
104 std::string Notes;
105 std::string Name;
106 };
107
108 class DelFriend final : public ClientPacket
109 {
110 public:
111 DelFriend(WorldPacket&& packet) : ClientPacket(CMSG_DEL_FRIEND, std::move(packet)) { }
112
113 void Read() override;
114
116 };
117
118 class SetContactNotes final : public ClientPacket
119 {
120 public:
122
123 void Read() override;
124
126 std::string Notes;
127 };
128
129 class AddIgnore final : public ClientPacket
130 {
131 public:
132 AddIgnore(WorldPacket&& packet) : ClientPacket(CMSG_ADD_IGNORE, std::move(packet)) { }
133
134 void Read() override;
135
136 std::string Name;
138 };
139
140 class DelIgnore final : public ClientPacket
141 {
142 public:
143 DelIgnore(WorldPacket&& packet) : ClientPacket(CMSG_DEL_IGNORE, std::move(packet)) { }
144
145 void Read() override;
146
148 };
149
151 {
152 public:
154
155 void Read() override { }
156 };
157
159 {
160 public:
162
163 WorldPacket const* Write() override;
164
165 bool ShowSocialContract = false;
166 };
167 }
168}
169
170#endif // SocialPackets_h__
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
@ CLASS_NONE
FriendsResult
Results of friend related commands.
Definition: SocialMgr.h:68
AddFriend(WorldPacket &&packet)
AddIgnore(WorldPacket &&packet)
WorldPacket const * Write() override
std::vector< ContactInfo > Contacts
Definition: SocialPackets.h:66
DelFriend(WorldPacket &&packet)
DelIgnore(WorldPacket &&packet)
WorldPacket const * Write() override
void Initialize(ObjectGuid const &guid, FriendsResult result, FriendInfo const &friendInfo)
SendContactList(WorldPacket &&packet)
Definition: SocialPackets.h:35
SetContactNotes(WorldPacket &&packet)
@ CMSG_SEND_CONTACT_LIST
Definition: Opcodes.h:757
@ CMSG_SET_CONTACT_NOTES
Definition: Opcodes.h:772
@ CMSG_SOCIAL_CONTRACT_REQUEST
Definition: Opcodes.h:810
@ CMSG_DEL_IGNORE
Definition: Opcodes.h:313
@ CMSG_ADD_IGNORE
Definition: Opcodes.h:60
@ CMSG_DEL_FRIEND
Definition: Opcodes.h:312
@ CMSG_ADD_FRIEND
Definition: Opcodes.h:59
@ SMSG_SOCIAL_CONTRACT_REQUEST_RESPONSE
Definition: Opcodes.h:1936
@ SMSG_CONTACT_LIST
Definition: Opcodes.h:1161
@ SMSG_FRIEND_STATUS
Definition: Opcodes.h:1253
STL namespace.
ContactInfo(ObjectGuid const &guid, FriendInfo const &friendInfo)