TrinityCore
Loading...
Searching...
No Matches
CharacterPackets.h
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#ifndef TRINITYCORE_CHARACTER_PACKETS_H
19#define TRINITYCORE_CHARACTER_PACKETS_H
20
21#include "Packet.h"
22#include "ObjectGuid.h"
23#include "Optional.h"
24#include "PacketUtilities.h"
25#include "Position.h"
26#include "RaceMask.h"
27#include "SharedDefines.h"
28#include "UnitDefines.h"
29#include "UpdateFields.h"
30#include <array>
31#include <memory>
32
33class Field;
34
35namespace UF
36{
38
39 ByteBuffer& operator<<(ByteBuffer& data, ChrCustomizationChoice const& customizationChoice);
40 ByteBuffer& operator>>(ByteBuffer& data, ChrCustomizationChoice& customizationChoice);
41}
42
43namespace WorldPackets
44{
45 namespace Character
46 {
48
49 class EnumCharacters final : public ClientPacket
50 {
51 public:
52 explicit EnumCharacters(WorldPacket&& packet);
53
54 void Read() override { }
55 };
56
74
76 {
77 std::string NewName;
79 };
80
88
99
109
118
126
128 {
134 std::vector<WarbandGroupMember> Members;
135 std::string_view Name;
136 };
137
139 {
140 public:
142 {
150 CharacterInfoBasic(Field const* fields);
151
155 std::string Name;
160 std::vector<ChrCustomizationChoice> Customizations;
170 bool FirstLogin = false;
179
183
185
197
198 std::array<VisualItemInfo, 19> VisualItems = { };
201 bool RealmInfoFound = false;
202 bool IsRealmOffline = false;
203 };
204
206 {
207 bool BoostInProgress = false;
209 std::vector<std::string> MailSenders;
210 std::vector<uint32> MailSenderTypes;
211 bool RpeAvailable = false;
212 };
213
221
234
241
243 {
245 bool HasUnlockedLicense = false;
248 bool HideRaceOnClient = false;
250 std::vector<ClassUnlock> ClassUnlocks;
251 };
252
258
260 {
261 enum
262 {
264 Level
265 };
266
269 };
270
272
273 WorldPacket const* Write() override;
274
275 bool Success = false;
276 bool Realmless = false;
277 bool IsDeletedCharacters = false;
281 bool IsRestrictedTrial = false;
284
287
288 std::vector<CharacterInfo> Characters;
289 std::vector<RegionwideCharacterListEntry> RegionwideCharacters;
290 std::vector<RaceUnlock> RaceUnlockData;
291 std::vector<UnlockedConditionalAppearance> UnlockedConditionalAppearances;
292 std::vector<RaceLimitDisableInfo> RaceLimitDisables;
293 std::vector<WarbandGroup> WarbandGroups;
294 };
295
297 {
298 public:
300
301 void Read() override;
302
304 std::string Name;
305 };
306
308 {
309 public:
311 SequenceIndex(sequenceIndex), Result(result)
312 {
313 }
314
315 WorldPacket const* Write() override;
316
319 };
320
321 class CreateCharacter final : public ClientPacket
322 {
323 public:
324 explicit CreateCharacter(WorldPacket&& packet) : ClientPacket(CMSG_CREATE_CHARACTER, std::move(packet)) { }
325
326 void Read() override;
327
341 std::shared_ptr<CharacterCreateInfo> CreateInfo;
342 };
343
344 class CreateChar final : public ServerPacket
345 {
346 public:
348
349 WorldPacket const* Write() override;
350
353 };
354
355 class CharDelete final : public ClientPacket
356 {
357 public:
358 explicit CharDelete(WorldPacket&& packet): ClientPacket(CMSG_CHAR_DELETE, std::move(packet)) { }
359
360 void Read() override;
361
363 };
364
365 class DeleteChar final : public ServerPacket
366 {
367 public:
369
370 WorldPacket const* Write() override;
371
373 };
374
376 {
377 public:
379
380 void Read() override;
381
386 std::shared_ptr<CharacterRenameInfo> RenameInfo;
387 };
388
390 {
391 public:
393
394 WorldPacket const* Write() override;
395
396 std::string Name;
399 };
400
401 class CharCustomize final : public ClientPacket
402 {
403 public:
404 explicit CharCustomize(WorldPacket&& packet) : ClientPacket(CMSG_CHAR_CUSTOMIZE, std::move(packet)) { }
405
406 void Read() override;
407
418 std::shared_ptr<CharCustomizeInfo> CustomizeInfo;
419 };
420
422 {
423 public:
424 explicit CharCustomizeSuccess(CharCustomizeInfo const* customizeInfo);
425
426 WorldPacket const* Write() override;
427
429 std::string CharName;
432 };
433
435 {
436 public:
438
439 WorldPacket const* Write() override;
440
443 };
444
446 {
447 public:
449
450 void Read() override;
451
464 std::shared_ptr<CharRaceOrFactionChangeInfo> RaceOrFactionChangeInfo;
465 };
466
474
486
488 {
489 public:
491
492 void Read() override;
493
496 };
497
499 {
500 public:
502
503 WorldPacket const* Write() override;
504
505 std::string Name;
506 bool Success = false;
507 };
508
509 class ReorderCharacters final : public ClientPacket
510 {
511 public:
517
518 explicit ReorderCharacters(WorldPacket&& packet);
519
520 void Read() override;
521
523 };
524
525 class UndeleteCharacter final : public ClientPacket
526 {
527 public:
529
530 void Read() override;
531
536 std::shared_ptr<CharacterUndeleteInfo> UndeleteInfo;
537 };
538
540 {
541 public:
543
544 WorldPacket const* Write() override;
545
552 };
553
555 {
556 public:
558
559 void Read() override { }
560 };
561
573
574 class PlayerLogin final : public ClientPacket
575 {
576 public:
577 explicit PlayerLogin(WorldPacket&& packet) : ClientPacket(CMSG_PLAYER_LOGIN, std::move(packet)) { }
578
579 void Read() override;
580
582 float FarClip = 0.0f;
583 bool RPE = false;
584 };
585
586 class LoginVerifyWorld final : public ServerPacket
587 {
588 public:
590
591 WorldPacket const* Write() override;
592
596 };
597
616
626
627 class LogoutRequest final : public ClientPacket
628 {
629 public:
630 explicit LogoutRequest(WorldPacket&& packet) : ClientPacket(CMSG_LOGOUT_REQUEST, std::move(packet)) { }
631
632 void Read() override;
633
634 bool IdleLogout = false;
635 };
636
637 class LogoutResponse final : public ServerPacket
638 {
639 public:
641
642 WorldPacket const* Write() override;
643
645 bool Instant = false;
646 };
647
660
667
668 class LogoutComplete final : public ServerPacket
669 {
670 public:
672
673 WorldPacket const* Write() override;
674
675 std::unique_ptr<SwitchGameModeData> SwitchGameMode;
676 };
677
678 class LogoutCancel final : public ClientPacket
679 {
680 public:
681 explicit LogoutCancel(WorldPacket&& packet) : ClientPacket(CMSG_LOGOUT_CANCEL, std::move(packet)) { }
682
683 void Read() override { }
684 };
685
686 class LogoutCancelAck final : public ServerPacket
687 {
688 public:
690
691 WorldPacket const* Write() override { return &_worldPacket; }
692 };
693
695 {
696 public:
698
699 void Read() override;
700
702 bool Showing = false;
703 };
704
705 class InitialSetup final : public ServerPacket
706 {
707 public:
709
710 WorldPacket const* Write() override;
711
714 };
715
717 {
718 public:
720
721 void Read() override;
722
724 };
725
726 class RequestPlayedTime final : public ClientPacket
727 {
728 public:
730
731 void Read() override;
732
733 bool TriggerScriptEvent = false;
734 };
735
736 class PlayedTime final : public ServerPacket
737 {
738 public:
740
741 WorldPacket const* Write() override;
742
745 bool TriggerEvent = false;
746 };
747
748 class SetTitle final : public ClientPacket
749 {
750 public:
751 explicit SetTitle(WorldPacket&& packet) : ClientPacket(CMSG_SET_TITLE, std::move(packet)) { }
752
753 void Read() override;
754
756 };
757
771
772 class BarberShopResult final : public ServerPacket
773 {
774 public:
775 enum class ResultEnum : uint8
776 {
777 Success = 0,
778 NoMoney = 1,
779 NotOnChair = 2,
780 NoMoney2 = 3
781 };
782
784
785 WorldPacket const* Write() override;
786
788 };
789
790 class LogXPGain final : public ServerPacket
791 {
792 public:
793 explicit LogXPGain() : ServerPacket(SMSG_LOG_XP_GAIN, 16 + 4 + 1 + 4 + 4) { }
794
795 WorldPacket const* Write() override;
796
801 float GroupBonus = 0.0f;
802 };
803
804 class TitleEarned final : public ServerPacket
805 {
806 public:
807 explicit TitleEarned(OpcodeServer opcode) : ServerPacket(opcode, 4) { }
808
809 WorldPacket const* Write() override;
810
812 };
813
814 class SetFactionAtWar final : public ClientPacket
815 {
816 public:
817 explicit SetFactionAtWar(WorldPacket&& packet) : ClientPacket(CMSG_SET_FACTION_AT_WAR, std::move(packet)) { }
818
819 void Read() override;
820
822 };
823
824 class SetFactionNotAtWar final : public ClientPacket
825 {
826 public:
828
829 void Read() override;
830
832 };
833
834 class SetFactionInactive final : public ClientPacket
835 {
836 public:
838
839 void Read() override;
840
842 bool State = false;
843 };
844
845 class SetWatchedFaction final : public ClientPacket
846 {
847 public:
849
850 void Read() override;
851
853 };
854
856 {
857 public:
859
860 WorldPacket const* Write() override;
861
863 };
864
866 {
867 public:
869
870 void Read() override;
871
874 };
875
877 {
878 public:
880
881 WorldPacket const* Write() override;
882
885 };
886
887 class SavePersonalEmblem final : public ClientPacket
888 {
889 public:
891
892 void Read() override;
893
896 };
897
899 {
900 public:
902
903 WorldPacket const* Write() override;
904
906 };
907 }
908}
909
910#endif // TRINITYCORE_CHARACTER_PACKETS_H
uint8_t uint8
Definition Define.h:156
int16_t int16
Definition Define.h:151
int8_t int8
Definition Define.h:152
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
OpcodeServer
Definition Opcodes.h:1085
@ SMSG_SET_FACTION_VISIBLE
Definition Opcodes.h:2282
@ SMSG_PLAYER_SAVE_PERSONAL_EMBLEM
Definition Opcodes.h:2098
@ SMSG_SET_PLAYER_DECLINED_NAMES_RESULT
Definition Opcodes.h:2294
@ SMSG_UNDELETE_COOLDOWN_STATUS_RESPONSE
Definition Opcodes.h:2406
@ SMSG_LOGOUT_RESPONSE
Definition Opcodes.h:1825
@ SMSG_SET_FACTION_NOT_VISIBLE
Definition Opcodes.h:2280
@ SMSG_INITIAL_SETUP
Definition Opcodes.h:1714
@ SMSG_CHAR_FACTION_CHANGE_RESULT
Definition Opcodes.h:1312
@ SMSG_CHAR_CUSTOMIZE_FAILURE
Definition Opcodes.h:1310
@ SMSG_CREATE_CHAR
Definition Opcodes.h:1394
@ SMSG_LOGOUT_COMPLETE
Definition Opcodes.h:1824
@ SMSG_GENERATE_RANDOM_CHARACTER_NAME_RESULT
Definition Opcodes.h:1550
@ SMSG_CHARACTER_LOGIN_FAILED
Definition Opcodes.h:1303
@ SMSG_LOGIN_VERIFY_WORLD
Definition Opcodes.h:1822
@ SMSG_UNDELETE_CHARACTER_RESPONSE
Definition Opcodes.h:2405
@ SMSG_BARBER_SHOP_RESULT
Definition Opcodes.h:1178
@ SMSG_CHECK_CHARACTER_NAME_AVAILABILITY_RESULT
Definition Opcodes.h:1329
@ SMSG_LOG_XP_GAIN
Definition Opcodes.h:1826
@ SMSG_ENUM_CHARACTERS_RESULT
Definition Opcodes.h:1442
@ SMSG_CHARACTER_RENAME_RESULT
Definition Opcodes.h:1305
@ SMSG_LOGOUT_CANCEL_ACK
Definition Opcodes.h:1823
@ SMSG_DELETE_CHAR
Definition Opcodes.h:1409
@ SMSG_PLAYED_TIME
Definition Opcodes.h:2083
@ CMSG_GET_UNDELETE_CHARACTER_COOLDOWN_STATUS
Definition Opcodes.h:398
@ CMSG_LOGOUT_REQUEST
Definition Opcodes.h:558
@ CMSG_SET_WATCHED_FACTION
Definition Opcodes.h:943
@ CMSG_SET_FACTION_AT_WAR
Definition Opcodes.h:913
@ CMSG_LOADING_SCREEN_NOTIFY
Definition Opcodes.h:542
@ CMSG_SET_FACTION_INACTIVE
Definition Opcodes.h:914
@ CMSG_GENERATE_RANDOM_CHARACTER_NAME
Definition Opcodes.h:379
@ CMSG_SET_ACTION_BAR_TOGGLES
Definition Opcodes.h:897
@ CMSG_SET_TITLE
Definition Opcodes.h:937
@ CMSG_SET_FACTION_NOT_AT_WAR
Definition Opcodes.h:915
@ CMSG_UNDELETE_CHARACTER
Definition Opcodes.h:1011
@ CMSG_CHECK_CHARACTER_NAME_AVAILABILITY
Definition Opcodes.h:235
@ CMSG_CHAR_DELETE
Definition Opcodes.h:190
@ CMSG_CHAR_RACE_OR_FACTION_CHANGE
Definition Opcodes.h:191
@ CMSG_SET_PLAYER_DECLINED_NAMES
Definition Opcodes.h:925
@ CMSG_CHAR_CUSTOMIZE
Definition Opcodes.h:189
@ CMSG_SAVE_PERSONAL_EMBLEM
Definition Opcodes.h:878
@ CMSG_CHARACTER_RENAME_REQUEST
Definition Opcodes.h:186
@ CMSG_REQUEST_PLAYED_TIME
Definition Opcodes.h:851
@ CMSG_ALTER_APPEARANCE
Definition Opcodes.h:59
@ CMSG_LOGOUT_CANCEL
Definition Opcodes.h:555
@ CMSG_PLAYER_LOGIN
Definition Opcodes.h:755
@ CMSG_CREATE_CHARACTER
Definition Opcodes.h:311
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
@ RACE_NONE
Definition RaceMask.h:28
@ CLASS_NONE
@ GENDER_NONE
Class used to access individual fields of database query result.
Definition Field.h:94
Array< ChrCustomizationChoice, 250 > Customizations
Array< ChrCustomizationChoice, 250 > const & Customizations
std::shared_ptr< CharCustomizeInfo > CustomizeInfo
ObjectGuid Guid
Guid of the character to delete.
Optional< CharFactionChangeDisplayInfo > Display
std::shared_ptr< CharRaceOrFactionChangeInfo > RaceOrFactionChangeInfo
std::shared_ptr< CharacterRenameInfo > RenameInfo
CheckCharacterNameAvailabilityResult(uint32 sequenceIndex, uint32 result)
WorldPacket const * Write() override
std::shared_ptr< CharacterCreateInfo > CreateInfo
WorldPacket const * Write() override
std::vector< CharacterInfo > Characters
all characters on the list
bool IgnoreNewPlayerRestrictions
allows client to skip new player restrictions
std::vector< RegionwideCharacterListEntry > RegionwideCharacters
bool IsDeletedCharacters
used for character undelete list
std::vector< RaceLimitDisableInfo > RaceLimitDisables
bool IsNewcomerChatCompleted
forbids hero classes and allied races
std::vector< UnlockedConditionalAppearance > UnlockedConditionalAppearances
bool IsRestrictedNewPlayer
forbids using level boost and class trials
WorldPacket const * Write() override
WorldPacket const * Write() override
TaggedPosition< Position::XYZO > Pos
WorldPacket const * Write() override
WorldPacket const * Write() override
std::unique_ptr< SwitchGameModeData > SwitchGameMode
WorldPacket const * Write() override
WorldPacket const * Write() override
float FarClip
Visibility distance (for terrain)
ObjectGuid Guid
Guid of the player that is logging in.
WorldPacket const * Write() override
std::shared_ptr< CharacterUndeleteInfo > UndeleteInfo
uint32 CurrentCooldown
Current cooldown until next free character restoration. (in sec)
uint32 MaxCooldown
Max. cooldown until next free character restoration. Displayed in undelete confirm message....
WorldPacket _worldPacket
Definition Packet.h:43
ByteBuffer & operator>>(ByteBuffer &data, ChrCustomizationChoice &customizationChoice)
ByteBuffer & operator<<(ByteBuffer &data, ChrCustomizationChoice const &customizationChoice)
UF::ChrCustomizationChoice ChrCustomizationChoice
STL namespace.
Array< ChrCustomizationChoice, 250 > Customizations
Array< ChrCustomizationChoice, 250 > const * Customizations
Array< ChrCustomizationChoice, 250 > Customizations
Array< ChrCustomizationChoice, 250 > Customizations
ObjectGuid CharacterGuid
User specified variables.
uint64 GuildClubMemberID
same as bgs.protocol.club.v1.MemberId.unique_id, guessed basing on SMSG_QUERY_PLAYER_NAME_RESPONSE (t...
Array< ChrCustomizationChoice, 250 > Customizations
Array< ChrCustomizationChoice, 250 > Unknown_1107_4
std::vector< WarbandGroupMember > Members
uint32 Flags
enum WarbandGroupFlags { Collapsed = 1 }