TrinityCore
Loading...
Searching...
No Matches
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#include "PacketOperators.h"
20
22{
23ByteBuffer& operator<<(ByteBuffer& data, SocialQueueConfig const& socialQueueConfig)
24{
25 data << float(socialQueueConfig.ToastDuration);
26 data << float(socialQueueConfig.DelayDuration);
27 data << float(socialQueueConfig.QueueMultiplier);
28 data << float(socialQueueConfig.PlayerMultiplier);
29 data << float(socialQueueConfig.PlayerFriendValue);
30 data << float(socialQueueConfig.PlayerGuildValue);
31 data << float(socialQueueConfig.ThrottleInitialThreshold);
32 data << float(socialQueueConfig.ThrottleDecayTime);
33 data << float(socialQueueConfig.ThrottlePrioritySpike);
34 data << float(socialQueueConfig.ThrottleMinThreshold);
35 data << float(socialQueueConfig.ThrottlePvPPriorityNormal);
36 data << float(socialQueueConfig.ThrottlePvPPriorityLow);
37 data << float(socialQueueConfig.ThrottlePvPHonorThreshold);
38 data << float(socialQueueConfig.ThrottleLfgListPriorityDefault);
39 data << float(socialQueueConfig.ThrottleLfgListPriorityAbove);
40 data << float(socialQueueConfig.ThrottleLfgListPriorityBelow);
41 data << float(socialQueueConfig.ThrottleLfgListIlvlScalingAbove);
42 data << float(socialQueueConfig.ThrottleLfgListIlvlScalingBelow);
43 data << float(socialQueueConfig.ThrottleRfPriorityAbove);
44 data << float(socialQueueConfig.ThrottleRfIlvlScalingAbove);
45 data << float(socialQueueConfig.ThrottleDfMaxItemLevel);
46 data << float(socialQueueConfig.ThrottleDfBestPriority);
47 data << Bits<1>(socialQueueConfig.ToastsDisabled);
48 data.FlushBits();
49
50 return data;
51}
52
54{
55 data << int32(sessionAlert.Delay);
56 data << int32(sessionAlert.Period);
57 data << int32(sessionAlert.DisplayTime);
58
59 return data;
60}
61
63{
64 data << uint32(throttleState.MaxTries);
65 data << uint32(throttleState.PerMilliseconds);
66 data << uint32(throttleState.TryCount);
67 data << uint32(throttleState.LastResetTimeBeforeNow);
68
69 return data;
70}
71
72ByteBuffer& operator<<(ByteBuffer& data, EuropaTicketConfig const& europaTicketSystemStatus)
73{
74 data << Bits<1>(europaTicketSystemStatus.TicketsEnabled);
75 data << Bits<1>(europaTicketSystemStatus.BugsEnabled);
76 data << Bits<1>(europaTicketSystemStatus.ComplaintsEnabled);
77 data << Bits<1>(europaTicketSystemStatus.SuggestionsEnabled);
78
79 data << europaTicketSystemStatus.ThrottleState;
80 data << europaTicketSystemStatus.ExpensiveThrottleState;
81
82 return data;
83}
84
86{
87 data << Bits<1>(squelch.IsSquelched);
88 data << squelch.BnetAccountGuid;
89 data << squelch.GuildGuid;
90
91 return data;
92}
93
95{
96 data << uint8(gameMode.GameMode);
97 data << int32(gameMode.ContentSetID);
98 data << int32(gameMode.GameModeRecordID);
99
100 return data;
101}
102
104{
105 data << int32(gameRuleValue.Rule);
106 data << int32(gameRuleValue.Value);
107 data << float(gameRuleValue.ValueF);
108
109 return data;
110}
111
112ByteBuffer& operator<<(ByteBuffer& data, DebugTimeEventInfo const& debugTimeEventInfo)
113{
114 data << uint32(debugTimeEventInfo.TimeEvent);
115 data << SizedString::BitsSize<7>(debugTimeEventInfo.Text);
116 data.FlushBits();
117
118 data << SizedString::Data(debugTimeEventInfo.Text);
119
120 return data;
121}
122
124{
126
129
135
140
143
145
147 _worldPacket << Size<uint32>(DisabledGameModes);
148 _worldPacket << Size<uint32>(GameRules);
151
155
157
165
169
170 for (GameModeData const& disabledGameMode : DisabledGameModes)
171 _worldPacket << disabledGameMode;
172
173 for (GameRuleValuePair const& gameRuleValue : GameRules)
174 _worldPacket << gameRuleValue;
175
176 _worldPacket << Bits<1>(VoiceEnabled);
178 _worldPacket << Bits<1>(BpayStoreAvailable);
179 _worldPacket << Bits<1>(ItemRestorationButtonEnabled);
181 _worldPacket << Bits<1>(RAFSystem.Enabled);
182 _worldPacket << Bits<1>(RAFSystem.RecruitingEnabled);
183 _worldPacket << Bits<1>(CharUndeleteEnabled);
184
185 _worldPacket << Bits<1>(RestrictedAccount);
186 _worldPacket << Bits<1>(CommerceServerEnabled);
187 _worldPacket << Bits<1>(TutorialEnabled);
188 _worldPacket << Bits<1>(VeteranTokenRedeemWillKick);
189 _worldPacket << Bits<1>(WorldTokenRedeemWillKick);
190 _worldPacket << Bits<1>(KioskModeEnabled);
191 _worldPacket << Bits<1>(CompetitiveModeEnabled);
192 _worldPacket << Bits<1>(RedeemForBalanceAvailable);
193
194 _worldPacket << Bits<1>(WarModeEnabled);
195 _worldPacket << Bits<1>(CommunitiesEnabled);
196 _worldPacket << Bits<1>(BnetGroupsEnabled);
197 _worldPacket << Bits<1>(CharacterCommunitiesEnabled);
198 _worldPacket << Bits<1>(ClubPresenceAllowSubscribeAll);
199 _worldPacket << Bits<1>(VoiceChatParentalDisabled);
200 _worldPacket << Bits<1>(VoiceChatParentalMuted);
201 _worldPacket << Bits<1>(QuestSessionEnabled);
202
203 _worldPacket << Bits<1>(IsChatMuted);
204 _worldPacket << Bits<1>(ClubFinderEnabled);
205 _worldPacket << Bits<1>(CommunityFinderEnabled);
206 _worldPacket << Bits<1>(BrowserCrashReporterEnabled);
207 _worldPacket << Bits<1>(SpeakForMeAllowed);
208 _worldPacket << Bits<1>(DoesAccountNeedAADCPrompt);
209 _worldPacket << Bits<1>(IsAccountOptedInToAADC);
210 _worldPacket << Bits<1>(LfgRequireAuthenticatorEnabled);
211
212 _worldPacket << Bits<1>(ScriptsDisallowedForBeta);
213 _worldPacket << Bits<1>(TimerunningEnabled);
214 _worldPacket << Bits<1>(PlayerIdentityOptionsEnabled);
215 _worldPacket << Bits<1>(IsPlayerContentTrackingEnabled);
216 _worldPacket << Bits<1>(LfdEnabled);
217 _worldPacket << Bits<1>(LfrEnabled);
218 _worldPacket << Bits<1>(PetHappinessEnabled);
219 _worldPacket << Bits<1>(GuildEventsEditsEnabled);
220
221 _worldPacket << Bits<1>(GuildTradeSkillsEnabled);
222 _worldPacket << SizedString::BitsSize<10>(Unknown1027);
223 _worldPacket << Bits<1>(IsAccountCurrencyTransferEnabled);
224 _worldPacket << Bits<1>(NetEaseChatTelemetryEnabled);
225 _worldPacket << Bits<1>(LobbyMatchmakerQueueFromMainlineEnabled);
226 _worldPacket << Bits<1>(CanSendLobbyMatchmakerPartyCustomizations);
227 _worldPacket << Bits<1>(AddonProfilingEnabled);
228
229 _worldPacket << Bits<1>(GlobalUserGeneratedContentMuteEnabled);
230 _worldPacket << Bits<1>(AccountUserGeneratedContentIsRisky);
231 _worldPacket << Bits<1>(FriendsDisabled);
232
234
237
238 if (SessionAlert)
240
242
243 return &_worldPacket;
244}
245
247{
248 _worldPacket << Bits<1>(BpayStoreAvailable);
249 _worldPacket << Bits<1>(CharUndeleteEnabled);
250 _worldPacket << Bits<1>(CommerceServerEnabled);
252 _worldPacket << Bits<1>(VeteranTokenRedeemWillKick);
253 _worldPacket << Bits<1>(WorldTokenRedeemWillKick);
254 _worldPacket << Bits<1>(ExpansionPreorderInStore);
255 _worldPacket << Bits<1>(KioskModeEnabled);
256
257 _worldPacket << Bits<1>(CompetitiveModeEnabled);
258 _worldPacket << Bits<1>(BoostEnabled);
259 _worldPacket << Bits<1>(TrialBoostEnabled);
260 _worldPacket << Bits<1>(RedeemForBalanceAvailable);
261 _worldPacket << Bits<1>(LiveRegionCharacterListEnabled);
262 _worldPacket << Bits<1>(LiveRegionCharacterCopyEnabled);
263 _worldPacket << Bits<1>(LiveRegionAccountCopyEnabled);
264 _worldPacket << Bits<1>(LiveRegionKeyBindingsCopyEnabled);
265
266 _worldPacket << Bits<1>(BrowserCrashReporterEnabled);
267 _worldPacket << Bits<1>(IsEmployeeAccount);
268 _worldPacket << Bits<1>(UseBleep);
270 _worldPacket << Bits<1>(NameReservationOnly);
272 _worldPacket << Bits<1>(TimerunningEnabled);
273 _worldPacket << Bits<1>(ScriptsDisallowedForBeta);
274
275 _worldPacket << Bits<1>(PlayerIdentityOptionsEnabled);
276 _worldPacket << Bits<1>(AccountExportEnabled);
277 _worldPacket << Bits<1>(AccountLockedPostExport);
278
279 _worldPacket << SizedCString::BitsSize<11>(RealmHiddenAlert);
280
281 _worldPacket << Bits<1>(CharacterSelectListModeRealmless);
282 _worldPacket << Bits<1>(WowTokenLimitedMode);
283
284 _worldPacket << Bits<1>(NavBarEnabled);
285 _worldPacket << Bits<1>(GlobalUserGeneratedContentMuteEnabled);
286 _worldPacket << Bits<1>(AccountUserGeneratedContentIsRisky);
287
289
294 _worldPacket << Size<uint32>(LiveRegionCharacterCopySourceRegions);
300 _worldPacket << Size<uint32>(DisabledGameModes);
301 _worldPacket << Size<uint32>(GameRules);
302 _worldPacket << Size<uint32>(AvailableGameModeIDs);
310 _worldPacket << Size<uint32>(DebugTimeEvents);
313
316
319
321
324
325 for (GameModeData const& disabledGameMode : DisabledGameModes)
326 _worldPacket << disabledGameMode;
327
328 for (GameRuleValuePair const& gameRuleValue : GameRules)
329 _worldPacket << gameRuleValue;
330
331 if (!AvailableGameModeIDs.empty())
333
334 for (DebugTimeEventInfo const& debugTimeEventInfo : DebugTimeEvents)
335 _worldPacket << debugTimeEventInfo;
336
337 return &_worldPacket;
338}
339
341{
342 data << Bits<1>(variable.UpdateType);
343 data << SizedCString::BitsSize<24>(variable.Name);
344 data << SizedCString::BitsSize<24>(variable.Value);
345 data.FlushBits();
346
347 data << SizedCString::Data(variable.Name);
348 data << SizedCString::Data(variable.Value);
349
350 return data;
351}
352
354{
355 _worldPacket << Size<uint32>(Variables);
356 for (MirrorVarSingle const& variable : Variables)
357 _worldPacket << variable;
358
359 return &_worldPacket;
360}
361
363{
364 _worldPacket << BitsSize<4>(*Text);
366
367 for (std::string const& line : *Text)
368 {
369 _worldPacket << SizedString::BitsSize<7>(line);
371
373 }
374
375 return &_worldPacket;
376}
377
379{
380 _worldPacket << SizedString::BitsSize<7>(ServerTimeTZ);
381 _worldPacket << SizedString::BitsSize<7>(GameTimeTZ);
382 _worldPacket << SizedString::BitsSize<7>(ServerRegionalTimeTZ);
384
388
389 return &_worldPacket;
390}
391}
uint8_t uint8
Definition Define.h:156
int64_t int64
Definition Define.h:149
int16_t int16
Definition Define.h:151
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
ComplaintStatus
void append(T value)
Definition ByteBuffer.h:131
void FlushBits()
Definition ByteBuffer.h:142
WorldPacket _worldPacket
Definition Packet.h:43
Optional< EuropaTicketConfig > EuropaTicketSystemStatus
std::vector< DebugTimeEventInfo > DebugTimeEvents
Duration< Seconds, int32 > TimerunningConversionMinCharacterAge
uint32 ClubPresenceUnsubscribeDelay
Timer for updating club presence when communities ui frame is hidden.
Optional< EuropaTicketConfig > EuropaTicketSystemStatus
uint32 RealmPvpTypeOverride
Use Cfg_Configs value = 0, ForceEnabled = 1, ForceDisabled = 2.
Duration< Seconds, uint32 > NotFoundCacheTimeSeconds
int32 ContentSetID
Currently active Classic season.
std::vector< GameRuleValuePair > GameRules
Optional< SessionAlertConfig > SessionAlert
WorldPacket const * Write() override
std::vector< GameModeData > DisabledGameModes
WorldPacket const * Write() override
std::vector< std::string > const * Text
WorldPacket const * Write() override
std::span< MirrorVarSingle > Variables
DataWriter< Container > Data(Container const &value)
DataWriter< Container > Data(Container const &value)
ByteBuffer & operator<<(ByteBuffer &data, SocialQueueConfig const &socialQueueConfig)
OptionalInitWriter< T > OptionalInit(Optional< T > const &value)
SavedThrottleObjectState ThrottleState
SavedThrottleObjectState ExpensiveThrottleState