mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
[FSD] Send login immediately after connecting for legacy FSD server
This commit is contained in:
committed by
Mat Sutcliffe
parent
2ac58deda1
commit
5af2366575
@@ -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)
|
||||
|
||||
@@ -309,6 +309,7 @@ namespace BlackCore
|
||||
|
||||
void printSocketError(QAbstractSocket::SocketError socketError);
|
||||
void handleSocketError(QAbstractSocket::SocketError socketError);
|
||||
void handleSocketConnected();
|
||||
|
||||
void updateConnectionStatus(BlackMisc::Network::CConnectionStatus newStatus);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user