QtCraft API C++ classes QML types Handbook

QcServerLogin Class

The server's side of the handshake (decision E-252). More...

Header: #include <server/login/QcServerLogin.h>

Public Types

Join

Public Functions

void expire()
void forgetPasswordKey()
void hello(QcServerClient &client, const QcMsg::Hello &hello)
void response(QcServerClient &client, const QcMsg::LoginResponse &response)
QList<QcPackFingerprint> serverPacks() const

Static Public Members

void refuse(QcServerClient &client, const QcMsg::Disconnect &reason)

Detailed Description

Hello checks the protocol version and the name; a local player (in-process host) joins at once, a remote client gets a LoginChallenge and must answer it within the login timeout: the server password, the same content packs and the identity registered for its name (or a new one: trust on first use). Then bans and whitelist (by name and fingerprint, decision E-253), the player limit and names already on the server decide. Every refusal is a translatable Disconnect.

Member Type Documentation

[alias] QcServerLogin::Join

Makes the admitted client a player (restores or spawns him, sends Welcome).

Member Function Documentation

void QcServerLogin::expire()

Disconnects clients whose login is not finished after the configured time.

void QcServerLogin::forgetPasswordKey()

The password changed (a world opened to the network): the derived key is made anew.

void QcServerLogin::hello(QcServerClient &client, const QcMsg::Hello &hello)

Handles hello of client: checks version and name, admits a local player at once and sends a remote one the LoginChallenge.

[static] void QcServerLogin::refuse(QcServerClient &client, const QcMsg::Disconnect &reason)

Refuses client: logs it, sends reason and closes the connection.

void QcServerLogin::response(QcServerClient &client, const QcMsg::LoginResponse &response)

Handles the answer response of client to its LoginChallenge: password, packs, identity, then access lists, player limit and names decide.

QList<QcPackFingerprint> QcServerLogin::serverPacks() const

Returns the packs a client must have: the configured fingerprints, else id and version of the content.