mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
Naming unknown data in Authsession and implemented some checks
This commit is contained in:
@@ -723,8 +723,8 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
|||||||
// NOTE: ATM the socket is singlethread, have this in mind ...
|
// NOTE: ATM the socket is singlethread, have this in mind ...
|
||||||
uint8 digest[20];
|
uint8 digest[20];
|
||||||
uint32 clientSeed;
|
uint32 clientSeed;
|
||||||
uint32 unk2, unk3, unk5, unk6, unk7;
|
uint32 loginServerID, loginServerType, regionID, battlegroupID, realm;
|
||||||
uint64 unk4;
|
uint64 DosResponse;
|
||||||
uint32 BuiltNumberClient;
|
uint32 BuiltNumberClient;
|
||||||
uint32 id, security;
|
uint32 id, security;
|
||||||
bool skipQueue = false;
|
bool skipQueue = false;
|
||||||
@@ -748,16 +748,18 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
|||||||
|
|
||||||
// Read the content of the packet
|
// Read the content of the packet
|
||||||
recvPacket >> BuiltNumberClient; // for now no use
|
recvPacket >> BuiltNumberClient; // for now no use
|
||||||
recvPacket >> unk2;
|
recvPacket >> loginServerID;
|
||||||
recvPacket >> account;
|
recvPacket >> account;
|
||||||
recvPacket >> unk3;
|
recvPacket >> loginServerType;
|
||||||
recvPacket >> clientSeed;
|
recvPacket >> clientSeed;
|
||||||
recvPacket >> unk5 >> unk6 >> unk7;
|
recvPacket >> loginServerType;
|
||||||
recvPacket >> unk4;
|
recvPacket >> regionID;
|
||||||
|
recvPacket >> realm;
|
||||||
|
recvPacket >> DosResponse;
|
||||||
recvPacket.read(digest, 20);
|
recvPacket.read(digest, 20);
|
||||||
|
|
||||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||||
sLog->outStaticDebug ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u", BuiltNumberClient, unk2, account.c_str(), unk3, clientSeed);
|
sLog->outStaticDebug ("WorldSocket::HandleAuthSession: client %u, loginServerID %u, account %s, loginServerType %u, clientseed %u", BuiltNumberClient, loginServerID, account.c_str(), loginServerType, clientSeed);
|
||||||
#endif
|
#endif
|
||||||
// Get the account information from the realmd database
|
// Get the account information from the realmd database
|
||||||
// 0 1 2 3 4 5 6 7 8 9
|
// 0 1 2 3 4 5 6 7 8 9
|
||||||
@@ -948,6 +950,28 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
|
|||||||
|
|
||||||
m_Crypt.Init(&k);
|
m_Crypt.Init(&k);
|
||||||
|
|
||||||
|
// First reject the connection if packet contains invalid data or realm state doesn't allow logging in
|
||||||
|
if (sWorld->IsClosed())
|
||||||
|
{
|
||||||
|
packet.Initialize (SMSG_AUTH_RESPONSE, 1);
|
||||||
|
packet << uint8 (AUTH_REJECT);
|
||||||
|
SendPacket(packet);
|
||||||
|
|
||||||
|
sLog->outError("network", "WorldSocket::HandleAuthSession: World closed, denying client (%s).", address.c_str());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (realm != realmID)
|
||||||
|
{
|
||||||
|
packet.Initialize (SMSG_AUTH_RESPONSE, 1);
|
||||||
|
packet << uint8 (REALM_LIST_REALM_NOT_FOUND);
|
||||||
|
SendPacket(packet);
|
||||||
|
|
||||||
|
sLog->outError("network", "WorldSocket::HandleAuthSession: Client %s requested connecting with realm id %u but this realm has id %u set in config.",
|
||||||
|
address.c_str(), realm, realmID);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
m_Session->LoadGlobalAccountData();
|
m_Session->LoadGlobalAccountData();
|
||||||
m_Session->LoadTutorialsData();
|
m_Session->LoadTutorialsData();
|
||||||
m_Session->ReadAddonsInfo(recvPacket);
|
m_Session->ReadAddonsInfo(recvPacket);
|
||||||
|
|||||||
Reference in New Issue
Block a user