Core/PacketIO: Handle ConnectToFailed and allow the client to reconnect up to 5 times before aborting login to world
Closes #14214
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#include "WardenWin.h"
|
||||
#include "WardenMac.h"
|
||||
#include "BattlenetServerManager.h"
|
||||
#include "AuthenticationPackets.h"
|
||||
#include "CharacterPackets.h"
|
||||
#include "ClientConfigPackets.h"
|
||||
#include "MiscPackets.h"
|
||||
@@ -183,8 +184,10 @@ std::string WorldSession::GetPlayerInfo() const
|
||||
std::ostringstream ss;
|
||||
|
||||
ss << "[Player: " << GetPlayerName() << " (";
|
||||
if (_player != NULL)
|
||||
if (_player)
|
||||
ss << _player->GetGUID().ToString() << ", ";
|
||||
else if (!m_playerLoading.IsEmpty())
|
||||
ss << "Logging in: " << m_playerLoading.ToString() << ", ";
|
||||
|
||||
ss << "Account: " << GetAccountId() << ")]";
|
||||
|
||||
@@ -704,6 +707,21 @@ void WorldSession::Handle_ServerSide(WorldPacket& recvPacket)
|
||||
, GetOpcodeNameForLogging(static_cast<OpcodeClient>(recvPacket.GetOpcode())).c_str(), GetPlayerInfo().c_str());
|
||||
}
|
||||
|
||||
void WorldSession::SendConnectToInstance(WorldPackets::Auth::ConnectToSerial serial)
|
||||
{
|
||||
boost::system::error_code ignored_error;
|
||||
boost::asio::ip::tcp::endpoint instanceAddress = realm.GetAddressForClient(boost::asio::ip::address::from_string(GetRemoteAddress(), ignored_error));
|
||||
instanceAddress.port(sWorld->getIntConfig(CONFIG_PORT_INSTANCE));
|
||||
|
||||
WorldPackets::Auth::ConnectTo connectTo;
|
||||
connectTo.Key = MAKE_PAIR64(GetAccountId(), CONNECTION_TYPE_INSTANCE);
|
||||
connectTo.Serial = serial;
|
||||
connectTo.Payload.Where = instanceAddress;
|
||||
connectTo.Con = CONNECTION_TYPE_INSTANCE;
|
||||
|
||||
SendPacket(connectTo.Write());
|
||||
}
|
||||
|
||||
void WorldSession::LoadGlobalAccountData()
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_DATA);
|
||||
|
||||
Reference in New Issue
Block a user