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 <QTimer>
46 #include <QtGlobal>
47 
50 constexpr int PROTOCOL_REVISION_CLASSIC = 9;
51 constexpr int PROTOCOL_REVISION_VATSIM_ATC = 10;
52 constexpr int PROTOCOL_REVISION_VATSIM_AUTH = 100;
55 
56 class QNetworkReply;
57 
58 namespace SwiftFsdTest
59 {
60  class CTestFSDClient;
61 }
62 namespace swift::core::fsd
63 {
65  enum class TextMessageGroups
66  {
67  AllClients,
68  AllAtcClients,
69  AllPilotClients,
70  AllSups
71  };
72 
78  public swift::misc::network::IEcosystemProvider, // provide info about used ecosystem
79  public swift::misc::network::CClientAware, // network can set client information
80  public swift::misc::simulation::COwnAircraftAware, // network vatlib consumes own aircraft data and sets
81  // ICAO/callsign data
82  public swift::misc::simulation::CRemoteAircraftAware, // check if we really need to process network packets
83  // (e.g. parts)
84  public swift::misc::simulation::CSimulationEnvironmentAware // allows to consume ground elevations
85  {
86  Q_OBJECT
88 
89  public:
91  static const QStringList &getLogCategories();
92 
96  swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, QObject *owner = nullptr);
97 
102  void setClientName(const QString &clientName)
103  {
104  QWriteLocker l(&m_lockUserClientBuffered);
105  m_clientName = clientName;
106  }
107  void setHostApplication(const QString &hostApplication)
108  {
109  QWriteLocker l(&m_lockUserClientBuffered);
110  m_hostApplication = hostApplication;
111  }
112  void setVersion(int major, int minor)
113  {
114  QWriteLocker l(&m_lockUserClientBuffered);
115  m_versionMajor = major;
116  m_versionMinor = minor;
117  }
118 
119 #ifdef SWIFT_VATSIM_SUPPORT
120  void setClientIdAndKey(quint16 id, const QByteArray &key);
121 #endif
122 
124  {
125  QWriteLocker l(&m_lockUserClientBuffered);
126  m_capabilities = capabilities;
127  }
128  void setServer(const swift::misc::network::CServer &server);
130  {
131  QWriteLocker l(&m_lockUserClientBuffered);
132  m_loginMode = mode;
133  }
134  void setCallsign(const swift::misc::aviation::CCallsign &callsign);
136  {
137  QWriteLocker l(&m_lockUserClientBuffered);
138  m_partnerCallsign = callsign;
139  }
140  void setIcaoCodes(const swift::misc::simulation::CSimulatedAircraft &ownAircraft);
141  void setLiveryAndModelString(const QString &livery, bool sendLiveryString, const QString &modelString,
142  bool sendModelString);
143  void setSimType(const swift::misc::simulation::CSimulatorInfo &simInfo);
144  void setSimType(swift::misc::simulation::CSimulatorInfo::Simulator simulator);
146  {
147  QWriteLocker l(&m_lockUserClientBuffered);
148  m_pilotRating = rating;
149  }
150  void setAtcRating(AtcRating rating)
151  {
152  QWriteLocker l(&m_lockUserClientBuffered);
153  m_atcRating = rating;
154  }
156 
157  // ------ thread safe access to preset values -----
158 
162  {
163  QReadLocker l(&m_lockUserClientBuffered);
164  return m_server;
165  }
166 
169  QStringList getPresetValues() const;
170 
174  {
175  QReadLocker l(&m_lockUserClientBuffered);
176  return m_ownCallsign;
177  }
178 
182  {
183  QReadLocker l(&m_lockUserClientBuffered);
184  return m_partnerCallsign;
185  }
186 
190  {
191  QReadLocker l(&m_lockUserClientBuffered);
192  return m_loginMode;
193  }
194 
198  {
199  QReadLocker l(&m_lockUserClientBuffered);
200  return m_pilotRating;
201  }
202 
205  void connectToServer();
206  void disconnectFromServer();
208 
212  {
213  m_interimPositionReceivers.push_back(receiver);
214  }
216  {
217  m_interimPositionReceivers.remove(receiver);
218  }
220 
225  void sendClientQueryCapabilities(const swift::misc::aviation::CCallsign &callsign);
226  void sendClientQueryCom1Freq(const swift::misc::aviation::CCallsign &callsign);
227  void sendClientQueryRealName(const swift::misc::aviation::CCallsign &callsign);
228  void sendClientQueryServer(const swift::misc::aviation::CCallsign &callsign);
229  void sendClientQueryAtis(const swift::misc::aviation::CCallsign &callsign);
230  void sendClientQueryFlightPlan(const swift::misc::aviation::CCallsign &callsign);
231  void sendClientQueryAircraftConfig(const swift::misc::aviation::CCallsign &callsign);
232  void sendTextMessages(const swift::misc::network::CTextMessageList &messages);
233  void sendTextMessage(const swift::misc::network::CTextMessage &message);
234  void sendTextMessage(TextMessageGroups receiverGroup, const QString &message);
235  void sendRadioMessage(const QVector<int> &frequencieskHz, const QString &message);
236  void sendFlightPlan(const swift::misc::aviation::CFlightPlan &flightPlan);
237  void sendPlaneInfoRequest(const swift::misc::aviation::CCallsign &receiver);
238  void sendPlaneInfoRequestFsinn(const swift::misc::aviation::CCallsign &callsign);
240 
243  swift::misc::aviation::CCallsignSet getInterimPositionReceivers() const;
244  void setInterimPositionReceivers(const swift::misc::aviation::CCallsignSet &interimPositionReceivers);
246 
250  {
251  QReadLocker l(&m_lockConnectionStatus);
252  return m_connectionStatus;
253  }
254  bool isConnected() const { return this->getConnectionStatus().isConnected(); }
255  bool isDisconnected() const { return this->getConnectionStatus().isDisconnected(); }
256  bool isPendingConnection() const;
258 
261  bool setStatisticsEnable(bool enabled)
262  {
263  m_statistics = enabled;
264  return enabled;
265  }
266  bool isStatisticsEnabled() const { return m_statistics; }
268 
270  void clearStatistics();
271 
273  QString getNetworkStatisticsAsText(bool reset, const QString &separator = "\n");
274 
276  void printToConsole(bool on) { m_printToConsole = on; }
277 
279  void gracefulShutdown();
280 
281  signals:
288  void deleteAtcReceived(const QString &cid);
289  void deletePilotReceived(const QString &cid);
291  const swift::misc::aviation::CTransponder &transponder);
292  void pongReceived(const QString &sender, double elapsedTimeMs);
294  const swift::misc::aviation::CFlightPlan &flightPlan);
296  void aircraftConfigReceived(const QString &sender, const QJsonObject &config, qint64 currentOffsetTimeMs);
297  void validAtcResponseReceived(const QString &callsign, bool isValidAtc);
299  swift::misc::network::CClient::Capabilities capabilities);
300  void com1FrequencyResponseReceived(const QString &sender,
302  void realNameResponseReceived(const QString &sender, const QString &realName);
303  void serverResponseReceived(const QString &sender, const QString &hostName);
304  void planeInformationReceived(const QString &sender, const QString &aircraft, const QString &airline,
305  const QString &livery);
306  void customPilotPacketReceived(const QString &sender, const QStringList &data);
311  qint64 currentOffsetTimeMs, const QString &model, const QString &livery);
314  const QString &airlineIcaoDesignator, const QString &aircraftDesignator,
315  const QString &combinedAircraftType, const QString &modelString);
316  void revbAircraftConfigReceived(const QString &sender, const QString &config, qint64 currentOffsetTimeMs);
317  void muteRequestReceived(bool mute);
318 
320 
324 
326  void atisLogoffTimeReplyReceived(const swift::misc::aviation::CCallsign &callsign, const QString &zuluTime);
327 
330 
334 
336  void severeNetworkError(const QString &errorMessage);
337 
339  void killRequestReceived(const QString &reason);
340 
341  private:
345 
349  void sendLogin(const QString &token = {});
350  void sendDeletePilot();
351  void sendDeleteAtc();
352  void sendPilotDataUpdate();
353  void sendInterimPilotDataUpdate();
354  void sendVisualPilotDataUpdate(bool slowUpdate = false);
355  void sendAtcDataUpdate(double latitude, double longitude);
356  void sendPing(const QString &receiver);
357  //
358  void sendClientQueryIsValidAtc(const swift::misc::aviation::CCallsign &callsign);
359  void sendClientQuery(ClientQueryType queryType, const swift::misc::aviation::CCallsign &receiver,
360  const QStringList &queryData = {});
361  void sendTextMessage(const QString &receiver, const QString &message);
362  void sendPlaneInformation(const QString &receiver, const QString &aircraft, const QString &airline = {},
363  const QString &livery = {});
364  void sendPlaneInformationFsinn(const swift::misc::aviation::CCallsign &callsign);
365  void sendAircraftConfiguration(const QString &receiver, const QString &aircraftConfigJson);
366  //
367  void sendMessageString(const QString &message);
368  void sendQueuedMessage();
370 
373  int increaseStatisticsValue(const QString &identifier, const QString &appendix = {});
374  int increaseStatisticsValue(const QString &identifier, int value);
376 
378  template <class T>
379  void sendQueuedMessage(const T &message)
380  {
381  if (!message.isValid()) { return; }
382  if (m_unitTestMode)
383  {
384  this->sendDirectMessage(message);
385  return;
386  }
387  m_queuedFsdMessages.enqueue(messageToFSDString(message));
388  }
389 
391  template <class T>
392  void sendDirectMessage(const T &message)
393  {
394  if (!message.isValid()) { return; }
395  this->sendMessageString(messageToFSDString(message));
396  }
397 
400  void sendFsdMessage(const QString &message);
401  void setUnitTestMode(bool on) { m_unitTestMode = on; }
403 
405  static const QString &defaultModelString()
406  {
407  static const QString dm("Cessna Skyhawk 172SP");
408  return dm;
409  }
410 
412  static const QString &noModelString()
413  {
414  static const QString noms("swift empty string");
415  return noms;
416  }
417 
419  QString getConfiguredModelString(const swift::misc::simulation::CSimulatedAircraft &myAircraft) const;
420 
422  QString getConfiguredLiveryString(const swift::misc::simulation::CSimulatedAircraft &myAircraft) const;
423 
425  struct JsonPackets
426  {
427  static const QJsonObject &aircraftConfigRequest();
428  };
429 
430  void sendAuthChallenge(const QString &challenge);
431  void sendAuthResponse(const QString &response);
432  void sendPong(const QString &receiver, const QString &timestamp);
433  void sendClientResponse(ClientQueryType queryType, const QString &receiver);
434 #ifdef SWIFT_VATSIM_SUPPORT
435  void sendClientIdentification(const QString &fsdChallenge);
436 #endif
437  void sendIncrementalAircraftConfig();
438 
439  void readDataFromSocket() { this->readDataFromSocketMaxLines(); }
440  void readDataFromSocketMaxLines(int maxLines = -1);
441  void parseMessage(const QString &lineRaw);
442 
443  QString socketErrorString(QAbstractSocket::SocketError error) const;
444  static QString socketErrorToQString(QAbstractSocket::SocketError error);
445 
447  void initializeMessageTypes();
448 
449  // Type to string
450  const QString &messageTypeToString(MessageType mt) const;
451 
454  void handleAtcDataUpdate(const QStringList &tokens);
455 #ifdef SWIFT_VATSIM_SUPPORT
456  void handleAuthChallenge(const QStringList &tokens);
457  void handleAuthResponse(const QStringList &tokens);
458 #endif
459  void handleDeleteATC(const QStringList &tokens);
460  void handleDeletePilot(const QStringList &tokens);
461  void handleTextMessage(const QStringList &tokens);
462  void handlePilotDataUpdate(const QStringList &tokens);
463  void handleVisualPilotDataUpdate(const QStringList &tokens, MessageType messageType);
464  void handleVisualPilotDataToggle(const QStringList &tokens);
465  void handleEuroscopeSimData(const QStringList &tokens);
466  void handlePing(const QStringList &tokens);
467  void handlePong(const QStringList &tokens);
468  void handleKillRequest(const QStringList &tokens);
469  void handleFlightPlan(const QStringList &tokens);
470  void handleClientQuery(const QStringList &tokens);
471  void handleClientResponse(const QStringList &tokens);
472  void handleServerError(const QStringList &tokens);
473  void handleCustomPilotPacket(const QStringList &tokens);
474 #ifdef SWIFT_VATSIM_SUPPORT
475  void handleFsdIdentification(const QStringList &tokens);
476 #endif
477  void handleRevBClientPartsPacket(const QStringList &tokens);
478  void handleRehost(const QStringList &tokens);
479  void handleMute(const QStringList &tokens);
480 
481  //
482  void handleUnknownPacket(const QString &line);
483  void handleUnknownPacket(const QStringList &tokens);
485 
486  void printSocketError(QAbstractSocket::SocketError socketError);
487  void handleSocketError(QAbstractSocket::SocketError socketError);
488  void handleSocketConnected();
489 
490  void updateConnectionStatus(swift::misc::network::CConnectionStatus newStatus);
491 
494  void consolidateTextMessage(const swift::misc::network::CTextMessage &textMessage);
495 
497  void emitConsolidatedTextMessages();
498 
500  qint64 receivedPositionFixTsAndGetOffsetTime(const swift::misc::aviation::CCallsign &callsign,
501  qint64 markerTs = -1);
502 
504  qint64 currentOffsetTime(const swift::misc::aviation::CCallsign &callsign) const;
505 
507  void clearState();
508 
510  void clearState(const swift::misc::aviation::CCallsign &callsign);
511 
513  void insertLatestOffsetTime(const swift::misc::aviation::CCallsign &callsign, qint64 offsetMs);
514 
516  qint64 averageOffsetTimeMs(const swift::misc::aviation::CCallsign &callsign, int &count,
517  int maxLastValues = c_maxOffsetTimes) const;
518 
519  bool isInterimPositionSendingEnabledForServer() const;
520  bool isInterimPositionReceivingEnabledForServer() const;
521  bool isVisualPositionSendingEnabledForServer() const;
522  const swift::misc::network::CFsdSetup &getSetupForServer() const;
523 
526  void maybeHandleAtisReply(const swift::misc::aviation::CCallsign &sender,
527  const swift::misc::aviation::CCallsign &receiver, const QString &message);
528 
530  void fsdMessageSettingsChanged();
531 
533  void emitRawFsdMessage(const QString &fsdMessage, bool isSent);
534 
536  bool saveNetworkStatistics(const QString &server);
537 
540  void startPositionTimers();
541  void stopPositionTimers();
543 
545  void updateAtisMap(const QString &callsign, AtisLineType type, const QString &line);
546 
548  void pendingTimeoutCheck();
549 
552  fixAtcRange(const swift::misc::physical_quantities::CLength &networkRange,
554 
557  maxOrNotNull(const swift::misc::physical_quantities::CLength &l1,
559 
561  static QString noColons(const QString &input);
562 
564  void getVatsimAuthToken(const QString &cid, const QString &password,
565  const swift::misc::CSlot<void(const QString &)> &callback);
566 
568  static FlightType getFlightType(swift::misc::aviation::CFlightPlan::FlightRules flightRule);
569 
570 #ifdef SWIFT_VATSIM_SUPPORT
571  vatsim_auth *m_clientAuth = nullptr;
572  vatsim_auth *m_serverAuth = nullptr;
573 #endif
574  QString m_lastServerAuthChallenge;
575  qint64 m_loginSince = -1;
576  static constexpr qint64 PendingConnectionTimeoutMs = 7500;
577 
578  // Parser
579  QHash<QString, MessageType> m_messageTypeMapping;
580 
581  std::shared_ptr<QTcpSocket> m_socket =
582  std::make_shared<QTcpSocket>(this);
583  void connectSocketSignals();
584  void initiateConnection(std::shared_ptr<QTcpSocket> rehostingSocket = {}, const QString &rehostingHost = {});
585  void resolveLoadBalancing(const QString &host, std::function<void(const QString &)> callback);
586  bool m_rehosting = false;
587 
588  std::atomic_bool m_unitTestMode { false };
589  std::atomic_bool m_printToConsole { false };
590 
591  swift::misc::network::CConnectionStatus m_connectionStatus;
592  mutable QReadWriteLock m_lockConnectionStatus { QReadWriteLock::Recursive };
593 
594  swift::misc::aviation::CAircraftParts m_sentAircraftConfig;
595  swift::misc::CTokenBucket m_tokenBucket;
596  swift::misc::aviation::CCallsignSet m_interimPositionReceivers;
597  swift::misc::network::CTextMessageList m_textMessagesToConsolidate;
598  misc::CDigestSignal m_dsSendTextMessage { this, &CFSDClient::emitConsolidatedTextMessages,
599  std::chrono::milliseconds(250), 10 };
600 
602  struct AtisMessage
603  {
604  QString m_voiceRoom;
605  QStringList m_textLines;
606  QString m_zuluLogoff;
607  int m_lineCount = 0;
608  };
609 
610  QMap<QString, AtisMessage> m_mapAtisMessages;
611 
613  struct PendingAtisQuery
614  {
615  QDateTime m_queryTime = QDateTime::currentDateTimeUtc();
616  QStringList m_atisMessage;
617  };
618 
622 
624 
626  this, &CFSDClient::fsdMessageSettingsChanged
627  };
628  QFile m_rawFsdMessageLogFile;
629  std::atomic_bool m_rawFsdMessagesEnabled { false };
630  std::atomic_bool m_filterPasswordFromLogin { false };
631 
632  // timer parents are needed as we move to thread
633  QTimer m_scheduledConfigUpdate { this };
634  QTimer m_positionUpdateTimer { this };
635  QTimer m_interimPositionUpdateTimer { this };
636  QTimer m_visualPositionUpdateTimer { this };
637  QTimer m_fsdSendMessageTimer { this };
638 
639  qint64 m_additionalOffsetTime = 0;
640 
641  std::atomic_bool m_statistics { false };
642  QMap<QString, int> m_callStatistics;
643  QVector<QPair<qint64, QString>> m_callByTime;
644  mutable QReadWriteLock m_lockStatistics { QReadWriteLock::Recursive };
645 
646  // User data
649  QStringEncoder m_encoder;
650  QStringDecoder m_decoder;
651  SimType m_simType = SimType::Unknown;
652  PilotRating m_pilotRating = PilotRating::Unknown;
653  AtcRating m_atcRating = AtcRating::Unknown;
654  swift::misc::simulation::CSimulatorInfo m_simTypeInfo; // same as m_simType
655 
656  // Client data
657  QString m_clientName;
658  QString m_hostApplication;
659  int m_versionMajor = 0;
660  int m_versionMinor = 0;
661  int m_protocolRevision = 0;
662  ServerType m_serverType = ServerType::LegacyFsd;
663  Capabilities m_capabilities = Capabilities::None;
664 
665  // buffered data for FSD
666  swift::misc::aviation::CCallsign m_ownCallsign;
668  m_partnerCallsign;
670  m_ownAircraftIcaoCode;
672  m_ownAirlineIcaoCode;
673  QString m_ownLivery;
674  QString m_ownModelString;
675  std::atomic_bool m_sendLiveryString { true };
676  std::atomic_bool m_sendModelString { true };
677 
678  mutable QReadWriteLock m_lockUserClientBuffered {
679  QReadWriteLock::Recursive
680  };
681  QString getOwnCallsignAsString() const
682  {
683  QReadLocker l(&m_lockUserClientBuffered);
684  return m_ownCallsign.asString();
685  }
686 
687  QQueue<QString> m_queuedFsdMessages;
688 
690  void handleIllegalFsdState(const QString &message);
691 
692  static int constexpr c_maxOffsetTimes = 6;
693  static int constexpr c_processingIntervalMsec = 100;
694  static int constexpr c_updatePositionIntervalMsec =
695  5000;
696  static int constexpr c_updateInterimPositionIntervalMsec =
697  1000;
698  static int constexpr c_updateVisualPositionIntervalMsec =
699  200;
700  static int constexpr c_sendFsdMsgIntervalMsec = 10;
701  bool m_stoppedSendingVisualPositions = false;
702  bool m_serverWantsVisualPositions = false;
703  unsigned m_visualPositionUpdateSentCount = 0;
704  };
705 } // namespace swift::core::fsd
706 
707 #endif // SWIFT_CORE_FSD_CLIENT_H
FSD client Todo: Send (interim) data updates automatically Todo Check ':' in FSD messages....
Definition: fsdclient.h:85
void customPilotPacketReceived(const QString &sender, const QStringList &data)
Client responses received.
swift::misc::aviation::CCallsign getPresetPartnerCallsign() const
Partner callsign if any.
Definition: fsdclient.h:181
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:254
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:150
swift::misc::aviation::CCallsign getPresetCallsign() const
Callsign if any.
Definition: fsdclient.h:173
bool isStatisticsEnabled() const
Statistics enable functions.
Definition: fsdclient.h:266
void realNameResponseReceived(const QString &sender, const QString &realName)
Client responses received.
void setLoginMode(const swift::misc::network::CLoginMode &mode)
Preset functions.
Definition: fsdclient.h:129
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:102
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:123
void setPartnerCallsign(const swift::misc::aviation::CCallsign &callsign)
Preset functions.
Definition: fsdclient.h:135
void pongReceived(const QString &sender, double elapsedTimeMs)
Client responses received.
const swift::misc::network::CServer & getServer() const
Get the server.
Definition: fsdclient.h:161
swift::misc::network::CLoginMode getLoginMode() const
Mode.
Definition: fsdclient.h:189
void printToConsole(bool on)
Debugging and UNIT tests.
Definition: fsdclient.h:276
void validAtcResponseReceived(const QString &callsign, bool isValidAtc)
Client responses received.
bool setStatisticsEnable(bool enabled)
Statistics enable functions.
Definition: fsdclient.h:261
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:197
void addInterimPositionReceiver(const swift::misc::aviation::CCallsign &receiver)
Interim positions.
Definition: fsdclient.h:211
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:107
void setPilotRating(PilotRating rating)
Preset functions.
Definition: fsdclient.h:145
void removeInterimPositionReceiver(const swift::misc::aviation::CCallsign &receiver)
Interim positions.
Definition: fsdclient.h:215
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:112
void deletePilotReceived(const QString &cid)
Client responses received.
swift::misc::network::CConnectionStatus getConnectionStatus() const
Connection status.
Definition: fsdclient.h:249
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:255
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:299
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:66
constexpr int PROTOCOL_REVISION_VATSIM_AUTH
Protocol version.
Definition: fsdclient.h:52
constexpr int PROTOCOL_REVISION_VATSIM_VELOCITY
Protocol version.
Definition: fsdclient.h:53
constexpr int PROTOCOL_REVISION_CLASSIC
Protocol version.
Definition: fsdclient.h:50
constexpr int PROTOCOL_REVISION_VATSIM_ATC
Protocol version.
Definition: fsdclient.h:51
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.