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 buffer >> SizedString::BitsSize<8>(addEventInfo.Title);
128 buffer >> SizedString::BitsSize<11>(addEventInfo.Description);
129
130 for (CalendarAddEventInviteInfo& invite : addEventInfo.Invites)
131 buffer >> invite;
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
269 _worldPacket << lockout;
270
271 for (CalendarSendCalendarInviteInfo const& invite : Invites)
272 _worldPacket << invite;
273
274 for (CalendarSendCalendarEventInfo const& event : Events)
275 _worldPacket << event;
276
277 return &_worldPacket;
278}
279
281{
291 _worldPacket << Size<uint32>(Invites);
292 _worldPacket << SizedString::BitsSize<8>(EventName);
293 _worldPacket << SizedString::BitsSize<11>(Description);
295
296 for (CalendarEventInviteInfo const& invite : Invites)
297 _worldPacket << invite;
298
301
302 return &_worldPacket;
303}
304
306{
316
317 // Todo: check order
320
321 _worldPacket << SizedString::BitsSize<8>(EventName);
322 _worldPacket << Bits<1>(Unknown_1100);
324
326
327 return &_worldPacket;
328}
329
343
345{
349 _worldPacket << Bits<1>(ClearPending);
351
352 return &_worldPacket;
353}
354
356{
360 _worldPacket << Bits<1>(ClearPending);
362
363 return &_worldPacket;
364}
365
375
377{
380
387
388 _worldPacket << SizedString::BitsSize<8>(EventName);
389 _worldPacket << SizedString::BitsSize<11>(Description);
390 _worldPacket << Bits<1>(ClearPending);
392
395
396 return &_worldPacket;
397}
398
400{
403 _worldPacket << Bits<1>(ClearPending);
405
406 return &_worldPacket;
407}
408
415
417{
420 _worldPacket << SizedString::BitsSize<9>(Name);
422
424
425 return &_worldPacket;
426}
427
438
447
458
460{
461 _worldPacket << Size<uint32>(Invites);
462 for (CalendarEventInitialInviteInfo const& invite : Invites)
463 {
464 _worldPacket << invite.InviteGuid;
465 _worldPacket << uint8(invite.Level);
466 }
467
468 return &_worldPacket;
469}
470
480
482{
484 _worldPacket << SizedString::BitsSize<8>(Notes);
486
488
489 return &_worldPacket;
490}
491
493{
496
497 _worldPacket << Bits<1>(ClearPending);
498 _worldPacket << SizedString::BitsSize<8>(Notes);
500
502
503 return &_worldPacket;
504}
505
512}
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:141
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