TrinityCore
SystemPackets.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 "SystemPackets.h"
19
21{
23{
24 data << uint32(throttleState.MaxTries);
25 data << uint32(throttleState.PerMilliseconds);
26 data << uint32(throttleState.TryCount);
27 data << uint32(throttleState.LastResetTimeBeforeNow);
28 return data;
29}
30
31ByteBuffer& operator<<(ByteBuffer& data, EuropaTicketConfig const& europaTicketSystemStatus)
32{
33 data.WriteBit(europaTicketSystemStatus.TicketsEnabled);
34 data.WriteBit(europaTicketSystemStatus.BugsEnabled);
35 data.WriteBit(europaTicketSystemStatus.ComplaintsEnabled);
36 data.WriteBit(europaTicketSystemStatus.SuggestionsEnabled);
37
38 data << europaTicketSystemStatus.ThrottleState;
39
40 return data;
41}
42
44{
45 data << int32(gameRuleValue.Rule);
46 data << int32(gameRuleValue.Value);
47 return data;
48}
49
50ByteBuffer& operator<<(ByteBuffer& data, DebugTimeEventInfo const& debugTimeEventInfo)
51{
52 data << uint32(debugTimeEventInfo.TimeEvent);
53 data.WriteBits(debugTimeEventInfo.Text.length(), 7);
54 data.FlushBits();
55
56 data.WriteString(debugTimeEventInfo.Text);
57
58 return data;
59}
60
62{
64
67
73
77
79
82
85
89
90 for (GameRuleValuePair const& gameRuleValue : GameRuleValues)
91 _worldPacket << gameRuleValue;
92
101
110
119
128
137
140
142
143 {
167 }
168
169 if (SessionAlert)
170 {
172 _worldPacket << int32(SessionAlert->Period);
173 _worldPacket << int32(SessionAlert->DisplayTime);
174 }
175
176 {
180 }
181
184
185 return &_worldPacket;
186}
187
189{
198
201 _worldPacket.WriteBit(false); // unused, 10.0.2
207
210 _worldPacket.WriteBit(false); // unused, 10.0.2
212 _worldPacket.WriteBit(false); // unused, 10.0.2
213 _worldPacket.WriteBit(LaunchETA.has_value());
216
220
222 _worldPacket.WriteBits(RealmHiddenAlert->length() + 1, 11);
223
225
228
246
247 if (LaunchETA)
249
250 if (RealmHiddenAlert && !RealmHiddenAlert->empty())
252
255
256 for (GameRuleValuePair const& gameRuleValue : GameRuleValues)
257 _worldPacket << gameRuleValue;
258
259 for (DebugTimeEventInfo const& debugTimeEventInfo : DebugTimeEvents)
260 _worldPacket << debugTimeEventInfo;
261
262 return &_worldPacket;
263}
264
266{
268 _worldPacket.WriteBits(GameTimeTZ.length(), 7);
271
275
276 return &_worldPacket;
277}
278}
uint8_t uint8
Definition: Define.h:144
int64_t int64
Definition: Define.h:137
int16_t int16
Definition: Define.h:139
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
ComplaintStatus
void WriteString(std::string const &str)
Definition: ByteBuffer.h:500
void append(T value)
Definition: ByteBuffer.h:143
bool WriteBit(bool bit)
Definition: ByteBuffer.h:175
void WriteBits(std::size_t value, int32 bits)
Definition: ByteBuffer.h:203
void FlushBits()
Definition: ByteBuffer.h:155
WorldPacket _worldPacket
Definition: Packet.h:43
Optional< EuropaTicketConfig > EuropaTicketSystemStatus
std::vector< DebugTimeEventInfo > DebugTimeEvents
std::vector< GameRuleValuePair > GameRuleValues
std::vector< GameRuleValuePair > GameRuleValues
Optional< EuropaTicketConfig > EuropaTicketSystemStatus
Optional< SessionAlertConfig > SessionAlert
uint32 HiddenUIClubsPresenceUpdateTimer
Timer for updating club presence when communities ui frame is hidden.
int32 ActiveSeason
Currently active Classic season.
WorldPacket const * Write() override
Duration< Seconds, uint32 > PlayerNameQueryInterval
WorldPacket const * Write() override
ByteBuffer & operator<<(ByteBuffer &data, SavedThrottleObjectState const &throttleState)
SavedThrottleObjectState ThrottleState
Definition: SystemPackets.h:45