TrinityCore
Loading...
Searching...
No Matches
CalendarPackets.cpp
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#include "CalendarPackets.h"
19#include "PacketOperators.h"
20
22{
24{
25 data << uint64(eventInfo.EventID);
26 data << uint8(eventInfo.EventType);
27 data << eventInfo.Date;
28 data << uint16(eventInfo.Flags);
29 data << int32(eventInfo.TextureID);
30 data << uint64(eventInfo.EventClubID);
31 data << eventInfo.OwnerGuid;
32
33 data << SizedString::BitsSize<8>(eventInfo.EventName);
34 data.FlushBits();
35
36 data << SizedString::Data(eventInfo.EventName);
37
38 return data;
39}
40
42{
43 data << int32(lockoutInfo.MapID);
44 data << int16(lockoutInfo.DifficultyID);
45 data << int32(lockoutInfo.ExpireTime);
46 data << uint64(lockoutInfo.InstanceID);
47
48 return data;
49}
50
52{
53 data << uint64(inviteInfo.EventID);
54 data << uint64(inviteInfo.InviteID);
55 data << uint8(inviteInfo.Status);
56 data << uint8(inviteInfo.Moderator);
57 data << uint8(inviteInfo.InviteType);
58 data << inviteInfo.InviterGuid;
59 data << Bits<1>(inviteInfo.IgnoreFriendAndGuildRestriction);
60 data.FlushBits();
61
62 return data;
63}
64
66{
67 data << inviteInfo.Guid;
68 data << uint64(inviteInfo.InviteID);
69
70 data << uint8(inviteInfo.Level);
71 data << uint8(inviteInfo.Status);
72 data << uint8(inviteInfo.Moderator);
73 data << uint8(inviteInfo.InviteType);
74 data << inviteInfo.ResponseTime;
75
76 data << SizedString::BitsSize<8>(inviteInfo.Notes);
77 data.FlushBits();
78
79 data << SizedString::Data(inviteInfo.Notes);
80
81 return data;
82}
83
88
96
98{
99 buffer >> invite.Guid;
100 buffer >> invite.Status;
101 buffer >> invite.Moderator;
102 buffer >> OptionalInit(invite.BnetAccountID);
103 buffer >> OptionalInit(invite.RealmAddress);
104 buffer >> OptionalInit(invite.CommunityID);
105
106 if (invite.BnetAccountID)
107 buffer >> *invite.BnetAccountID;
108
109 if (invite.RealmAddress)
110 buffer >> *invite.RealmAddress;
111
112 if (invite.CommunityID)
113 buffer >> *invite.CommunityID;
114
115 return buffer;
116}
117
119{
120 buffer >> addEventInfo.ClubID;
121 buffer >> addEventInfo.EventType;
122 buffer >> addEventInfo.TextureID;
123 buffer >> addEventInfo.Time;
124 buffer >> addEventInfo.Flags;
125 buffer >> Size<uint32>(addEventInfo.Invites);
126
127 for (CalendarAddEventInviteInfo& invite : addEventInfo.Invites)
128 buffer >> invite;
129
130 buffer >> SizedString::BitsSize<8>(addEventInfo.Title);
131 buffer >> SizedString::BitsSize<11>(addEventInfo.Description);
132
133 buffer >> SizedString::Data(addEventInfo.Title);
134 buffer >> SizedString::Data(addEventInfo.Description);
135
136 return buffer;
137}
138
144
146{
147 buffer >> updateEventInfo.ClubID;
148 buffer >> updateEventInfo.EventID;
149 buffer >> updateEventInfo.ModeratorID;
150 buffer >> updateEventInfo.EventType;
151 buffer >> updateEventInfo.TextureID;
152 buffer >> updateEventInfo.Time;
153 buffer >> updateEventInfo.Flags;
154
155 buffer >> SizedString::BitsSize<8>(updateEventInfo.Title);
156 buffer >> SizedString::BitsSize<11>(updateEventInfo.Description);
157
158 buffer >> SizedString::Data(updateEventInfo.Title);
159 buffer >> SizedString::Data(updateEventInfo.Description);
160
161 return buffer;
162}
163
169
177
185
192
194{
198
199 _worldPacket >> SizedString::BitsSize<9>(Name);
200 _worldPacket >> Bits<1>(Creating);
201 _worldPacket >> Bits<1>(IsSignUp);
202
204}
205
212
220
229
236
245
260
262{
264 _worldPacket << Size<uint32>(Invites);
265 _worldPacket << Size<uint32>(Events);
266 _worldPacket << Size<uint32>(RaidLockouts);
267
268 for (CalendarSendCalendarInviteInfo const& invite : Invites)
269 _worldPacket << invite;
270
271 for (CalendarSendCalendarEventInfo const& event : Events)
272 _worldPacket << event;
273
275 _worldPacket << lockout;
276
277 return &_worldPacket;
278}
279
281{
291 _worldPacket << Size<uint32>(Invites);
292
293 for (CalendarEventInviteInfo const& invite : Invites)
294 _worldPacket << invite;
295
296 _worldPacket << SizedString::BitsSize<8>(EventName);
297 _worldPacket << SizedString::BitsSize<11>(Description);
299
302
303 return &_worldPacket;
304}
305
307{
317
318 // Todo: check order
321
322 _worldPacket << SizedString::BitsSize<8>(EventName);
323 _worldPacket << Bits<1>(Unknown_1100);
325
327
328 return &_worldPacket;
329}
330
344
346{
350 _worldPacket << Bits<1>(ClearPending);
352
353 return &_worldPacket;
354}
355
357{
361 _worldPacket << Bits<1>(ClearPending);
363
364 return &_worldPacket;
365}
366
376
378{
381
388
389 _worldPacket << SizedString::BitsSize<8>(EventName);
390 _worldPacket << SizedString::BitsSize<11>(Description);
391 _worldPacket << Bits<1>(ClearPending);
393
396
397 return &_worldPacket;
398}
399
401{
404 _worldPacket << Bits<1>(ClearPending);
406
407 return &_worldPacket;
408}
409
416
418{
421 _worldPacket << SizedString::BitsSize<9>(Name);
423
425
426 return &_worldPacket;
427}
428
439
448
459
461{
462 _worldPacket << Size<uint32>(Invites);
463 for (CalendarEventInitialInviteInfo const& invite : Invites)
464 {
465 _worldPacket << invite.InviteGuid;
466 _worldPacket << uint8(invite.Level);
467 }
468
469 return &_worldPacket;
470}
471
481
483{
485 _worldPacket << SizedString::BitsSize<8>(Notes);
487
489
490 return &_worldPacket;
491}
492
494{
497
498 _worldPacket << Bits<1>(ClearPending);
499 _worldPacket << SizedString::BitsSize<8>(Notes);
501
503
504 return &_worldPacket;
505}
506
513}
uint8_t uint8
Definition Define.h:156
int16_t int16
Definition Define.h:151
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint16_t uint16
Definition Define.h:155
uint32_t uint32
Definition Define.h:154
void FlushBits()
Definition ByteBuffer.h:142
std::vector< CalendarEventInitialInviteInfo > Invites
std::vector< CalendarSendCalendarInviteInfo > Invites
std::vector< CalendarSendCalendarRaidLockoutInfo > RaidLockouts
std::vector< CalendarSendCalendarEventInfo > Events
std::vector< CalendarEventInviteInfo > Invites
WorldPacket _worldPacket
Definition Packet.h:43
ByteBuffer & operator<<(ByteBuffer &data, CalendarSendCalendarEventInfo const &eventInfo)
ByteBuffer & operator>>(ByteBuffer &buffer, CalendarAddEventInviteInfo &invite)
DataWriter< Container > Data(Container const &value)
OptionalInitWriter< T > OptionalInit(Optional< T > const &value)
Array< CalendarAddEventInviteInfo, CALENDAR_MAX_INVITES > Invites