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);
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 muteRequestReceived(bool mute);
317 
319 
323 
326 
329 
333 
335  void severeNetworkError(const QString &errorMessage);
336 
338  void killRequestReceived(const QString &reason);
339 
340  private:
344 
348  void sendLogin(const QString &token = {});
349  void sendDeletePilot();
350  void sendDeleteAtc();
351  void sendPilotDataUpdate();
352  void sendInterimPilotDataUpdate();
353  void sendVisualPilotDataUpdate(bool slowUpdate = false);
354  void sendAtcDataUpdate(double latitude, double longitude);
355  void sendPing(const QString &receiver);
356  //
357  void sendClientQueryIsValidAtc(const swift::misc::aviation::CCallsign &callsign);
358  void sendClientQuery(ClientQueryType queryType, const swift::misc::aviation::CCallsign &receiver,
359  const QStringList &queryData = {});
360  void sendTextMessage(const QString &receiver, const QString &message);
361  void sendPlaneInformation(const QString &receiver, const QString &aircraft, const QString &airline = {},
362  const QString &livery = {});
363  void sendPlaneInformationFsinn(const swift::misc::aviation::CCallsign &callsign);
364  void sendAircraftConfiguration(const QString &receiver, const QString &aircraftConfigJson);
365  //
366  void sendMessageString(const QString &message);
367  void sendQueuedMessage();
369 
372  int increaseStatisticsValue(const QString &identifier, const QString &appendix = {});
373  int increaseStatisticsValue(const QString &identifier, int value);
375 
377  template <class T>
378  void sendQueuedMessage(const T &message)
379  {
380  if (!message.isValid()) { return; }
381  if (m_unitTestMode)
382  {
383  this->sendDirectMessage(message);
384  return;
385  }
386  m_queuedFsdMessages.enqueue(messageToFSDString(message));
387  }
388 
390  template <class T>
391  void sendDirectMessage(const T &message)
392  {
393  if (!message.isValid()) { return; }
394  this->sendMessageString(messageToFSDString(message));
395  }
396 
399  void sendFsdMessage(const QString &message);
400  void setUnitTestMode(bool on) { m_unitTestMode = on; }
402 
404  static const QString &defaultModelString()
405  {
406  static const QString dm("Cessna Skyhawk 172SP");
407  return dm;
408  }
409 
411  static const QString &noModelString()
412  {
413  static const QString noms("swift empty string");
414  return noms;
415  }
416 
418  QString getConfiguredModelString(const swift::misc::simulation::CSimulatedAircraft &myAircraft) const;
419 
421  QString getConfiguredLiveryString(const swift::misc::simulation::CSimulatedAircraft &myAircraft) const;
422 
424  struct JsonPackets
425  {
426  static const QJsonObject &aircraftConfigRequest();
427  };
428 
429  void sendAuthChallenge(const QString &challenge);
430  void sendAuthResponse(const QString &response);
431  void sendPong(const QString &receiver, const QString &timestamp);
432  void sendClientResponse(ClientQueryType queryType, const QString &receiver);
433 #ifdef SWIFT_VATSIM_SUPPORT
434  void sendClientIdentification(const QString &fsdChallenge);
435 #endif
436  void sendIncrementalAircraftConfig();
437 
438  void readDataFromSocket() { this->readDataFromSocketMaxLines(); }
439  void readDataFromSocketMaxLines(int maxLines = -1);
440  void parseMessage(const QString &lineRaw);
441 
442  QString socketErrorString(QAbstractSocket::SocketError error) const;
443  static QString socketErrorToQString(QAbstractSocket::SocketError error);
444 
446  void initializeMessageTypes();
447 
448  // Type to string
449  const QString &messageTypeToString(MessageType mt) const;
450 
453  void handleAtcDataUpdate(const QStringList &tokens);
454 #ifdef SWIFT_VATSIM_SUPPORT
455  void handleAuthChallenge(const QStringList &tokens);
456  void handleAuthResponse(const QStringList &tokens);
457 #endif
458  void handleDeleteATC(const QStringList &tokens);
459  void handleDeletePilot(const QStringList &tokens);
460  void handleTextMessage(const QStringList &tokens);
461  void handlePilotDataUpdate(const QStringList &tokens);
462  void handleVisualPilotDataUpdate(const QStringList &tokens, MessageType messageType);
463  void handleVisualPilotDataToggle(const QStringList &tokens);
464  void handleEuroscopeSimData(const QStringList &tokens);
465  void handlePing(const QStringList &tokens);
466  void handlePong(const QStringList &tokens);
467  void handleKillRequest(const QStringList &tokens);
468  void handleFlightPlan(const QStringList &tokens);
469  void handleClientQuery(const QStringList &tokens);
470  void handleClientResponse(const QStringList &tokens);
471  void handleServerError(const QStringList &tokens);
472  void handleCustomPilotPacket(const QStringList &tokens);
473 #ifdef SWIFT_VATSIM_SUPPORT
474  void handleFsdIdentification(const QStringList &tokens);
475 #endif
476  void handleRehost(const QStringList &tokens);
477  void handleMute(const QStringList &tokens);
478 
479  //
480  void handleUnknownPacket(const QString &line);
481  void handleUnknownPacket(const QStringList &tokens);
483 
484  void printSocketError(QAbstractSocket::SocketError socketError);
485  void handleSocketError(QAbstractSocket::SocketError socketError);
486  void handleSocketConnected();
487 
488  void updateConnectionStatus(swift::misc::network::CConnectionStatus newStatus);
489 
492  void consolidateTextMessage(const swift::misc::network::CTextMessage &textMessage);
493 
495  void emitConsolidatedTextMessages();
496 
498  qint64 receivedPositionFixTsAndGetOffsetTime(const swift::misc::aviation::CCallsign &callsign,
499  qint64 markerTs = -1);
500 
502  qint64 currentOffsetTime(const swift::misc::aviation::CCallsign &callsign) const;
503 
505  void clearState();
506 
508  void clearState(const swift::misc::aviation::CCallsign &callsign);
509 
511  void insertLatestOffsetTime(const swift::misc::aviation::CCallsign &callsign, qint64 offsetMs);
512 
514  qint64 averageOffsetTimeMs(const swift::misc::aviation::CCallsign &callsign, int &count,
515  int maxLastValues = c_maxOffsetTimes) const;
516 
517  bool isInterimPositionSendingEnabledForServer() const;
518  bool isInterimPositionReceivingEnabledForServer() const;
519  bool isVisualPositionSendingEnabledForServer() const;
520  const swift::misc::network::CFsdSetup &getSetupForServer() const;
521 
524  void maybeHandleAtisReply(const swift::misc::aviation::CCallsign &sender,
525  const swift::misc::aviation::CCallsign &receiver, const QString &message);
526 
528  void fsdMessageSettingsChanged();
529 
531  void emitRawFsdMessage(const QString &fsdMessage, bool isSent);
532 
534  bool saveNetworkStatistics(const QString &server);
535 
538  void startPositionTimers();
539  void stopPositionTimers();
541 
543  void updateAtisMap(const QString &callsign, AtisLineType type, const QString &line);
544 
546  void pendingTimeoutCheck();
547 
550  fixAtcRange(const swift::misc::physical_quantities::CLength &networkRange,
552 
555  maxOrNotNull(const swift::misc::physical_quantities::CLength &l1,
557 
559  static QString noColons(const QString &input);
560 
562  void getVatsimAuthToken(const QString &cid, const QString &password,
563  const swift::misc::CSlot<void(const QString &)> &callback);
564 
566  static FlightType getFlightType(swift::misc::aviation::CFlightPlan::FlightRules flightRule);
567 
568 #ifdef SWIFT_VATSIM_SUPPORT
569  vatsim_auth *m_clientAuth = nullptr;
570  vatsim_auth *m_serverAuth = nullptr;
571 #endif
572  QString m_lastServerAuthChallenge;
573  qint64 m_loginSince = -1;
574  static constexpr qint64 PendingConnectionTimeoutMs = 7500;
575 
576  // Parser
577  QHash<QString, MessageType> m_messageTypeMapping;
578 
579  std::shared_ptr<QTcpSocket> m_socket =
580  std::make_shared<QTcpSocket>(this);
581  void connectSocketSignals();
582  void initiateConnection(std::shared_ptr<QTcpSocket> rehostingSocket = {}, const QString &rehostingHost = {});
583  void resolveLoadBalancing(const QString &host, std::function<void(const QString &)> callback);
584  bool m_rehosting = false;
585 
586  std::atomic_bool m_unitTestMode { false };
587  std::atomic_bool m_printToConsole { false };
588 
589  swift::misc::network::CConnectionStatus m_connectionStatus;
590  mutable QReadWriteLock m_lockConnectionStatus { QReadWriteLock::Recursive };
591 
592  swift::misc::aviation::CAircraftParts m_sentAircraftConfig;
593  swift::misc::CTokenBucket m_tokenBucket;
594  swift::misc::aviation::CCallsignSet m_interimPositionReceivers;
595  swift::misc::network::CTextMessageList m_textMessagesToConsolidate;
596  misc::CDigestSignal m_dsSendTextMessage { this, &CFSDClient::emitConsolidatedTextMessages,
597  std::chrono::milliseconds(250), 10 };
598 
600  struct AtisMessage
601  {
602  QString m_voiceRoom;
603  QStringList m_textLines;
604  QString m_zuluLogoff;
605  int m_lineCount = 0;
606  };
607 
608  QMap<QString, AtisMessage> m_mapAtisMessages;
609 
611  struct PendingAtisQuery
612  {
614  QStringList m_atisMessage;
615  };
616 
620 
622 
624  this, &CFSDClient::fsdMessageSettingsChanged
625  };
626  QFile m_rawFsdMessageLogFile;
627  std::atomic_bool m_rawFsdMessagesEnabled { false };
628  std::atomic_bool m_filterPasswordFromLogin { false };
629 
630  // timer parents are needed as we move to thread
631  QTimer m_scheduledConfigUpdate { this };
632  QTimer m_positionUpdateTimer { this };
633  QTimer m_interimPositionUpdateTimer { this };
634  QTimer m_visualPositionUpdateTimer { this };
635  QTimer m_fsdSendMessageTimer { this };
636 
637  qint64 m_additionalOffsetTime = 0;
638 
639  std::atomic_bool m_statistics { false };
640  QMap<QString, int> m_callStatistics;
641  QVector<QPair<qint64, QString>> m_callByTime;
642  mutable QReadWriteLock m_lockStatistics { QReadWriteLock::Recursive };
643 
644  // User data
647  QStringEncoder m_encoder;
648  QStringDecoder m_decoder;
649  SimType m_simType = SimType::Unknown;
650  PilotRating m_pilotRating = PilotRating::Unknown;
651  AtcRating m_atcRating = AtcRating::Unknown;
652  swift::misc::simulation::CSimulatorInfo m_simTypeInfo; // same as m_simType
653 
654  // Client data
655  QString m_clientName;
656  QString m_hostApplication;
657  int m_versionMajor = 0;
658  int m_versionMinor = 0;
659  int m_protocolRevision = 0;
660  ServerType m_serverType = ServerType::LegacyFsd;
661  Capabilities m_capabilities = Capabilities::None;
662 
663  // buffered data for FSD
664  swift::misc::aviation::CCallsign m_ownCallsign;
666  m_partnerCallsign;
668  m_ownAircraftIcaoCode;
670  m_ownAirlineIcaoCode;
671  QString m_ownLivery;
672  QString m_ownModelString;
673  std::atomic_bool m_sendLiveryString { true };
674  std::atomic_bool m_sendModelString { true };
675 
676  mutable QReadWriteLock m_lockUserClientBuffered {
678  };
679  QString getOwnCallsignAsString() const
680  {
681  QReadLocker l(&m_lockUserClientBuffered);
682  return m_ownCallsign.asString();
683  }
684 
685  QQueue<QString> m_queuedFsdMessages;
686 
688  void handleIllegalFsdState(const QString &message);
689 
690  static int constexpr c_maxOffsetTimes = 6;
691  static int constexpr c_processingIntervalMsec = 100;
692  static int constexpr c_updatePositionIntervalMsec =
693  5000;
694  static int constexpr c_updateInterimPositionIntervalMsec =
695  1000;
696  static int constexpr c_updateVisualPositionIntervalMsec =
697  200;
698  static int constexpr c_sendFsdMsgIntervalMsec = 10;
699  bool m_stoppedSendingVisualPositions = false;
700  bool m_serverWantsVisualPositions = false;
701  unsigned m_visualPositionUpdateSentCount = 0;
702  };
703 } // namespace swift::core::fsd
704 
705 #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 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:300
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:93
QDateTime currentDateTimeUtc()
#define SWIFT_CORE_EXPORT
Export a class or function from the library.