QcJoinFailure Struct
Why joining a server failed (decision E-964): the step that failed as a kind, the address and the IP addresses tried, a translated reason and a hint what to check. More...
| Header: | #include <network/QcJoinFailure.h> |
Public Types
| enum class | Kind { Other, LookupFailed, LookupTimedOut, TimedOut, Refused, …, LoginRefused } |
| enum class | Step { Lookup, Connecting, Handshake } |
Public Functions
| QString | hint() const |
| QString | logText() const |
| bool | triedOnlyIpv6() const |
| QString | triedText() const |
Public Variables
| QcServerAddress | address |
| QString | detail |
| QcJoinFailure::Kind | kind |
| QString | reason |
| QStringList | steps |
| QList<QHostAddress> | tried |
Static Public Members
| QcJoinFailure::Kind | kindOf(QAbstractSocket::SocketError error, QcJoinFailure::Step step) |
| QcJoinFailure | of(QcJoinFailure::Kind kind, const QcServerAddress &address, const QString &detail = {}) |
| QString | reasonFor(QcJoinFailure::Kind kind, const QString &host) |
Detailed Description
The texts come from the translation (context "QcJoinFailure"), never from the kind's name; detail and steps keep Qt's English error texts for the log.
Member Type Documentation
enum class QcJoinFailure::Kind
The step of a join that failed.
| Constant | Value | Description |
|---|---|---|
QcJoinFailure::Kind::Other | 0 | anything else; reason says what |
QcJoinFailure::Kind::LookupFailed | 1 | the server's name was not found |
QcJoinFailure::Kind::LookupTimedOut | 2 | looking the server's name up took too long (slow or no name server) |
QcJoinFailure::Kind::TimedOut | 3 | no address answered the connection in time |
QcJoinFailure::Kind::Refused | 4 | nothing listens on the port (the address answered with a refusal) |
QcJoinFailure::Kind::Unreachable | 5 | the network cannot reach the address (or its family, as IPv6 without IPv6) |
QcJoinFailure::Kind::Blocked | 6 | the system does not allow the connection (firewall, permissions) |
QcJoinFailure::Kind::NoAnswer | 7 | the connection stands, but the TLS handshake got no answer in time |
QcJoinFailure::Kind::OtherVersion | 8 | the server hung up on the TLS handshake (a version without TLS) |
QcJoinFailure::Kind::TlsFailed | 9 | the TLS handshake failed otherwise |
QcJoinFailure::Kind::NoCertificate | 10 | the server showed no certificate |
QcJoinFailure::Kind::Untrusted | 11 | the server's certificate is not trusted (pin changed or not checkable) |
QcJoinFailure::Kind::ServerClosed | 12 | the server closed the connection while logging in, without a reason |
QcJoinFailure::Kind::LoginRefused | 13 | the server refused the login with a reason (password, version, content) |
enum class QcJoinFailure::Step
The step a socket error happened in.
| Constant | Value | Description |
|---|---|---|
QcJoinFailure::Step::Lookup | 0 | looking up the server's name |
QcJoinFailure::Step::Connecting | 1 | making the TCP connection to one of its addresses |
QcJoinFailure::Step::Handshake | 2 | the TCP connection stands, the TLS handshake runs |
Member Function Documentation
QString QcJoinFailure::hint() const
Returns a short translated hint what to check; empty when the reason says it all.
[static] QcJoinFailure::Kind QcJoinFailure::kindOf(QAbstractSocket::SocketError error, QcJoinFailure::Step step)
Returns the kind of the socket error that happened in step; a timeout of the connector counts as QAbstractSocket::SocketTimeoutError.
QString QcJoinFailure::logText() const
Returns everything in one English line for the log: kind, address, addresses, steps.
[static] QcJoinFailure QcJoinFailure::of(QcJoinFailure::Kind kind, const QcServerAddress &address, const QString &detail = {})
Returns the failure of kind at address with its reasonFor() text, or detail where the kind has none.
[static] QString QcJoinFailure::reasonFor(QcJoinFailure::Kind kind, const QString &host)
Returns the translated reason for kind at host; empty for the kinds whose reason comes from elsewhere (Other, Untrusted, LoginRefused).
bool QcJoinFailure::triedOnlyIpv6() const
Returns whether connections were tried and every one went to an IPv6 address.
QString QcJoinFailure::triedText() const
Returns the translated line naming the address and the IP addresses tried ("Tried …"); empty without an address.
Member Variable Documentation
QcServerAddress QcJoinFailure::address
The address the player joined; empty host for failures before an address was known.
QString QcJoinFailure::detail
Qt's error text of the last error (English), for the log.
QcJoinFailure::Kind QcJoinFailure::kind
The step that failed.
QString QcJoinFailure::reason
What failed, translated, for the player.
QStringList QcJoinFailure::steps
What happened at each address tried (English), for the log.
QList<QHostAddress> QcJoinFailure::tried
The IP addresses a connection was tried to, in order (after the name lookup).