QtCraft API C++ classes QML types Handbook

QcDedicatedServer Class

qtcraft-headless –server (decision E-255): a server without a local player that network clients join. More...

Header: #include <headless/QcDedicatedServer.h>
Inherits: QObject

Public Types

struct Options

Public Functions

QcDedicatedServer(const QcDedicatedServer &)
QcDedicatedServer(QcDedicatedServer &&)
virtual ~QcDedicatedServer() override
QcStatus start(const QcDedicatedServer::Options &options)
QcDedicatedServer &operator=(QcDedicatedServer &&)
QcDedicatedServer &operator=(const QcDedicatedServer &)

Detailed Description

It opens (or makes) the world of its settings below <data>/worlds, listens, and runs until /stop on the optional console, the time limit, or SIGTERM/SIGINT, which save the world on the way out. Without a console it reads no standard input (a service).

Member Function Documentation

[delete] QcDedicatedServer::QcDedicatedServer(const QcDedicatedServer &)

Copy-constructs an instance of QcDedicatedServer. This function is deleted.

[delete] QcDedicatedServer::QcDedicatedServer(QcDedicatedServer &&)

Move-constructs an instance of QcDedicatedServer. This function is deleted.

[override virtual noexcept] QcDedicatedServer::~QcDedicatedServer()

Stops the server, which saves the world.

QcStatus QcDedicatedServer::start(const QcDedicatedServer::Options &options)

Opens the world of the settings in options (creating it below <data>/worlds when it does not exist), listens for network players and starts the console, the health log and the time limit as options ask. Returns an error when the world cannot be made or opened or the server cannot listen.

[delete] QcDedicatedServer &QcDedicatedServer::operator=(QcDedicatedServer &&)

Move-assigns other to this QcDedicatedServer instance. This function is deleted.

[delete] QcDedicatedServer &QcDedicatedServer::operator=(const QcDedicatedServer &)

Copy-assigns other to this QcDedicatedServer instance. This function is deleted.