TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WorldPackets::Auth::AuthResponse Class Referencefinal

#include <AuthenticationPackets.h>

Classes

struct  AuthSuccessInfo
 
struct  AuthWaitInfo
 
struct  RealmInfo
 

Public Member Functions

 AuthResponse ()
 
WorldPacket constWrite () override
 
- Public Member Functions inherited from WorldPackets::ServerPacket
 ServerPacket (OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
void Read () overridefinal
 
void Clear ()
 
WorldPacket && Move ()
 
OpcodeServer GetOpcode () const
 
- Public Member Functions inherited from WorldPackets::Packet
 Packet (WorldPacket &&worldPacket)
 
virtual ~Packet ()=default
 
 Packet (Packet const &right)=delete
 
Packetoperator= (Packet const &right)=delete
 
WorldPacket constGetRawPacket () const
 
size_t GetSize () const
 
ConnectionType GetConnection () const
 

Public Attributes

Optional< AuthSuccessInfoSuccessInfo
 contains the packet data in case that it has account information (It is never set when WaitInfo is set), otherwise its contents are undefined. More...
 
Optional< AuthWaitInfoWaitInfo
 contains the queue wait information in case the account is in the login queue. More...
 
uint32 Result = 0
 the result of the authentication process, possible values are BattlenetRpcErrorCode More...
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Auth::AuthResponse::AuthResponse ( )
60 {
61 }
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.h:49
Definition: Opcodes.h:774

Member Function Documentation

WorldPacket const * WorldPackets::Auth::AuthResponse::Write ( )
overridevirtual

the current race

the required Expansion

the current class

the required Expansion

Implements WorldPackets::Packet.

64 {
66  _worldPacket.WriteBit(SuccessInfo.is_initialized());
67  _worldPacket.WriteBit(WaitInfo.is_initialized());
69 
70  if (SuccessInfo)
71  {
72  _worldPacket << uint32(SuccessInfo->VirtualRealmAddress);
73  _worldPacket << uint32(SuccessInfo->VirtualRealms.size());
74  _worldPacket << uint32(SuccessInfo->TimeRested);
75  _worldPacket << uint8(SuccessInfo->ActiveExpansionLevel);
76  _worldPacket << uint8(SuccessInfo->AccountExpansionLevel);
77  _worldPacket << uint32(SuccessInfo->TimeSecondsUntilPCKick);
78  _worldPacket << uint32(SuccessInfo->AvailableRaces->size());
79  _worldPacket << uint32(SuccessInfo->AvailableClasses->size());
80  _worldPacket << uint32(SuccessInfo->Templates.size());
81  _worldPacket << uint32(SuccessInfo->CurrencyID);
82 
83  {
84  _worldPacket << uint32(SuccessInfo->Billing.BillingPlan);
85  _worldPacket << uint32(SuccessInfo->Billing.TimeRemain);
86  // 3x same bit is not a mistake - preserves legacy client behavior of BillingPlanFlags::SESSION_IGR
87  _worldPacket.WriteBit(SuccessInfo->Billing.InGameRoom); // inGameRoom check in function checking which lua event to fire when remaining time is near end - BILLING_NAG_DIALOG vs IGR_BILLING_NAG_DIALOG
88  _worldPacket.WriteBit(SuccessInfo->Billing.InGameRoom); // inGameRoom lua return from Script_GetBillingPlan
89  _worldPacket.WriteBit(SuccessInfo->Billing.InGameRoom); // not used anywhere in the client
91  }
92 
93  for (auto& virtualRealm : SuccessInfo->VirtualRealms)
94  {
95  _worldPacket << uint32(virtualRealm.RealmAddress);
96  _worldPacket.WriteBit(virtualRealm.IsLocal);
97  _worldPacket.WriteBit(virtualRealm.IsInternalRealm);
98  _worldPacket.WriteBits(virtualRealm.RealmNameActual.length(), 8);
99  _worldPacket.WriteBits(virtualRealm.RealmNameNormalized.length(), 8);
101 
102  _worldPacket.WriteString(virtualRealm.RealmNameActual);
103  _worldPacket.WriteString(virtualRealm.RealmNameNormalized);
104  }
105 
106  for (auto& race : *SuccessInfo->AvailableRaces)
107  {
108  _worldPacket << uint8(race.first);
109  _worldPacket << uint8(race.second);
110  }
111 
112  for (auto& klass : *SuccessInfo->AvailableClasses)
113  {
114  _worldPacket << uint8(klass.first);
115  _worldPacket << uint8(klass.second);
116  }
117 
118  for (auto& templat : SuccessInfo->Templates)
119  {
120  _worldPacket << uint32(templat.TemplateSetId);
121  _worldPacket << uint32(templat.Classes.size());
122  for (auto& templateClass : templat.Classes)
123  {
124  _worldPacket << uint8(templateClass.ClassID);
125  _worldPacket << uint8(templateClass.FactionGroup);
126  }
127 
128  _worldPacket.WriteBits(templat.Name.length(), 7);
129  _worldPacket.WriteBits(templat.Description.length(), 10);
131 
132  _worldPacket.WriteString(templat.Name);
133  _worldPacket.WriteString(templat.Description);
134  }
135 
136  _worldPacket.WriteBit(SuccessInfo->IsExpansionTrial);
137  _worldPacket.WriteBit(SuccessInfo->ForceCharacterTemplate);
138  _worldPacket.WriteBit(SuccessInfo->NumPlayersHorde.is_initialized());
139  _worldPacket.WriteBit(SuccessInfo->NumPlayersAlliance.is_initialized());
141 
142  if (SuccessInfo->NumPlayersHorde)
143  _worldPacket << uint16(*SuccessInfo->NumPlayersHorde);
144 
145  if (SuccessInfo->NumPlayersAlliance)
146  _worldPacket << uint16(*SuccessInfo->NumPlayersAlliance);
147  }
148 
149  if (WaitInfo)
150  {
151  _worldPacket << uint32(WaitInfo->WaitCount);
152  _worldPacket << uint32(WaitInfo->WaitTime);
153  _worldPacket.WriteBit(WaitInfo->HasFCM);
155  }
156 
157  return &_worldPacket;
158 }
void FlushBits()
Definition: ByteBuffer.h:150
WorldPacket _worldPacket
Definition: Packet.h:43
uint16_t uint16
Definition: g3dmath.h:166
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
Optional< AuthWaitInfo > WaitInfo
contains the queue wait information in case the account is in the login queue.
Definition: AuthenticationPackets.h:130
void WriteString(std::string const &str)
Definition: ByteBuffer.h:540
uint32 Result
the result of the authentication process, possible values are BattlenetRpcErrorCode ...
Definition: AuthenticationPackets.h:131
uint8_t uint8
Definition: g3dmath.h:164
uint32_t uint32
Definition: g3dmath.h:168
Optional< AuthSuccessInfo > SuccessInfo
contains the packet data in case that it has account information (It is never set when WaitInfo is se...
Definition: AuthenticationPackets.h:129
void WriteBits(T value, int32 bits)
Definition: ByteBuffer.h:198

+ Here is the caller graph for this function:

Member Data Documentation

uint32 WorldPackets::Auth::AuthResponse::Result = 0

the result of the authentication process, possible values are BattlenetRpcErrorCode

Optional<AuthSuccessInfo> WorldPackets::Auth::AuthResponse::SuccessInfo

contains the packet data in case that it has account information (It is never set when WaitInfo is set), otherwise its contents are undefined.

Optional<AuthWaitInfo> WorldPackets::Auth::AuthResponse::WaitInfo

contains the queue wait information in case the account is in the login queue.


The documentation for this class was generated from the following files: