19 namespace swift::misc::network
23 bool isAcceptingConnections)
25 m_address(
CObfuscation::decode(address)), m_port(port), m_user(user), m_ecosystem(ecosytem),
26 m_isAcceptingConnections(isAcceptingConnections), m_fsdSetup(fsdSetup)
30 : m_name(
"no name"), m_description(
"min.configuration"), m_address(address), m_port(port), m_user(user)
37 return QStringLiteral(
"%1 %2 %3:%4 %5 %6 accepting: %7 FSD: %8 con.since: %9")
38 .
arg(m_name, m_description, m_address)
41 m_fsdSetup.
toQString(i18n), this->isConnected() ? this->getFormattedUtcTimestampHms() :
"not con.");
57 static const CServer s =
CServer(
"ES Tower",
"Euroscope Tower view",
"localhost", 6809,
CUser(),
121 static const QString session(
"%1 %2 %3:%4 [%5] %6 %7");
166 case IndexPort: this->
setPort(variant.
value<qint32>());
break;
188 case IndexDescription:
193 case IndexPort:
return Compare::compare(this->
getPort(), compareValue.
getPort());
197 case IndexIsAcceptingConnections:
A sequence of log categories.
Utility class to obfuscate strings in the source code to make them unreadable.
static QString decode(const QString &inString, bool trimmed=true)
Decode string if it has the prefix, otherwise do nothing with it.
Non-owning reference to a CPropertyIndex with a subset of its features.
Q_REQUIRED_RESULT CPropertyIndexRef copyFrontRemoved() const
Copy with first element removed.
QString toQString(bool i18n=false) const
Cast as QString.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
bool isMyself() const
Myself index, used with nesting.
void push_back(const T &value)
Appends an element at the end of the sequence.
Streamable status message, e.g.
constexpr static auto SeverityError
Status severities.
constexpr static auto SeverityWarning
Status severities.
Status messages, e.g. from Core -> GUI.
void addCategories(const CLogCategoryList &categories)
Add some categories to all messages in the list.
void sortBySeverity()
Sort by severity, lowest first.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
int comparePropertyByIndex(CPropertyIndexRef index, const ITimestampBased &compareValue) const
Compare for index.
static bool canHandleIndex(CPropertyIndexRef index)
Can given index be handled.
qint64 m_timestampMSecsSinceEpoch
timestamp value
QString getFormattedUtcTimestampHms() const
As hh:mm:ss.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
ColumnIndex
Base class enums.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
QString toQString(bool i18n=false) const
Cast as QString.
Ecosystem of server belonging together.
bool isUnspecified() const
Unknown system?
int comparePropertyByIndex(CPropertyIndexRef index, const CEcosystem &compareValue) const
Compare for index.
static const CEcosystem & vatsim()
VATSIM eco system.
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const
Property by index.
static const CEcosystem & privateFsd()
FSD private.
const QString & getSystemString() const
Get the system string.
Value object for a FSD setup.
static const CFsdSetup & vatsimStandard()
Standard FSD setup for official VATSIM servers.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
int comparePropertyByIndex(CPropertyIndexRef index, const CFsdSetup &compareValue) const
Compare for index.
@ AllInterimPositions
all interim positions
Value object encapsulating information of a FSD server.
bool hasAddressAndPort() const
Address and port?
void setName(const QString &name)
Set name.
void setDescription(const QString &description)
Set description.
void setAddress(const QString &address)
Set address (e.g. myserver.foo.com)
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
QString convertToQString(bool i18n=false) const
Cast as QString.
const QString & getDescription() const
Get description.
bool matchesAddress(const QString &address) const
Same address?
bool hasName() const
Has name?
static const CServer & esTowerView()
ES tower server.
int getPort() const
Get port.
bool isConnected() const
Is connected?
bool matchesName(const QString &name) const
Matches server name?
CStatusMessageList validate() const
Validate, provide details about issues.
bool matchesAddressPort(const CServer &server) const
Same address and port?
CServer()=default
Default constructor.
bool isValidForLogin() const
Is valid for login?
const QString & getName() const
Get name.
const CFsdSetup & getFsdSetup() const
Get FSD setup.
void setIsAcceptingConnections(bool value)
Set whether server is accepting connections (allows to disable server temporarily or generally)
int comparePropertyByIndex(CPropertyIndexRef index, const CServer &compareValue) const
Compare for index.
const QString & getAddress() const
Get address.
void setPort(int port)
Set port.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
const CEcosystem & getEcosystem() const
Get the ecosystem.
void removeSendReceiveDetails(CFsdSetup::SendReceiveDetails sendReceive)
Remove send / receive details.
static const CServer & fscFsdServer()
FSC server.
bool isAcceptingConnections() const
Server is accepting connections (allows to disable server temporarily or generally)
const CUser & getUser() const
Get user.
void setEcosystem(const CEcosystem &ecosystem)
Set the ecosystem.
QString getServerSessionId(bool onlyConnected) const
Identifying a session, if not connected empty.
Value object encapsulating information of a user.
int comparePropertyByIndex(CPropertyIndexRef index, const CUser &compareValue) const
Compare for index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
bool hasCredentials() const
Valid credentials?
SWIFT_MISC_EXPORT const QString & boolToYesNo(bool v)
Bool to yes/no.
QString arg(Args &&... args) const const
int compare(QLatin1StringView s1, const QString &s2, Qt::CaseSensitivity cs)
bool isEmpty() const const
qsizetype length() const const
QString simplified() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QVariant fromValue(T &&value)
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.
#define SWIFT_VERIFY_X(COND, WHERE, WHAT)
A weaker kind of assert.