TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MailPackets.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 MailPackets_h__
19 #define MailPackets_h__
20 
21 #include "ItemPackets.h"
22 #include "Packet.h"
23 #include "QueryPackets.h"
24 #include "ObjectGuid.h"
25 
26 struct Mail;
27 
28 namespace WorldPackets
29 {
30  namespace Mail
31  {
33  {
37  };
38 
40  {
41  MailAttachedItem(::Item const* item, uint8 pos);
42 
46  int32 Count = 0;
50  bool Unlocked = false;
52  };
53 
55  {
56  MailListEntry(::Mail const* mail, ::Player* player);
57 
62  int64 Cod = 0;
65  int32 Flags = 0;
66  float DaysLeft = 0.0f;
68  std::string Subject;
69  std::string Body;
70  std::vector<MailAttachedItem> Attachments;
71  };
72 
73  class MailGetList final : public ClientPacket
74  {
75  public:
76  MailGetList(WorldPacket&& packet) : ClientPacket(CMSG_MAIL_GET_LIST, std::move(packet)) { }
77 
78  void Read() override;
79 
81  std::vector<ObjectGuid::LowType> LowGuids;
82  };
83 
84  class MailListResult final : public ServerPacket
85  {
86  public:
88 
89  WorldPacket const* Write() override;
90 
92  std::vector<MailListEntry> Mails;
93  };
94 
95  class MailCreateTextItem final : public ClientPacket
96  {
97  public:
99 
100  void Read() override;
101 
104  };
105 
106  class SendMail final : public ClientPacket
107  {
108  public:
110  {
112  {
115  };
116 
120  int64 Cod = 0;
121  std::string Target;
122  std::string Subject;
123  std::string Body;
124  std::vector<MailAttachment> Attachments;
125  };
126 
127  SendMail(WorldPacket&& packet) : ClientPacket(CMSG_SEND_MAIL, std::move(packet)) { }
128 
129  void Read() override;
130 
132  };
133 
134  class MailCommandResult final : public ServerPacket
135  {
136  public:
138 
139  WorldPacket const* Write() override;
140 
147  };
148 
149  class MailReturnToSender final : public ClientPacket
150  {
151  public:
153 
154  void Read() override;
155 
158  };
159 
160  class MailMarkAsRead final : public ClientPacket
161  {
162  public:
164 
165  void Read() override;
166 
169  bool BiReceipt = false;
170  };
171 
172  class MailDelete final : public ClientPacket
173  {
174  public:
175  MailDelete(WorldPacket&& packet) : ClientPacket(CMSG_MAIL_DELETE, std::move(packet)) { }
176 
177  void Read() override;
178 
181  };
182 
183  class MailTakeItem final : public ClientPacket
184  {
185  public:
187 
188  void Read() override;
189 
193  };
194 
195  class MailTakeMoney final : public ClientPacket
196  {
197  public:
199 
200  void Read() override;
201 
205  };
206 
207  class MailQueryNextMailTime final : public ClientPacket
208  {
209  public:
211 
212  void Read() override { }
213  };
214 
216  {
217  public:
219  {
220  MailNextTimeEntry(::Mail const* mail);
221 
223  float TimeLeft = 0.0f;
227  };
228 
230 
231  WorldPacket const* Write() override;
232 
233  float NextMailTime = 0.0f;
234  std::vector<MailNextTimeEntry> Next;
235  };
236 
238  {
239  public:
241 
242  WorldPacket const* Write() override;
243 
244  float Delay = 0.0f;
245  };
246 
247  class ShowMailbox final : public ServerPacket
248  {
249  public:
251 
252  WorldPacket const* Write() override;
253 
255  };
256  }
257 }
258 
261 
262 #endif // MailPackets_h__
Definition: Opcodes.h:1212
uint32 MailID
Definition: MailPackets.h:141
Definition: MailPackets.h:106
int32 Flags
Definition: MailPackets.h:65
int64 Money
Definition: MailPackets.h:204
WorldPacket const * Write() override
Definition: MailPackets.cpp:274
uint32 MailID
Definition: MailPackets.h:103
std::vector< ObjectGuid::LowType > LowGuids
Definition: MailPackets.h:81
MailGetList(WorldPacket &&packet)
Definition: MailPackets.h:76
void Read() override
Definition: MailPackets.cpp:216
Definition: Opcodes.h:403
bool BiReceipt
Definition: MailPackets.h:169
Definition: MailPackets.h:39
Definition: ByteBuffer.h:70
bool Unlocked
Definition: MailPackets.h:50
int8_t int8
Definition: Define.h:148
ByteBuffer & operator<<(ByteBuffer &data, WorldPackets::Mail::MailAttachedItem const &att)
Definition: MailPackets.cpp:42
uint8 SenderType
Definition: MailPackets.h:59
std::vector< MailNextTimeEntry > Next
Definition: MailPackets.h:234
MailTakeItem(WorldPacket &&packet)
Definition: MailPackets.h:186
Definition: MailPackets.h:54
int32 MailID
Definition: MailPackets.h:156
MailAttachedItem(::Item const *item, uint8 pos)
Definition: MailPackets.cpp:23
int64_t int64
Definition: Define.h:145
uint32 BagResult
Definition: MailPackets.h:144
void Read() override
Definition: MailPackets.cpp:135
void Read() override
Definition: MailPackets.cpp:185
MailMarkAsRead(WorldPacket &&packet)
Definition: MailPackets.h:163
ObjectGuid Mailbox
Definition: MailPackets.h:102
ObjectGuid SenderGuid
Definition: MailPackets.h:222
Definition: Opcodes.h:399
std::string Body
Definition: MailPackets.h:69
uint32 QtyInInventory
Definition: MailPackets.h:146
Definition: Opcodes.h:1311
Definition: MailPackets.h:195
ObjectGuid SenderGUID
Definition: MailPackets.h:157
STL namespace.
int32 StationeryID
Definition: MailPackets.h:118
Definition: Opcodes.h:599
void Read() override
Definition: MailPackets.cpp:155
Definition: Opcodes.h:401
MailCommandResult()
Definition: MailPackets.h:137
int64 Cod
Definition: MailPackets.h:120
Definition: MailPackets.h:237
Definition: MailPackets.h:160
Definition: MailPackets.h:207
int32 MailID
Definition: MailPackets.h:203
int32 Count
Definition: MailPackets.h:46
Definition: MailPackets.h:134
Definition: MailPackets.h:73
WorldPacket const * Write() override
Definition: MailPackets.cpp:191
int32 DeleteReason
Definition: MailPackets.h:180
void Read() override
Definition: MailPackets.cpp:161
int32 MailTemplateID
Definition: MailPackets.h:67
int32 MailID
Definition: MailPackets.h:168
Definition: Mail.h:166
NotifyRecievedMail()
Definition: MailPackets.h:240
std::string Target
Definition: MailPackets.h:121
Definition: Packet.h:59
ObjectGuid Mailbox
Definition: MailPackets.h:167
std::vector< MailAttachment > Attachments
Definition: MailPackets.h:124
int32 Charges
Definition: MailPackets.h:36
Definition: MailPackets.h:172
Item::ItemInstance Item
Definition: MailPackets.h:45
int32 AttachID
Definition: MailPackets.h:44
Definition: Opcodes.h:1211
ShowMailbox()
Definition: MailPackets.h:250
Definition: Opcodes.h:522
int32 AttachID
Definition: MailPackets.h:192
Definition: Packet.h:46
MailListResult()
Definition: MailPackets.h:87
uint32 ErrorCode
Definition: MailPackets.h:143
int32 StationeryID
Definition: MailPackets.h:63
Definition: Item.h:259
MailTakeMoney(WorldPacket &&packet)
Definition: MailPackets.h:198
int32_t int32
Definition: Define.h:146
std::vector< MailAttachedItem > Attachments
Definition: MailPackets.h:70
int32 TotalNumRecords
Definition: MailPackets.h:91
int64 Cod
Definition: MailPackets.h:62
uint32_t uint32
Definition: Define.h:150
float NextMailTime
Definition: MailPackets.h:233
WorldPacket const * Write() override
Definition: MailPackets.cpp:250
uint32 Command
Definition: MailPackets.h:142
boost::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Common.h:170
int32 Enchant
Definition: MailPackets.h:34
Definition: MailPackets.h:95
Definition: Opcodes.h:405
int64 SendMoney
Definition: MailPackets.h:119
int32 Duration
Definition: MailPackets.h:35
ObjectGuid Mailbox
Definition: MailPackets.h:202
std::vector< MailListEntry > Mails
Definition: MailPackets.h:92
Definition: MailPackets.h:247
ObjectGuid Mailbox
Definition: MailPackets.h:190
MailCreateTextItem(WorldPacket &&packet)
Definition: MailPackets.h:98
Definition: BattlegroundMgr.h:57
std::string Subject
Definition: MailPackets.h:122
std::string Body
Definition: MailPackets.h:123
void Read() override
Definition: MailPackets.cpp:223
int32 MailID
Definition: MailPackets.h:191
MailQueryNextTimeResult()
Definition: MailPackets.h:229
float Delay
Definition: MailPackets.h:244
ObjectGuid Mailbox
Definition: MailPackets.h:80
ObjectGuid ItemGUID
Definition: MailPackets.h:114
void Read() override
Definition: MailPackets.h:212
int32 MailID
Definition: MailPackets.h:58
void Read() override
Definition: MailPackets.cpp:203
MailReturnToSender(WorldPacket &&packet)
Definition: MailPackets.h:152
Optional< uint32 > AltSenderID
Definition: MailPackets.h:61
std::string Subject
Definition: MailPackets.h:68
Definition: Opcodes.h:1520
uint32 AttachID
Definition: MailPackets.h:145
MailAttachedItemEnchant Enchants[8]
Definition: MailPackets.h:51
MailNextTimeEntry(::Mail const *mail)
Definition: MailPackets.cpp:230
MailListEntry(::Mail const *mail,::Player *player)
Definition: MailPackets.cpp:65
WorldPacket const * Write() override
Definition: MailPackets.cpp:267
int32 Durability
Definition: MailPackets.h:49
Definition: Opcodes.h:400
int32 MaxDurability
Definition: MailPackets.h:48
Definition: Opcodes.h:1213
ObjectGuid Mailbox
Definition: MailPackets.h:117
uint8_t uint8
Definition: Define.h:152
Definition: Position.h:27
float DaysLeft
Definition: MailPackets.h:66
int32 MailID
Definition: MailPackets.h:179
StructSendMail Info
Definition: MailPackets.h:131
Definition: ItemPackets.h:40
Definition: MailPackets.h:183
Definition: ObjectGuid.h:189
ObjectGuid PostmasterGUID
Definition: MailPackets.h:254
Definition: MailPackets.h:84
Definition: MailPackets.h:149
void Read() override
Definition: MailPackets.cpp:210
WorldPacket const * Write() override
Definition: MailPackets.cpp:144
Optional< ObjectGuid > SenderCharacter
Definition: MailPackets.h:60
int32 Charges
Definition: MailPackets.h:47
MailQueryNextMailTime(WorldPacket &&packet)
Definition: MailPackets.h:210
Definition: WorldPacket.h:26
Definition: Opcodes.h:404
int64 SentMoney
Definition: MailPackets.h:64
Definition: Opcodes.h:402
SendMail(WorldPacket &&packet)
Definition: MailPackets.h:127
Definition: MailPackets.h:215
MailDelete(WorldPacket &&packet)
Definition: MailPackets.h:175