[FSD] Send login immediately after connecting for legacy FSD server

This commit is contained in:
Roland Rossgotterer
2019-10-24 17:32:07 +02:00
committed by Mat Sutcliffe
parent 2ac58deda1
commit 5af2366575
2 changed files with 11 additions and 0 deletions

View File

@@ -92,6 +92,7 @@ namespace BlackCore
connect(&m_socket, &QTcpSocket::readyRead, this, &CFSDClient::readDataFromSocket);
connect(&m_socket, qOverload<QAbstractSocket::SocketError>(&QTcpSocket::error), this, &CFSDClient::printSocketError, Qt::QueuedConnection);
connect(&m_socket, qOverload<QAbstractSocket::SocketError>(&QTcpSocket::error), this, &CFSDClient::handleSocketError, Qt::QueuedConnection);
connect(&m_socket, &QTcpSocket::connected, this, &CFSDClient::handleSocketConnected);
m_positionUpdateTimer.setObjectName(this->objectName().append(":m_positionUpdateTimer"));
connect(&m_positionUpdateTimer, &QTimer::timeout, this, &CFSDClient::sendPilotDataUpdate);
@@ -1397,6 +1398,15 @@ namespace BlackCore
}
}
void CFSDClient::handleSocketConnected()
{
if (m_protocolRevision == PROTOCOL_REVISION_CLASSIC)
{
this->sendLogin();
this->updateConnectionStatus(CConnectionStatus::Connected);
}
}
void CFSDClient::updateConnectionStatus(CConnectionStatus newStatus)
{
if (m_connectionStatus != newStatus)

View File

@@ -309,6 +309,7 @@ namespace BlackCore
void printSocketError(QAbstractSocket::SocketError socketError);
void handleSocketError(QAbstractSocket::SocketError socketError);
void handleSocketConnected();
void updateConnectionStatus(BlackMisc::Network::CConnectionStatus newStatus);