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
139
142
144 _worldPacket << Size<uint32>(DisabledGameModes);
145 _worldPacket << Size<uint32>(GameRules);
148
152
154
162
166
167 for (GameModeData const& disabledGameMode : DisabledGameModes)
168 _worldPacket << disabledGameMode;
169
170 for (GameRuleValuePair const& gameRuleValue : GameRules)
171 _worldPacket << gameRuleValue;
172
173 _worldPacket << Bits<1>(VoiceEnabled);
175 _worldPacket << Bits<1>(BpayStoreAvailable);
176 _worldPacket << Bits<1>(ItemRestorationButtonEnabled);
178 _worldPacket << Bits<1>(RAFSystem.Enabled);
179 _worldPacket << Bits<1>(RAFSystem.RecruitingEnabled);
180 _worldPacket << Bits<1>(CharUndeleteEnabled);
181
182 _worldPacket << Bits<1>(RestrictedAccount);
183 _worldPacket << Bits<1>(CommerceServerEnabled);
184 _worldPacket << Bits<1>(TutorialEnabled);
185 _worldPacket << Bits<1>(VeteranTokenRedeemWillKick);
186 _worldPacket << Bits<1>(WorldTokenRedeemWillKick);
187 _worldPacket << Bits<1>(KioskModeEnabled);
188 _worldPacket << Bits<1>(CompetitiveModeEnabled);
189 _worldPacket << Bits<1>(RedeemForBalanceAvailable);
190
191 _worldPacket << Bits<1>(WarModeEnabled);
192 _worldPacket << Bits<1>(CommunitiesEnabled);
193 _worldPacket << Bits<1>(BnetGroupsEnabled);
194 _worldPacket << Bits<1>(CharacterCommunitiesEnabled);
195 _worldPacket << Bits<1>(ClubPresenceAllowSubscribeAll);
196 _worldPacket << Bits<1>(VoiceChatParentalDisabled);
197 _worldPacket << Bits<1>(VoiceChatParentalMuted);
198 _worldPacket << Bits<1>(QuestSessionEnabled);
199
200 _worldPacket << Bits<1>(IsChatMuted);
201 _worldPacket << Bits<1>(ClubFinderEnabled);
202 _worldPacket << Bits<1>(CommunityFinderEnabled);
203 _worldPacket << Bits<1>(BrowserCrashReporterEnabled);
204 _worldPacket << Bits<1>(SpeakForMeAllowed);
205 _worldPacket << Bits<1>(DoesAccountNeedAADCPrompt);
206 _worldPacket << Bits<1>(IsAccountOptedInToAADC);
207 _worldPacket << Bits<1>(LfgRequireAuthenticatorEnabled);
208
209 _worldPacket << Bits<1>(ScriptsDisallowedForBeta);
210 _worldPacket << Bits<1>(TimerunningEnabled);
211 _worldPacket << Bits<1>(PlayerIdentityOptionsEnabled);
212 _worldPacket << Bits<1>(IsPlayerContentTrackingEnabled);
213 _worldPacket << Bits<1>(LfdEnabled);
214 _worldPacket << Bits<1>(LfrEnabled);
215 _worldPacket << Bits<1>(PetHappinessEnabled);
216 _worldPacket << Bits<1>(GuildEventsEditsEnabled);
217
218 _worldPacket << Bits<1>(GuildTradeSkillsEnabled);
219 _worldPacket << SizedString::BitsSize<10>(Unknown1027);
220 _worldPacket << Bits<1>(BNSendWhisperUseV2Services);
221 _worldPacket << Bits<1>(BNSendGameDataUseV2Services);
222 _worldPacket << Bits<1>(IsAccountCurrencyTransferEnabled);
223 _worldPacket << Bits<1>(NetEaseChatTelemetryEnabled);
224 _worldPacket << Bits<1>(LobbyMatchmakerQueueFromMainlineEnabled);
225
226 _worldPacket << Bits<1>(CanSendLobbyMatchmakerPartyCustomizations);
227 _worldPacket << Bits<1>(AddonProfilingEnabled);
228 _worldPacket << Bits<1>(GlobalUserGeneratedContentMuteEnabled);
229 _worldPacket << Bits<1>(AccountUserGeneratedContentIsRisky);
230
232
234
235 if (SessionAlert)
237
239
241
244
245 return &_worldPacket;
246}
247
249{
250 _worldPacket << Bits<1>(BpayStoreAvailable);
251 _worldPacket << Bits<1>(CharUndeleteEnabled);
252 _worldPacket << Bits<1>(CommerceServerEnabled);
254 _worldPacket << Bits<1>(VeteranTokenRedeemWillKick);
255 _worldPacket << Bits<1>(WorldTokenRedeemWillKick);
256 _worldPacket << Bits<1>(ExpansionPreorderInStore);
257 _worldPacket << Bits<1>(KioskModeEnabled);
258
259 _worldPacket << Bits<1>(CompetitiveModeEnabled);
260 _worldPacket << Bits<1>(BoostEnabled);
261 _worldPacket << Bits<1>(TrialBoostEnabled);
262 _worldPacket << Bits<1>(RedeemForBalanceAvailable);
263 _worldPacket << Bits<1>(LiveRegionCharacterListEnabled);
264 _worldPacket << Bits<1>(LiveRegionCharacterCopyEnabled);
265 _worldPacket << Bits<1>(LiveRegionAccountCopyEnabled);
266 _worldPacket << Bits<1>(LiveRegionKeyBindingsCopyEnabled);
267
268 _worldPacket << Bits<1>(BrowserCrashReporterEnabled);
269 _worldPacket << Bits<1>(IsEmployeeAccount);
271 _worldPacket << Bits<1>(NameReservationOnly);
273 _worldPacket << Bits<1>(TimerunningEnabled);
274 _worldPacket << Bits<1>(ScriptsDisallowedForBeta);
275 _worldPacket << Bits<1>(PlayerIdentityOptionsEnabled);
276
277 _worldPacket << Bits<1>(AccountExportEnabled);
278 _worldPacket << Bits<1>(AccountLockedPostExport);
279
280 _worldPacket << SizedCString::BitsSize<11>(RealmHiddenAlert);
281
282 _worldPacket << Bits<1>(BNSendWhisperUseV2Services);
283 _worldPacket << Bits<1>(BNSendGameDataUseV2Services);
284 _worldPacket << Bits<1>(CharacterSelectListModeRealmless);
285
286 _worldPacket << Bits<1>(WowTokenLimitedMode);
287 _worldPacket << Bits<1>(NavBarEnabled);
288 _worldPacket << Bits<1>(GlobalUserGeneratedContentMuteEnabled);
289 _worldPacket << Bits<1>(AccountUserGeneratedContentIsRisky);
290
292
295
300 _worldPacket << Size<uint32>(LiveRegionCharacterCopySourceRegions);
306 _worldPacket << Size<uint32>(DisabledGameModes);
307 _worldPacket << Size<uint32>(GameRules);
308 _worldPacket << Size<uint32>(AvailableGameModeIDs);
316 _worldPacket << Size<uint32>(DebugTimeEvents);
319
322
324
327
328 for (GameModeData const& disabledGameMode : DisabledGameModes)
329 _worldPacket << disabledGameMode;
330
331 for (GameRuleValuePair const& gameRuleValue : GameRules)
332 _worldPacket << gameRuleValue;
333
334 if (!AvailableGameModeIDs.empty())
336
337 for (DebugTimeEventInfo const& debugTimeEventInfo : DebugTimeEvents)
338 _worldPacket << debugTimeEventInfo;
339
340 return &_worldPacket;
341}
342
344{
345 data << Bits<1>(variable.UpdateType);
346 data << SizedCString::BitsSize<24>(variable.Name);
347 data << SizedCString::BitsSize<24>(variable.Value);
348 data.FlushBits();
349
350 data << SizedCString::Data(variable.Name);
351 data << SizedCString::Data(variable.Value);
352
353 return data;
354}
355
357{
358 _worldPacket << Size<uint32>(Variables);
359 for (MirrorVarSingle const& variable : Variables)
360 _worldPacket << variable;
361
362 return &_worldPacket;
363}
364
366{
367 _worldPacket << BitsSize<4>(*Text);
369
370 for (std::string const& line : *Text)
371 {
372 _worldPacket << SizedString::BitsSize<7>(line);
374
376 }
377
378 return &_worldPacket;
379}
380
382{
383 _worldPacket << SizedString::BitsSize<7>(ServerTimeTZ);
384 _worldPacket << SizedString::BitsSize<7>(GameTimeTZ);
385 _worldPacket << SizedString::BitsSize<7>(ServerRegionalTimeTZ);
387
391
392 return &_worldPacket;
393}
394}
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:130
void FlushBits()
Definition ByteBuffer.h:141
WorldPacket _worldPacket
Definition Packet.h:43
Optional< EuropaTicketConfig > EuropaTicketSystemStatus
std::vector< DebugTimeEventInfo > DebugTimeEvents
bool BNSendGameDataUseV2Services
BNSendGameData will send to v2.NotificationService instead of v1.NotificationService.
bool BNSendWhisperUseV2Services
BNSendWhisper will send to v2.WhisperService instead of v1.NotificationService.
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
bool BNSendWhisperUseV2Services
BNSendWhisper will send to v2.WhisperService instead of v1.NotificationService.
bool BNSendGameDataUseV2Services
BNSendGameData will send to v2.NotificationService instead of v1.NotificationService.
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