mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Send slowfast before ordinary position update
This solves a server-side performance issue.
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -445,7 +445,7 @@ namespace BlackFsdTest
|
||||
m_client->sendPilotDataUpdate();
|
||||
|
||||
QCOMPARE(spy.count(), 2);
|
||||
const QList<QVariant> arguments = spy.takeFirst();
|
||||
const QList<QVariant> arguments = spy.takeLast();
|
||||
QCOMPARE(arguments.size(), 1);
|
||||
const CRawFsdMessage fsdMessage = arguments.at(0).value<CRawFsdMessage>();
|
||||
const QString fsdRawMessage = fsdMessage.getRawMessage();
|
||||
@@ -477,7 +477,7 @@ namespace BlackFsdTest
|
||||
m_client->sendPilotDataUpdate();
|
||||
|
||||
QCOMPARE(spy.count(), 2);
|
||||
QList<QVariant> arguments = spy.takeFirst();
|
||||
QList<QVariant> arguments = spy.takeLast();
|
||||
QCOMPARE(arguments.size(), 1);
|
||||
CRawFsdMessage fsdMessage = arguments.at(0).value<CRawFsdMessage>();
|
||||
|
||||
@@ -510,7 +510,7 @@ namespace BlackFsdTest
|
||||
m_client->sendPilotDataUpdate();
|
||||
|
||||
QCOMPARE(spy.count(), 2);
|
||||
QList<QVariant> arguments = spy.takeFirst();
|
||||
QList<QVariant> arguments = spy.takeLast();
|
||||
QCOMPARE(arguments.size(), 1);
|
||||
CRawFsdMessage fsdMessage = arguments.at(0).value<CRawFsdMessage>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user