swift
fsdclient.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_CORE_FSD_CLIENT_H
7 #define SWIFT_CORE_FSD_CLIENT_H
8 
9 #include "core/fsd/enums.h"
10 #include "core/fsd/messagebase.h"
11 #include "core/swiftcoreexport.h"
15 #include "misc/aviation/callsign.h"
18 #include "misc/digestsignal.h"
22 #include "misc/network/loginmode.h"
24 #include "misc/network/server.h"
29 #include "misc/tokenbucket.h"
30 #include "misc/worker.h"
31 
32 #ifdef SWIFT_VATSIM_SUPPORT
33 # include "vatsim/vatsimauth.h"
34 #endif
35 
36 #include <atomic>
37 
38 #include <QCommandLineOption>
39 #include <QHash>
40 #include <QObject>
41 #include <QQueue>
42 #include <QReadWriteLock>
43 #include <QString>
44 #include <QTcpSocket>
45 #include <QTextCodec>
46 #include <QTimer>
47 #include <QtGlobal>
48 
51 #define PROTOCOL_REVISION_CLASSIC 9
52 #define PROTOCOL_REVISION_VATSIM_ATC 10
53 #define PROTOCOL_REVISION_VATSIM_AUTH 100
54 #define PROTOCOL_REVISION_VATSIM_VELOCITY 101
56 
57 class QNetworkReply;
58 
59 namespace SwiftFsdTest
60 {
61  class CTestFSDClient;
62 }
63 namespace swift::core::fsd
64 {
66  enum class TextMessageGroups
67  {
68  AllClients,
69  AllAtcClients,
70  AllPilotClients,
71  AllSups
72  };
73 
79  public swift::misc::network::IEcosystemProvider, // provide info about used ecosystem
80  public swift::misc::network::CClientAware, // network can set client information
81  public swift::misc::simulation::COwnAircraftAware, // network vatlib consumes own aircraft data and sets
82  // ICAO/callsign data
83  public swift::misc::simulation::CRemoteAircraftAware, // check if we really need to process network packets
84  // (e.g. parts)
85  public swift::misc::simulation::CSimulationEnvironmentAware // allows to consume ground elevations
86  {
87  Q_OBJECT
89 
90  public:
92  static const QStringList &getLogCategories();
93 
97  swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, QObject *owner = nullptr);
98 
103  void setClientName(const QString &clientName)
104  {
105  QWriteLocker l(&m_lockUserClientBuffered);
106  m_clientName = clientName;
107  }
108  void setHostApplication(const QString &hostApplication)
109  {
110  QWriteLocker l(&m_lockUserClientBuffered);
111  m_hostApplication = hostApplication;
112  }
113  void setVersion(int major, int minor)
114  {
115  QWriteLocker l(&m_lockUserClientBuffered);
116  m_versionMajor = major;
117  m_versionMinor = minor;
118  }
119 
120 #ifdef SWIFT_VATSIM_SUPPORT
121  void setClientIdAndKey(quint16 id, const QByteArray &key);
122 #endif
123 
125  {
126  QWriteLocker l(&m_lockUserClientBuffered);
127  m_capabilities = capabilities;
128  }
129  void setServer(const swift::misc::network::CServer &server);
131  {
132  QWriteLocker l(&m_lockUserClientBuffered);
133  m_loginMode = mode;
134  }
135  void setCallsign(const swift::misc::aviation::CCallsign &callsign);
137  {
138  QWriteLocker l(&m_lockUserClientBuffered);
139  m_partnerCallsign = callsign;
140  }
141  void setIcaoCodes(const swift::misc::simulation::CSimulatedAircraft &ownAircraft);
142  void setLiveryAndModelString(const QString &livery, bool sendLiveryString, const QString &modelString,
143  bool sendModelString);
144  void setSimType(const swift::misc::simulation::CSimulatorInfo &simInfo);
145  void setSimType(swift::misc::simulation::CSimulatorInfo::Simulator simulator);
147  {
148  QWriteLocker l(&m_lockUserClientBuffered);
149  m_pilotRating = rating;
150  }
151  void setAtcRating(AtcRating rating)
152  {
153  QWriteLocker l(&m_lockUserClientBuffered);
154  m_atcRating = rating;
155  }
157 
158  // ------ thread safe access to preset values -----
159 
163  {
164  QReadLocker l(&m_lockUserClientBuffered);
165  return m_server;
166  }
167 
170  QStringList getPresetValues() const;
171 
175  {
176  QReadLocker l(&m_lockUserClientBuffered);
177  return m_ownCallsign;
178  }
179 
183  {
184  QReadLocker l(&m_lockUserClientBuffered);
185  return m_partnerCallsign;
186  }
187 
191  {
192  QReadLocker l(&m_lockUserClientBuffered);
193  return m_loginMode;
194  }
195 
199  {
200  QReadLocker l(&m_lockUserClientBuffered);
201  return m_pilotRating;
202  }
203 
206  void connectToServer();
207  void disconnectFromServer();
209 
213  {
214  m_interimPositionReceivers.push_back(receiver);
215  }
217  {
218  m_interimPositionReceivers.remove(receiver);
219  }
221 
226  void sendClientQueryCapabilities(const swift::misc::aviation::CCallsign &callsign);
227  void sendClientQueryCom1Freq(const swift::misc::aviation::CCallsign &callsign);
228  void sendClientQueryRealName(const swift::misc::aviation::CCallsign &callsign);
229  void sendClientQueryServer(const swift::misc::aviation::CCallsign &callsign);
230  void sendClientQueryAtis(const swift::misc::aviation::CCallsign &callsign);
231  void sendClientQueryFlightPlan(const swift::misc::aviation::CCallsign &callsign);
232  void sendClientQueryAircraftConfig(const swift::misc::aviation::CCallsign &callsign);
233  void sendTextMessages(const swift::misc::network::CTextMessageList &messages);
234  void sendTextMessage(const swift::misc::network::CTextMessage &message);
235  void sendTextMessage(TextMessageGroups receiverGroup, const QString &message);
236  void sendRadioMessage(const QVector<int> &frequencieskHz, const QString &message);
237  void sendFlightPlan(const swift::misc::aviation::CFlightPlan &flightPlan);
238  void sendPlaneInfoRequest(const swift::misc::aviation::CCallsign &receiver);
239  void sendPlaneInfoRequestFsinn(const swift::misc::aviation::CCallsign &callsign);
241 
244  swift::misc::aviation::CCallsignSet getInterimPositionReceivers() const;
245  void setInterimPositionReceivers(const swift::misc::aviation::CCallsignSet &interimPositionReceivers);
247 
251  {
252  QReadLocker l(&m_lockConnectionStatus);
253  return m_connectionStatus;
254  }
255  bool isConnected() const { return this->getConnectionStatus().isConnected(); }
256  bool isDisconnected() const { return this->getConnectionStatus().isDisconnected(); }
257  bool isPendingConnection() const;
259 
262  bool setStatisticsEnable(bool enabled)
263  {
264  m_statistics = enabled;
265  return enabled;
266  }
267  bool isStatisticsEnabled() const { return m_statistics; }
269 
271  void clearStatistics();
272 
274  QString getNetworkStatisticsAsText(bool reset, const QString &separator = "\n");
275 
277  void printToConsole(bool on) { m_printToConsole = on; }
278 
280  void gracefulShutdown();
281 
282  signals:
289  void deleteAtcReceived(const QString &cid);
290  void deletePilotReceived(const QString &cid);
292  const swift::misc::aviation::CTransponder &transponder);
293  void pongReceived(const QString &sender, double elapsedTimeMs);
295  const swift::misc::aviation::CFlightPlan &flightPlan);
297  void aircraftConfigReceived(const QString &sender, const QJsonObject &config, qint64 currentOffsetTimeMs);
298  void validAtcResponseReceived(const QString &callsign, bool isValidAtc);
300  swift::misc::network::CClient::Capabilities capabilities);
301  void com1FrequencyResponseReceived(const QString &sender,
303  void realNameResponseReceived(const QString &sender, const QString &realName);
304  void serverResponseReceived(const QString &sender, const QString &hostName);
305  void planeInformationReceived(const QString &sender, const QString &aircraft, const QString &airline,
306  const QString &livery);
307  void customPilotPacketReceived(const QString &sender, const QStringList &data);
312  qint64 currentOffsetTimeMs, const QString &model, const QString &livery);
315  const QString &airlineIcaoDesignator, const QString &aircraftDesignator,
316  const QString &combinedAircraftType, const QString &modelString);
317  void revbAircraftConfigReceived(const QString &sender, const QString &config, qint64 currentOffsetTimeMs);
318  void muteRequestReceived(bool mute);
319 
321 
325 
327  void atisLogoffTimeReplyReceived(const swift::misc::aviation::CCallsign &callsign, const QString &zuluTime);
328 
331 
335 
337  void severeNetworkError(const QString &errorMessage);
338 
340  void killRequestReceived(const QString &reason);
341 
342  private:
346 
350  void sendLogin(const QString &token = {});
351  void sendDeletePilot();
352  void sendDeleteAtc();
353  void sendPilotDataUpdate();
354  void sendInterimPilotDataUpdate();
355  void sendVisualPilotDataUpdate(bool slowUpdate = false);
356  void sendAtcDataUpdate(double latitude, double longitude);
357  void sendPing(const QString &receiver);
358  //
359  void sendClientQueryIsValidAtc(const swift::misc::aviation::CCallsign &callsign);
360  void sendClientQuery(ClientQueryType queryType, const swift::misc::aviation::CCallsign &receiver,
361  const QStringList &queryData = {});
362  void sendTextMessage(const QString &receiver, const QString &message);
363  void sendPlaneInformation(const QString &receiver, const QString &aircraft, const QString &airline = {},
364  const QString &livery = {});
365  void sendPlaneInformationFsinn(const swift::misc::aviation::CCallsign &callsign);
366  void sendAircraftConfiguration(const QString &receiver, const QString &aircraftConfigJson);
367  //
368  void sendMessageString(const QString &message);
369  void sendQueuedMessage();
371 
374  int increaseStatisticsValue(const QString &identifier, const QString &appendix = {});
375  int increaseStatisticsValue(const QString &identifier, int value);
377 
379  template <class T>
380  void sendQueuedMessage(const T &message)
381  {
382  if (!message.isValid()) { return; }
383  if (m_unitTestMode)
384  {
385  this->sendDirectMessage(message);
386  return;
387  }
388  m_queuedFsdMessages.enqueue(messageToFSDString(message));
389  }
390 
392  template <class T>
393  void sendDirectMessage(const T &message)
394  {
395  if (!message.isValid()) { return; }
396  this->sendMessageString(messageToFSDString(message));
397  }
398 
401  void sendFsdMessage(const QString &message);
402  void setUnitTestMode(bool on) { m_unitTestMode = on; }
404 
406  static const QString &defaultModelString()
407  {
408  static const QString dm("Cessna Skyhawk 172SP");
409  return dm;
410  }
411 
413  static const QString &noModelString()
414  {
415  static const QString noms("swift empty string");
416  return noms;
417  }
418 
420  QString getConfiguredModelString(const swift::misc::simulation::CSimulatedAircraft &myAircraft) const;
421 
423  QString getConfiguredLiveryString(const swift::misc::simulation::CSimulatedAircraft &myAircraft) const;
424 
426  struct JsonPackets
427  {
428  static const QJsonObject &aircraftConfigRequest();
429  };
430 
431  void sendAuthChallenge(const QString &challenge);
432  void sendAuthResponse(const QString &response);
433  void sendPong(const QString &receiver, const QString &timestamp);
434  void sendClientResponse(ClientQueryType queryType, const QString &receiver);
435 #ifdef SWIFT_VATSIM_SUPPORT
436  void sendClientIdentification(const QString &fsdChallenge);
437 #endif
438  void sendIncrementalAircraftConfig();
439 
440  void readDataFromSocket() { this->readDataFromSocketMaxLines(); }
441  void readDataFromSocketMaxLines(int maxLines = -1);
442  void parseMessage(const QString &lineRaw);
443 
444  QString socketErrorString(QAbstractSocket::SocketError error) const;
445  static QString socketErrorToQString(QAbstractSocket::SocketError error);
446 
448  void initializeMessageTypes();
449 
450  // Type to string
451  const QString &messageTypeToString(MessageType mt) const;
452 
455  void handleAtcDataUpdate(const QStringList &tokens);
456 #ifdef SWIFT_VATSIM_SUPPORT
457  void handleAuthChallenge(const QStringList &tokens);
458  void handleAuthResponse(const QStringList &tokens);
459 #endif
460  void handleDeleteATC(const QStringList &tokens);
461  void handleDeletePilot(const QStringList &tokens);
462  void handleTextMessage(const QStringList &tokens);
463  void handlePilotDataUpdate(const QStringList &tokens);
464  void handleVisualPilotDataUpdate(const QStringList &tokens, MessageType messageType);
465  void handleVisualPilotDataToggle(const QStringList &tokens);
466  void handleEuroscopeSimData(const QStringList &tokens);
467  void handlePing(const QStringList &tokens);
468  void handlePong(const QStringList &tokens);
469  void handleKillRequest(const QStringList &tokens);
470  void handleFlightPlan(const QStringList &tokens);
471  void handleClientQuery(const QStringList &tokens);
472  void handleClientResponse(const QStringList &tokens);
473  void handleServerError(const QStringList &tokens);
474  void handleCustomPilotPacket(const QStringList &tokens);
475 #ifdef SWIFT_VATSIM_SUPPORT
476  void handleFsdIdentification(const QStringList &tokens);
477 #endif
478  void handleRevBClientPartsPacket(const QStringList &tokens);
479  void handleRehost(const QStringList &tokens);
480  void handleMute(const QStringList &tokens);
481 
482  //
483  void handleUnknownPacket(const QString &line);
484  void handleUnknownPacket(const QStringList &tokens);
486 
487  void printSocketError(QAbstractSocket::SocketError socketError);
488  void handleSocketError(QAbstractSocket::SocketError socketError);
489  void handleSocketConnected();
490 
491  void updateConnectionStatus(swift::misc::network::CConnectionStatus newStatus);
492 
495  void consolidateTextMessage(const swift::misc::network::CTextMessage &textMessage);
496 
498  void emitConsolidatedTextMessages();
499 
501  qint64 receivedPositionFixTsAndGetOffsetTime(const swift::misc::aviation::CCallsign &callsign,
502  qint64 markerTs = -1);
503 
505  qint64 currentOffsetTime(const swift::misc::aviation::CCallsign &callsign) const;
506 
508  void clearState();
509 
511  void clearState(const swift::misc::aviation::CCallsign &callsign);
512 
514  void insertLatestOffsetTime(const swift::misc::aviation::CCallsign &callsign, qint64 offsetMs);
515 
517  qint64 averageOffsetTimeMs(const swift::misc::aviation::CCallsign &callsign, int &count,
518  int maxLastValues = c_maxOffsetTimes) const;
519 
521  qint64 averageOffsetTimeMs(const swift::misc::aviation::CCallsign &callsign,
522  int maxLastValues = c_maxOffsetTimes) const;
523 
524  bool isInterimPositionSendingEnabledForServer() const;
525  bool isInterimPositionReceivingEnabledForServer() const;
526  bool isVisualPositionSendingEnabledForServer() const;
527  const swift::misc::network::CFsdSetup &getSetupForServer() const;
528 
531  void maybeHandleAtisReply(const swift::misc::aviation::CCallsign &sender,
532  const swift::misc::aviation::CCallsign &receiver, const QString &message);
533 
535  void fsdMessageSettingsChanged();
536 
538  void emitRawFsdMessage(const QString &fsdMessage, bool isSent);
539 
541  bool saveNetworkStatistics(const QString &server);
542 
545  void startPositionTimers();
546  void stopPositionTimers();
548 
550  void updateAtisMap(const QString &callsign, AtisLineType type, const QString &line);
551 
553  void pendingTimeoutCheck();
554 
557  fixAtcRange(const swift::misc::physical_quantities::CLength &networkRange,
559 
562  maxOrNotNull(const swift::misc::physical_quantities::CLength &l1,
564 
566  static QString noColons(const QString &input);
567 
569  void getVatsimAuthToken(const QString &cid, const QString &password,
570  const swift::misc::CSlot<void(const QString &)> &callback);
571 
573  static FlightType getFlightType(swift::misc::aviation::CFlightPlan::FlightRules flightRule);
574 
575 #ifdef SWIFT_VATSIM_SUPPORT
576  vatsim_auth *m_clientAuth = nullptr;
577  vatsim_auth *m_serverAuth = nullptr;
578 #endif
579  QString m_lastServerAuthChallenge;
580  qint64 m_loginSince = -1;
581  static constexpr qint64 PendingConnectionTimeoutMs = 7500;
582 
583  // Parser
584  QHash<QString, MessageType> m_messageTypeMapping;
585 
586  std::shared_ptr<QTcpSocket> m_socket =
587  std::make_shared<QTcpSocket>(this);
588  void connectSocketSignals();
589  void initiateConnection(std::shared_ptr<QTcpSocket> rehostingSocket = {}, const QString &rehostingHost = {});
590  void resolveLoadBalancing(const QString &host, std::function<void(const QString &)> callback);
591  bool m_rehosting = false;
592 
593  std::atomic_bool m_unitTestMode { false };
594  std::atomic_bool m_printToConsole { false };
595 
596  swift::misc::network::CConnectionStatus m_connectionStatus;
597  mutable QReadWriteLock m_lockConnectionStatus { QReadWriteLock::Recursive };
598 
599  swift::misc::aviation::CAircraftParts m_sentAircraftConfig;
600  swift::misc::CTokenBucket m_tokenBucket;
601  swift::misc::aviation::CCallsignSet m_interimPositionReceivers;
602  swift::misc::network::CTextMessageList m_textMessagesToConsolidate;
603  misc::CDigestSignal m_dsSendTextMessage { this, &CFSDClient::emitConsolidatedTextMessages,
604  std::chrono::milliseconds(250), 10 };
605 
607  struct AtisMessage
608  {
609  QString voiceRoom;
610  QStringList textLines;
611  QString zuluLogoff;
612  int lineCount = 0;
613  };
614 
615  QMap<QString, AtisMessage> m_mapAtisMessages;
616 
618  struct PendingAtisQuery
619  {
620  QDateTime m_queryTime = QDateTime::currentDateTimeUtc();
621  QStringList m_atisMessage;
622  };
623 
627 
629 
631  this, &CFSDClient::fsdMessageSettingsChanged
632  };
633  QFile m_rawFsdMessageLogFile;
634  std::atomic_bool m_rawFsdMessagesEnabled { false };
635  std::atomic_bool m_filterPasswordFromLogin { false };
636 
637  // timer parents are needed as we move to thread
638  QTimer m_scheduledConfigUpdate { this };
639  QTimer m_positionUpdateTimer { this };
640  QTimer m_interimPositionUpdateTimer { this };
641  QTimer m_visualPositionUpdateTimer { this };
642  QTimer m_fsdSendMessageTimer { this };
643 
644  qint64 m_additionalOffsetTime = 0;
645 
646  std::atomic_bool m_statistics { false };
647  QMap<QString, int> m_callStatistics;
648  QVector<QPair<qint64, QString>> m_callByTime;
649  mutable QReadWriteLock m_lockStatistics { QReadWriteLock::Recursive };
650 
651  // User data
654  QTextCodec *m_fsdTextCodec = nullptr;
655  SimType m_simType = SimType::Unknown;
656  PilotRating m_pilotRating = PilotRating::Unknown;
657  AtcRating m_atcRating = AtcRating::Unknown;
658  swift::misc::simulation::CSimulatorInfo m_simTypeInfo; // same as m_simType
659 
660  // Client data
661  QString m_clientName;
662  QString m_hostApplication;
663  int m_versionMajor = 0;
664  int m_versionMinor = 0;
665  int m_protocolRevision = 0;
666  ServerType m_serverType = ServerType::LegacyFsd;
667  Capabilities m_capabilities = Capabilities::None;
668 
669  // buffered data for FSD
670  swift::misc::aviation::CCallsign m_ownCallsign;
672  m_partnerCallsign;
674  m_ownAircraftIcaoCode;
676  m_ownAirlineIcaoCode;
677  QString m_ownLivery;
678  QString m_ownModelString;
679  std::atomic_bool m_sendLiveryString { true };
680  std::atomic_bool m_sendModelString { true };
681 
682  mutable QReadWriteLock m_lockUserClientBuffered {
683  QReadWriteLock::Recursive
684  };
685  QString getOwnCallsignAsString() const
686  {
687  QReadLocker l(&m_lockUserClientBuffered);
688  return m_ownCallsign.asString();
689  }
690 
691  QQueue<QString> m_queuedFsdMessages;
692 
694  void handleIllegalFsdState(const QString &message);
695 
696  static int constexpr c_maxOffsetTimes = 6;
697  static int constexpr c_processingIntervalMsec = 100;
698  static int constexpr c_updatePositionIntervalMsec =
699  5000;
700  static int constexpr c_updateInterimPositionIntervalMsec =
701  1000;
702  static int constexpr c_updateVisualPositionIntervalMsec =
703  200;
704  static int constexpr c_sendFsdMsgIntervalMsec = 10;
705  bool m_stoppedSendingVisualPositions = false;
706  bool m_serverWantsVisualPositions = false;
707  unsigned m_visualPositionUpdateSentCount = 0;
708  };
709 } // namespace swift::core::fsd
710 
711 #endif // SWIFT_CORE_FSD_CLIENT_H
FSD client Todo: Send (interim) data updates automatically Todo Check ':' in FSD messages....
Definition: fsdclient.h:86
void customPilotPacketReceived(const QString &sender, const QStringList &data)
Client responses received.
swift::misc::aviation::CCallsign getPresetPartnerCallsign() const
Partner callsign if any.
Definition: fsdclient.h:182
void planeInformationReceived(const QString &sender, const QString &aircraft, const QString &airline, const QString &livery)
Client responses received.
void flightPlanReceived(const swift::misc::aviation::CCallsign &callsign, const swift::misc::aviation::CFlightPlan &flightPlan)
Client responses received.
void rawFsdMessage(const swift::misc::network::CRawFsdMessage &rawFsdMessage)
Client responses received.
void textMessagesReceived(const swift::misc::network::CTextMessageList &messages)
Client responses received.
bool isConnected() const
Connection status.
Definition: fsdclient.h:255
void muteRequestReceived(bool mute)
Client responses received.
void atcDataUpdateReceived(const swift::misc::aviation::CCallsign &callsign, const swift::misc::physical_quantities::CFrequency &freq, const swift::misc::geo::CCoordinateGeodetic &pos, const swift::misc::physical_quantities::CLength &range)
Client responses received.
void setAtcRating(AtcRating rating)
Preset functions.
Definition: fsdclient.h:151
swift::misc::aviation::CCallsign getPresetCallsign() const
Callsign if any.
Definition: fsdclient.h:174
bool isStatisticsEnabled() const
Statistics enable functions.
Definition: fsdclient.h:267
void realNameResponseReceived(const QString &sender, const QString &realName)
Client responses received.
void setLoginMode(const swift::misc::network::CLoginMode &mode)
Preset functions.
Definition: fsdclient.h:130
void connectionStatusChanged(swift::misc::network::CConnectionStatus oldStatus, swift::misc::network::CConnectionStatus newStatus)
Connection status has been changed.
void setClientName(const QString &clientName)
Preset functions.
Definition: fsdclient.h:103
void interimPilotDataUpdatedReceived(const swift::misc::aviation::CAircraftSituation &situation)
Client responses received.
void planeInformationFsinnReceived(const swift::misc::aviation::CCallsign &callsign, const QString &airlineIcaoDesignator, const QString &aircraftDesignator, const QString &combinedAircraftType, const QString &modelString)
Client responses received.
void capabilityResponseReceived(const swift::misc::aviation::CCallsign &sender, swift::misc::network::CClient::Capabilities capabilities)
Client responses received.
void revbAircraftConfigReceived(const QString &sender, const QString &config, qint64 currentOffsetTimeMs)
Client responses received.
void setClientCapabilities(Capabilities capabilities)
Preset functions.
Definition: fsdclient.h:124
void setPartnerCallsign(const swift::misc::aviation::CCallsign &callsign)
Preset functions.
Definition: fsdclient.h:136
void pongReceived(const QString &sender, double elapsedTimeMs)
Client responses received.
const swift::misc::network::CServer & getServer() const
Get the server.
Definition: fsdclient.h:162
swift::misc::network::CLoginMode getLoginMode() const
Mode.
Definition: fsdclient.h:190
void printToConsole(bool on)
Debugging and UNIT tests.
Definition: fsdclient.h:277
void validAtcResponseReceived(const QString &callsign, bool isValidAtc)
Client responses received.
bool setStatisticsEnable(bool enabled)
Statistics enable functions.
Definition: fsdclient.h:262
void atisReplyReceived(const swift::misc::aviation::CCallsign &callsign, const swift::misc::aviation::CInformationMessage &atis)
We received a reply to one of our ATIS queries.
void visualPilotDataUpdateReceived(const swift::misc::aviation::CAircraftSituation &situation)
Client responses received.
void deleteAtcReceived(const QString &cid)
Client responses received.
PilotRating getPilotRating() const
Rating.
Definition: fsdclient.h:198
void addInterimPositionReceiver(const swift::misc::aviation::CCallsign &receiver)
Interim positions.
Definition: fsdclient.h:212
void com1FrequencyResponseReceived(const QString &sender, const swift::misc::physical_quantities::CFrequency &frequency)
Client responses received.
void setHostApplication(const QString &hostApplication)
Preset functions.
Definition: fsdclient.h:108
void setPilotRating(PilotRating rating)
Preset functions.
Definition: fsdclient.h:146
void removeInterimPositionReceiver(const swift::misc::aviation::CCallsign &receiver)
Interim positions.
Definition: fsdclient.h:216
void aircraftConfigReceived(const QString &sender, const QJsonObject &config, qint64 currentOffsetTimeMs)
Client responses received.
void pilotDataUpdateReceived(const swift::misc::aviation::CAircraftSituation &situation, const swift::misc::aviation::CTransponder &transponder)
Client responses received.
void textMessageSent(const swift::misc::network::CTextMessage &sentMessage)
We have sent a text message.
void atisLogoffTimeReplyReceived(const swift::misc::aviation::CCallsign &callsign, const QString &zuluTime)
We received a reply to one of our ATIS queries, containing the controller's planned logoff time.
void killRequestReceived(const QString &reason)
Kill request (aka kicked)
void setVersion(int major, int minor)
Preset functions.
Definition: fsdclient.h:113
void deletePilotReceived(const QString &cid)
Client responses received.
swift::misc::network::CConnectionStatus getConnectionStatus() const
Connection status.
Definition: fsdclient.h:250
void euroscopeSimDataUpdatedReceived(const swift::misc::aviation::CAircraftSituation &situation, const swift::misc::aviation::CAircraftParts &parts, qint64 currentOffsetTimeMs, const QString &model, const QString &livery)
Client responses received.
bool isDisconnected() const
Connection status.
Definition: fsdclient.h:256
void serverResponseReceived(const QString &sender, const QString &hostName)
Client responses received.
void severeNetworkError(const QString &errorMessage)
Network error.
Base class for a long-lived worker object which lives in its own thread.
Definition: worker.h:275
Callable wrapper for a member function with function signature F.
Definition: slot.h:62
Token bucket algorithm.
Definition: tokenbucket.h:21
Value object for ICAO classification.
Value object encapsulating information of aircraft's parts.
Definition: aircraftparts.h:26
Value object encapsulating information of an aircraft's situation.
Value object for ICAO classification.
Value object for a list of ATC stations.
Value object encapsulating information of a callsign.
Definition: callsign.h:30
const QString & asString() const
Get callsign (normalized)
Definition: callsign.h:96
Value object for a set of callsigns.
Definition: callsignset.h:26
Value object for a flight plan.
Definition: flightplan.h:148
FlightRules
Flight rules (VFR or IFR)
Definition: flightplan.h:155
Value object encapsulating information message (ATIS, METAR, TAF)
Class which can be directly used to access an.
Value object encapsulating information about a connection status.
Value object for a FSD setup.
Definition: fsdsetup.h:24
Value object encapsulating information about login mode.
Definition: loginmode.h:18
Value object for a raw FSD message.
Definition: rawfsdmessage.h:25
Value object encapsulating information of a server.
Definition: server.h:28
Value object encapsulating information of a text message.
Definition: textmessage.h:31
Value object encapsulating a list of text messages.
Direct in memory access to client (network client) data.
Direct threadsafe in memory access to current ecosystem.
Physical unit length (length)
Definition: length.h:18
Delegating class which can be directly used to access an.
Class which can be directly used to access an.
Comprehensive information of an aircraft.
Class which can be directly used to access an.
Simple hardcoded info about the corresponding simulator.
Definition: simulatorinfo.h:41
Direct threadsafe in memory access to own aircraft.
Direct thread safe in memory access to remote aircraft.
FlightType
Flight types.
Definition: enums.h:90
ServerType
FSD Server type.
Definition: enums.h:123
SimType
Flight simulator type.
Definition: enums.h:44
AtcRating
ATC ratings.
Definition: enums.h:15
PilotRating
Pilot ratings.
Definition: enums.h:33
ClientQueryType
Client query types.
Definition: enums.h:72
Capabilities
Client capability flags *‍/.
Definition: enums.h:130
TextMessageGroups
Message groups.
Definition: fsdclient.h:67
MessageType
Message type.
Definition: messagebase.h:19
QString messageToFSDString(const T &message)
String which will be send.
Definition: messagebase.h:96
#define SWIFT_CORE_EXPORT
Export a class or function from the library.