diff --git a/src/blackcore/fsd/fsdclient.cpp b/src/blackcore/fsd/fsdclient.cpp index d41582cca..3213eee5a 100644 --- a/src/blackcore/fsd/fsdclient.cpp +++ b/src/blackcore/fsd/fsdclient.cpp @@ -355,6 +355,14 @@ namespace BlackCore::Fsd } else { + if (this->isVisualPositionSendingEnabledForServer()) + { + // Slowfast must be sent before the ordinary update. + // Sending after causes a server performance issue. + // See https://discord.com/channels/775552633918062643/775736423319732256/960746661259390996 + sendVisualPilotDataUpdate(true); + } + PilotRating r = this->getPilotRating(); PilotDataUpdate pilotDataUpdate(myAircraft.getTransponderMode(), getOwnCallsignAsString(), @@ -371,11 +379,6 @@ namespace BlackCore::Fsd myAircraft.getParts().isOnGround()); sendQueudedMessage(pilotDataUpdate); } - - if (this->isVisualPositionSendingEnabledForServer()) - { - sendVisualPilotDataUpdate(true); - } } void CFSDClient::sendInterimPilotDataUpdate() diff --git a/tests/blackcore/fsd/testfsdclient/testfsdclient.cpp b/tests/blackcore/fsd/testfsdclient/testfsdclient.cpp index f1b859021..660b9d1c1 100644 --- a/tests/blackcore/fsd/testfsdclient/testfsdclient.cpp +++ b/tests/blackcore/fsd/testfsdclient/testfsdclient.cpp @@ -445,7 +445,7 @@ namespace BlackFsdTest m_client->sendPilotDataUpdate(); QCOMPARE(spy.count(), 2); - const QList arguments = spy.takeFirst(); + const QList arguments = spy.takeLast(); QCOMPARE(arguments.size(), 1); const CRawFsdMessage fsdMessage = arguments.at(0).value(); const QString fsdRawMessage = fsdMessage.getRawMessage(); @@ -477,7 +477,7 @@ namespace BlackFsdTest m_client->sendPilotDataUpdate(); QCOMPARE(spy.count(), 2); - QList arguments = spy.takeFirst(); + QList arguments = spy.takeLast(); QCOMPARE(arguments.size(), 1); CRawFsdMessage fsdMessage = arguments.at(0).value(); @@ -510,7 +510,7 @@ namespace BlackFsdTest m_client->sendPilotDataUpdate(); QCOMPARE(spy.count(), 2); - QList arguments = spy.takeFirst(); + QList arguments = spy.takeLast(); QCOMPARE(arguments.size(), 1); CRawFsdMessage fsdMessage = arguments.at(0).value();