mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-22 21:35:40 +08:00
Add methods to receive and write raw FSD messages
This commit adds methods to register for live FSD message reception. The amount of traffic can be quite high, therefore no normal signal is used - which would be available via DBus. Instead one has to connect manually by passing a functor. This guarantees that we communicate only in-process. If someone tries to connect on the proxy side, the connection will fail. This needs to be handled properly in client code. This commit also adds a method to write the FSD message to a selected file. Maniphest Tasks: T222
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <vatlib/vatlib.h>
|
||||
#include <QByteArray>
|
||||
#include <QFile>
|
||||
#include <QJsonObject>
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
@@ -165,6 +166,7 @@ namespace BlackCore
|
||||
static void onPilotPositionUpdate(VatFsdClient *, const char *callsign, const VatPilotPosition *position, void *cbvar);
|
||||
static void onAircraftConfigReceived(VatFsdClient *, const char *callsign, const char *aircraftConfig, void *cbvar);
|
||||
static void onCustomPacketReceived(VatFsdClient *, const char *callsign, const char *packetId, const char **data, int dataSize, void *cbvar);
|
||||
static void onRawFsdMessage(VatFsdClient *, const char *message, void *cbvar);
|
||||
//! @}
|
||||
|
||||
QByteArray toFSD(const QString &qstr) const;
|
||||
@@ -198,6 +200,8 @@ namespace BlackCore
|
||||
void sendPositionUpdate();
|
||||
void sendInterimPositions();
|
||||
void customPacketDispatcher(const BlackMisc::Aviation::CCallsign &callsign, const QString &packetId, const QStringList &data);
|
||||
void handleRawFsdMessage(const QString &fsdMessage);
|
||||
void fsdMessageSettingsChanged();
|
||||
|
||||
signals:
|
||||
void terminate(); //!< \private
|
||||
@@ -251,10 +255,11 @@ namespace BlackCore
|
||||
{
|
||||
QDateTime m_queryTime = QDateTime::currentDateTimeUtc();
|
||||
QStringList m_atisMessage;
|
||||
|
||||
};
|
||||
|
||||
QHash<BlackMisc::Aviation::CCallsign, PendingAtisQuery> m_pendingAtisQueries;
|
||||
|
||||
BlackMisc::CSettingReadOnly<BlackCore::Vatsim::TRawFsdMessageSetting> m_fsdMessageSetting { this, &CNetworkVatlib::fsdMessageSettingsChanged };
|
||||
QFile m_rawFsdMessageLogFile;
|
||||
};
|
||||
} //namespace
|
||||
} //namespace
|
||||
|
||||
Reference in New Issue
Block a user