Core/PacketIO: convert all authentication related packets to packet class (#26)

This commit is contained in:
Ghaster authored and Ovah committed 2020-01-25 15:44:56 +01:00
1 parent fcb79fee07
commit 97a727749a
16 files changed
+395 -172

No files matched your search

+17 -5
View File
@@ -367,17 +367,17 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
}
// prevent character creating Expansion race without Expansion account
if (raceEntry->Race_related > Expansion())
if (raceEntry->Race_related > GetAccountExpansion())
{
TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->Race_related, createInfo->Race);
TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", GetAccountExpansion(), GetAccountId(), raceEntry->Race_related, createInfo->Race);
SendCharCreate(CHAR_CREATE_EXPANSION);
return;
}
// prevent character creating Expansion class without Expansion account
if (classEntry->Required_expansion > Expansion())
if (classEntry->Required_expansion > GetAccountExpansion())
{
TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->Required_expansion, createInfo->Class);
TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", GetAccountExpansion(), GetAccountId(), classEntry->Required_expansion, createInfo->Class);
SendCharCreate(CHAR_CREATE_EXPANSION_CLASS);
return;
}
@@ -768,7 +768,7 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recvData)
return;
}
SendConnectToInstance(WorldPackets::Auth::ConnectToSerial::Realm);
SendConnectToInstance(WorldPackets::Auth::ConnectToSerial::WorldAttempt1);
}
void WorldSession::HandleContinuePlayerLogin()
@@ -792,6 +792,18 @@ void WorldSession::HandleContinuePlayerLogin()
_charLoginCallback = CharacterDatabase.DelayQueryHolder(holder);
}
void WorldSession::AbortLogin(WorldPackets::Character::LoginFailureReason reason)
{
if (!PlayerLoading() || GetPlayer())
{
KickPlayer();
return;
}
m_playerLoading.Clear();
SendPacket(WorldPackets::Character::CharacterLoginFailed(reason).Write());
}
void WorldSession::HandleLoadScreenOpcode(WorldPacket& recvPacket)
{
TC_LOG_INFO("misc", "WORLD: Recvd CMSG_LOAD_SCREEN");