QtCraft API C++ classes QML types Handbook

QcSessionStates Namespace

The phases of a client session's connection; the phase itself is QcSessionState (QcClientSession::State, reported by QcClientSession::stateChanged()). More...

Header: #include <clientcore/session/QcSessionState.h>

Types

enum class Ending { None, PeerClosed, Lost, Refused, ProtocolMismatch, LocalError }
enum class State { Connecting, Loading, Playing, Disconnected }

Detailed Description

Type Documentation

enum class QcSessionStates::Ending

Why a client session's connection ended (decision E-964).

ConstantValueDescription
QcSessionStates::Ending::None0Not ended.
QcSessionStates::Ending::PeerClosed1The server closed the connection without a word.
QcSessionStates::Ending::Lost2The connection broke (a socket error; the reason is its text).
QcSessionStates::Ending::Refused3The server sent a Disconnect (QcClientSession::disconnectMessage()).
QcSessionStates::Ending::ProtocolMismatch4The server speaks another protocol version.
QcSessionStates::Ending::LocalError5This client ended the connection over an error of its own (a message it cannot take).

enum class QcSessionStates::State

The phase of a client session's connection.

ConstantValueDescription
QcSessionStates::State::Connecting0Hello sent, waiting for the server's Welcome.
QcSessionStates::State::Loading1Welcomed, waiting for the world and the first state of the player.
QcSessionStates::State::Playing2In the world.
QcSessionStates::State::Disconnected3The connection ended (QcClientSession::disconnectReason()).