TrinityCore
CalendarPackets.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 CalendarPackets_h__
19#define CalendarPackets_h__
20
21#include "Packet.h"
22#include "CalendarMgr.h"
23#include "ObjectGuid.h"
24#include "Optional.h"
25#include "PacketUtilities.h"
26#include "WowTime.h"
27
28namespace WorldPackets
29{
30 namespace Calendar
31 {
32 class CalendarGetCalendar final : public ClientPacket
33 {
34 public:
36
37 void Read() override { }
38 };
39
40 class CalendarGetEvent final : public ClientPacket
41 {
42 public:
44
45 void Read() override;
46
48 };
49
51 {
52 public:
54
55 void Read() override;
56
61 };
62
64 {
71 };
72
74 {
76 std::string Title;
77 std::string Description;
83 };
84
85 class CalendarAddEvent final : public ClientPacket
86 {
87 public:
89
90 void Read() override;
91
94 };
95
97 {
101 std::string Title;
102 std::string Description;
107 };
108
110 {
111 public:
113
114 void Read() override;
115
118 };
119
121 {
122 public:
124
125 void Read() override;
126
131 };
132
133 class CalendarCopyEvent final : public ClientPacket
134 {
135 public:
137
138 void Read() override;
139
144 };
145
147 {
148 public:
150
151 WorldPacket const* Write() override;
152
159 bool ClearPending = false;
161 };
162
164 {
172 };
173
175 {
180 };
181
183 {
185 std::string EventName;
192 };
193
195 {
196 public:
198
199 WorldPacket const* Write() override;
200
202 std::vector<CalendarSendCalendarInviteInfo> Invites;
203 std::vector<CalendarSendCalendarRaidLockoutInfo> RaidLockouts;
204 std::vector<CalendarSendCalendarEventInfo> Events;
205 };
206
208 {
216 std::string Notes;
217 };
218
219 class CalendarSendEvent final : public ServerPacket
220 {
221 public:
223
224 WorldPacket const* Write() override;
225
235 std::string Description;
236 std::string EventName;
237 std::vector<CalendarEventInviteInfo> Invites;
238 };
239
241 {
242 public:
244
245 WorldPacket const* Write() override;
246
258 std::string EventName;
259 };
260
261 class CalendarInvite final : public ClientPacket
262 {
263 public:
265
266 void Read() override;
267
269 bool IsSignUp = false;
270 bool Creating = true;
273 std::string Name;
274 };
275
276 class CalendarRSVP final : public ClientPacket
277 {
278 public:
280
281 void Read() override;
282
286 };
287
289 {
290 public:
292
293 WorldPacket const* Write() override;
294
298 bool ClearPending = false;
302 };
303
305 {
306 public:
308
309 WorldPacket const* Write() override;
310
314 bool ClearPending = false;
315 };
316
318 {
319 public:
321
322 WorldPacket const* Write() override;
323
327 bool ClearPending = false;
328 };
329
331 {
332 public:
334
335 WorldPacket const* Write() override;
336
341 };
342
344 {
345 public:
347
348 WorldPacket const* Write() override { return &_worldPacket; }
349 };
350
352 {
353 public:
355
356 WorldPacket const* Write() override;
357
366 bool ClearPending = false;
367 std::string Description;
368 std::string EventName;
369 };
370
372 {
373 public:
375
376 WorldPacket const* Write() override;
377
380 bool ClearPending = false;
381 };
382
384 {
385 public:
388
389 WorldPacket const* Write() override;
390
392 };
393
395 {
396 public:
398
399 void Read() override { }
400 };
401
403 {
404 public:
406
407 void Read() override;
408
409 bool Tentative = false;
412 };
413
415 {
416 public:
418
419 void Read() override;
420
425 };
426
427 class CalendarStatus final : public ClientPacket
428 {
429 public:
431
432 void Read() override;
433
439 };
440
442 {
443 public:
445
446 void Read() override;
447
449 bool Extend = false;
451 };
452
454 {
455 public:
457
458 void Read() override;
459
465 };
466
468 {
469 public:
471 CalendarCommandResult(uint8 command, uint8 result, std::string const& name) : ServerPacket(SMSG_CALENDAR_COMMAND_RESULT, 3), Command(command), Result(result), Name(name) { }
472
473 WorldPacket const* Write() override;
474
477 std::string Name;
478 };
479
481 {
482 public:
484
485 WorldPacket const* Write() override;
486
492 };
493
495 {
496 public:
498
499 WorldPacket const* Write() override;
500
504 };
505
507 {
508 public:
510
511 WorldPacket const* Write() override;
512
518 };
519
521 {
522 CalendarEventInitialInviteInfo(ObjectGuid inviteGuid, uint8 level) : InviteGuid(inviteGuid), Level(level) { }
523
526 };
527
529 {
530 public:
532
533 WorldPacket const* Write() override;
534
535 std::vector<CalendarEventInitialInviteInfo> Invites;
536 };
537
539 {
540 public:
542
543 WorldPacket const* Write() override;
544
549 };
550
552 {
553 public:
555 CalendarInviteNotesAlert(uint64 eventID, std::string const& notes) : ServerPacket(SMSG_CALENDAR_INVITE_NOTES_ALERT, 8 + notes.size()), EventID(eventID), Notes(notes) { }
556
557 WorldPacket const* Write() override;
558
560 std::string Notes;
561 };
562
564 {
565 public:
567
568 WorldPacket const* Write() override;
569
572 std::string Notes;
573 bool ClearPending = false;
574 };
575
576 class CalendarComplain final : public ClientPacket
577 {
578 public:
580
581 void Read() override;
582
586 };
587 }
588}
589
590#endif // CalendarPackets_h__
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint32_t uint32
Definition: Define.h:142
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
CalendarCommandResult(uint8 command, uint8 result, std::string const &name)
std::vector< CalendarEventInitialInviteInfo > Invites
CalendarInviteNotesAlert(uint64 eventID, std::string const &notes)
std::vector< CalendarSendCalendarInviteInfo > Invites
std::vector< CalendarSendCalendarRaidLockoutInfo > RaidLockouts
std::vector< CalendarSendCalendarEventInfo > Events
std::vector< CalendarEventInviteInfo > Invites
WorldPacket const * Write() override
WorldPacket _worldPacket
Definition: Packet.h:43
@ CMSG_CALENDAR_ADD_EVENT
Definition: Opcodes.h:155
@ CMSG_CALENDAR_RSVP
Definition: Opcodes.h:167
@ CMSG_CALENDAR_GET_EVENT
Definition: Opcodes.h:161
@ CMSG_CALENDAR_REMOVE_INVITE
Definition: Opcodes.h:166
@ CMSG_CALENDAR_EVENT_SIGN_UP
Definition: Opcodes.h:159
@ CMSG_CALENDAR_INVITE
Definition: Opcodes.h:163
@ CMSG_CALENDAR_GET_NUM_PENDING
Definition: Opcodes.h:162
@ CMSG_CALENDAR_COMPLAIN
Definition: Opcodes.h:157
@ CMSG_CALENDAR_COPY_EVENT
Definition: Opcodes.h:158
@ CMSG_CALENDAR_STATUS
Definition: Opcodes.h:168
@ CMSG_CALENDAR_MODERATOR_STATUS
Definition: Opcodes.h:164
@ CMSG_CALENDAR_GET
Definition: Opcodes.h:160
@ CMSG_CALENDAR_UPDATE_EVENT
Definition: Opcodes.h:169
@ CMSG_SET_SAVED_INSTANCE_EXTEND
Definition: Opcodes.h:795
@ CMSG_CALENDAR_COMMUNITY_INVITE
Definition: Opcodes.h:156
@ CMSG_CALENDAR_REMOVE_EVENT
Definition: Opcodes.h:165
@ SMSG_CALENDAR_SEND_EVENT
Definition: Opcodes.h:1068
@ SMSG_CALENDAR_SEND_NUM_PENDING
Definition: Opcodes.h:1069
@ SMSG_CALENDAR_CLEAR_PENDING_ACTION
Definition: Opcodes.h:1050
@ SMSG_CALENDAR_COMMAND_RESULT
Definition: Opcodes.h:1051
@ SMSG_CALENDAR_INVITE_REMOVED
Definition: Opcodes.h:1059
@ SMSG_CALENDAR_INVITE_ADDED
Definition: Opcodes.h:1055
@ SMSG_CALENDAR_EVENT_UPDATED_ALERT
Definition: Opcodes.h:1054
@ SMSG_CALENDAR_SEND_CALENDAR
Definition: Opcodes.h:1067
@ SMSG_CALENDAR_EVENT_REMOVED_ALERT
Definition: Opcodes.h:1053
@ SMSG_CALENDAR_INVITE_NOTES_ALERT
Definition: Opcodes.h:1058
@ SMSG_CALENDAR_RAID_LOCKOUT_ADDED
Definition: Opcodes.h:1064
@ SMSG_CALENDAR_INVITE_STATUS
Definition: Opcodes.h:1061
@ SMSG_CALENDAR_RAID_LOCKOUT_UPDATED
Definition: Opcodes.h:1066
@ SMSG_CALENDAR_RAID_LOCKOUT_REMOVED
Definition: Opcodes.h:1065
@ SMSG_CALENDAR_INVITE_ALERT
Definition: Opcodes.h:1056
@ SMSG_CALENDAR_MODERATOR_STATUS
Definition: Opcodes.h:1063
@ SMSG_CALENDAR_INVITE_STATUS_ALERT
Definition: Opcodes.h:1062
@ SMSG_CALENDAR_INVITE_REMOVED_ALERT
Definition: Opcodes.h:1060
@ SMSG_CALENDAR_COMMUNITY_INVITE
Definition: Opcodes.h:1052
@ SMSG_CALENDAR_INVITE_NOTES
Definition: Opcodes.h:1057
constexpr std::size_t size()
Definition: UpdateField.h:796
STL namespace.
Array< CalendarAddEventInviteInfo, CALENDAR_MAX_INVITES > Invites
CalendarEventInitialInviteInfo(ObjectGuid inviteGuid, uint8 level)