swift
clientidentification.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_CLIENTIDENTIFICATION_H
7 #define SWIFT_CORE_FSD_CLIENTIDENTIFICATION_H
8 
9 #include "config/buildconfig.h"
10 #include "core/fsd/messagebase.h"
11 
12 namespace swift::core::fsd
13 {
18  {
19  public:
21  ClientIdentification(const QString &sender, quint16 clientId, const QString &clientName, int clientVersionMajor,
22  int clientVersionMinor, const QString &userCid, const QString &sysUid,
23  const QString &initialChallenge);
24 
26  QStringList toTokens() const;
27 
29  static ClientIdentification fromTokens(const QStringList &tokens);
30 
32  static QString pdu() { return "$ID"; }
33 
36  std::uint16_t m_clientId = 0;
37  QString m_clientName;
38  int m_clientVersionMajor = swift::config::CBuildConfig::getVersion().majorVersion();
39  int m_clientVersionMinor = swift::config::CBuildConfig::getVersion().minorVersion();
40  QString m_userCid;
41  QString m_sysUid;
44 
45  private:
47  };
48 
50  inline bool operator==(const ClientIdentification &lhs, const ClientIdentification &rhs)
51  {
52  return lhs.sender() == rhs.sender() && lhs.receiver() == rhs.receiver() && lhs.m_clientId == rhs.m_clientId &&
55  lhs.m_sysUid == rhs.m_sysUid && lhs.m_initialChallenge == rhs.m_initialChallenge;
56  }
57 
59  inline bool operator!=(const ClientIdentification &lhs, const ClientIdentification &rhs) { return !(lhs == rhs); }
60 } // namespace swift::core::fsd
61 
62 #endif // SWIFT_CORE_FSD_CLIENTIDENTIFICATION_H
bool operator!=(const AddAtc &lhs, const AddAtc &rhs)
Not equal operator.
Definition: addatc.h:68
static const QVersionNumber & getVersion()
Version as QVersionNumber.
This packet is sent by any client that supports the VATSIM client authentication protocol,...
static QString pdu()
PDU identifier.
FSD message base class.
Definition: messagebase.h:58
QString sender() const
get message sender
Definition: messagebase.h:73
QString receiver() const
Get message receiver.
Definition: messagebase.h:79
#define SWIFT_CORE_EXPORT
Export a class or function from the library.