diff --git a/src/blackcore/fsd/fsdclient.cpp b/src/blackcore/fsd/fsdclient.cpp index ad1384a01..3f53e104c 100644 --- a/src/blackcore/fsd/fsdclient.cpp +++ b/src/blackcore/fsd/fsdclient.cpp @@ -92,6 +92,7 @@ namespace BlackCore connect(&m_socket, &QTcpSocket::readyRead, this, &CFSDClient::readDataFromSocket); connect(&m_socket, qOverload(&QTcpSocket::error), this, &CFSDClient::printSocketError, Qt::QueuedConnection); connect(&m_socket, qOverload(&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) diff --git a/src/blackcore/fsd/fsdclient.h b/src/blackcore/fsd/fsdclient.h index 2a3e34e03..a4744dca5 100644 --- a/src/blackcore/fsd/fsdclient.h +++ b/src/blackcore/fsd/fsdclient.h @@ -309,6 +309,7 @@ namespace BlackCore void printSocketError(QAbstractSocket::SocketError socketError); void handleSocketError(QAbstractSocket::SocketError socketError); + void handleSocketConnected(); void updateConnectionStatus(BlackMisc::Network::CConnectionStatus newStatus);