TrinityCore
Loading...
Searching...
No Matches
AuthHandler.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 "WorldSession.h"
19#include "ClientConfigPackets.h"
20
21void WorldSession::SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos)
22{
23 WorldPacket packet(SMSG_AUTH_RESPONSE, 1 + 4 + 1 + 4 + 1 + (4 + 1));
24 packet << uint8(code);
25 packet << uint32(0); // BillingTimeRemaining
26 packet << uint8(0); // BillingPlanFlags
27 packet << uint32(0); // BillingTimeRested
28 packet << uint8(Expansion()); // 0 - normal, 1 - TBC, 2 - WOTLK, must be set in database manually for each account
29
30 if (!shortForm)
31 {
32 packet << uint32(queuePos); // Queue position
33 packet << uint8(0); // Realm has a free character migration - bool
34 }
35
36 SendPacket(&packet);
37}
38
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
uint8 Expansion() const
void SendClientCacheVersion(uint32 version)
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
void SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos=0)
@ SMSG_AUTH_RESPONSE
Definition Opcodes.h:523