TrinityCore
Loading...
Searching...
No Matches
MailPackets.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_MAIL_PACKETS_H
19#define TRINITYCORE_MAIL_PACKETS_H
20
21#include "Packet.h"
22#include "ItemPacketsCommon.h"
23#include "ObjectGuid.h"
24
25class Player;
26struct Mail;
27
28namespace WorldPackets
29{
30 namespace Mail
31 {
33 {
34 MailAttachedItem(::Item const* item, uint8 pos);
35
43 bool Unlocked = false;
44 std::vector<Item::ItemEnchantData> Enchants;
45 std::vector<Item::ItemGemData> Gems;
46 };
47
49 {
50 MailListEntry(::Mail const* mail, ::Player* player);
51
60 float DaysLeft = 0.0f;
62 std::string Subject;
63 std::string Body;
64 std::vector<MailAttachedItem> Attachments;
65 };
66
67 class MailGetList final : public ClientPacket
68 {
69 public:
70 explicit MailGetList(WorldPacket&& packet) : ClientPacket(CMSG_MAIL_GET_LIST, std::move(packet)) { }
71
72 void Read() override;
73
75 };
76
77 class MailListResult final : public ServerPacket
78 {
79 public:
81
82 WorldPacket const* Write() override;
83
85 std::vector<MailListEntry> Mails;
86 };
87
88 class MailCreateTextItem final : public ClientPacket
89 {
90 public:
92
93 void Read() override;
94
97 };
98
99 class SendMail final : public ClientPacket
100 {
101 public:
103 {
109
114 std::string Target;
115 std::string Subject;
116 std::string Body;
117 std::vector<MailAttachment> Attachments;
118 };
119
120 explicit SendMail(WorldPacket&& packet) : ClientPacket(CMSG_SEND_MAIL, std::move(packet)) { }
121
122 void Read() override;
123
125 };
126
127 class MailCommandResult final : public ServerPacket
128 {
129 public:
131
132 WorldPacket const* Write() override;
133
140 };
141
142 class MailReturnToSender final : public ClientPacket
143 {
144 public:
146
147 void Read() override;
148
151 };
152
153 class MailMarkAsRead final : public ClientPacket
154 {
155 public:
156 explicit MailMarkAsRead(WorldPacket&& packet) : ClientPacket(CMSG_MAIL_MARK_AS_READ, std::move(packet)) { }
157
158 void Read() override;
159
162 };
163
164 class MailDelete final : public ClientPacket
165 {
166 public:
167 explicit MailDelete(WorldPacket&& packet) : ClientPacket(CMSG_MAIL_DELETE, std::move(packet)) { }
168
169 void Read() override;
170
173 };
174
175 class MailTakeItem final : public ClientPacket
176 {
177 public:
178 explicit MailTakeItem(WorldPacket&& packet) : ClientPacket(CMSG_MAIL_TAKE_ITEM, std::move(packet)) { }
179
180 void Read() override;
181
185 };
186
187 class MailTakeMoney final : public ClientPacket
188 {
189 public:
190 explicit MailTakeMoney(WorldPacket&& packet) : ClientPacket(CMSG_MAIL_TAKE_MONEY, std::move(packet)) { }
191
192 void Read() override;
193
197 };
198
200 {
201 public:
203
204 void Read() override { }
205 };
206
208 {
209 public:
220
222
223 WorldPacket const* Write() override;
224
225 float NextMailTime = 0.0f;
226 std::vector<MailNextTimeEntry> Next;
227 };
228
230 {
231 public:
233
234 WorldPacket const* Write() override;
235
236 float Delay = 0.0f;
237 };
238 }
239}
240
241#endif // TRINITYCORE_MAIL_PACKETS_H
uint8_t uint8
Definition Define.h:156
int64_t int64
Definition Define.h:149
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint32_t uint32
Definition Define.h:154
@ SMSG_NOTIFY_RECEIVED_MAIL
Definition Opcodes.h:2019
@ SMSG_MAIL_COMMAND_RESULT
Definition Opcodes.h:1838
@ SMSG_MAIL_LIST_RESULT
Definition Opcodes.h:1839
@ SMSG_MAIL_QUERY_NEXT_TIME_RESULT
Definition Opcodes.h:1840
@ CMSG_MAIL_GET_LIST
Definition Opcodes.h:570
@ CMSG_SEND_MAIL
Definition Opcodes.h:890
@ CMSG_MAIL_TAKE_MONEY
Definition Opcodes.h:574
@ CMSG_MAIL_CREATE_TEXT_ITEM
Definition Opcodes.h:568
@ CMSG_MAIL_MARK_AS_READ
Definition Opcodes.h:571
@ CMSG_QUERY_NEXT_MAIL_TIME
Definition Opcodes.h:768
@ CMSG_MAIL_DELETE
Definition Opcodes.h:569
@ CMSG_MAIL_TAKE_ITEM
Definition Opcodes.h:573
@ CMSG_MAIL_RETURN_TO_SENDER
Definition Opcodes.h:572
Definition Item.h:179
WorldPacket const * Write() override
MailCreateTextItem(WorldPacket &&packet)
Definition MailPackets.h:91
MailDelete(WorldPacket &&packet)
MailGetList(WorldPacket &&packet)
Definition MailPackets.h:70
WorldPacket const * Write() override
std::vector< MailListEntry > Mails
Definition MailPackets.h:85
MailMarkAsRead(WorldPacket &&packet)
MailQueryNextMailTime(WorldPacket &&packet)
WorldPacket const * Write() override
std::vector< MailNextTimeEntry > Next
MailReturnToSender(WorldPacket &&packet)
MailTakeItem(WorldPacket &&packet)
MailTakeMoney(WorldPacket &&packet)
WorldPacket const * Write() override
SendMail(WorldPacket &&packet)
STL namespace.
Definition Mail.h:175
std::vector< Item::ItemEnchantData > Enchants
Definition MailPackets.h:44
std::vector< Item::ItemGemData > Gems
Definition MailPackets.h:45
std::vector< MailAttachedItem > Attachments
Definition MailPackets.h:64
std::vector< MailAttachment > Attachments